mirror of
https://github.com/zhigang1992/react-native-firebase.git
synced 2026-04-21 02:26:30 +08:00
36 lines
968 B
Markdown
36 lines
968 B
Markdown
---
|
|
title: Enabling Multidex
|
|
description: Learn how to enable multidex on your Android application.
|
|
---
|
|
|
|
As more native dependencies are added to your project, it may bump you over the
|
|
64k method limit on the Android build system. Once this limit has been reached, you will start to see the following error
|
|
whilst attempting to build your Android application:
|
|
|
|
```
|
|
Execution failed for task ':app:mergeDexDebug'.
|
|
```
|
|
|
|
To learn more about multidex, view the official [Android documentation](https://developer.android.com/studio/build/multidex#mdex-gradle).
|
|
|
|
## Enabling Multidex
|
|
|
|
Open the `/android/app/build.gradle` file. Under `dependencies` we need to add the module, and then enable it
|
|
within the `defaultConfig`:
|
|
|
|
```groovy
|
|
android {
|
|
defaultConfig {
|
|
// ...
|
|
multiDexEnabled true
|
|
}
|
|
// ...
|
|
}
|
|
|
|
dependencies {
|
|
implementation 'com.android.support:multidex:1.0.3'
|
|
}
|
|
```
|
|
|
|
Once added, rebuild your application: `npx react-native run-android`.
|