Skip to content

Commit 88b58eb

Browse files
committed
docs(*): move enabling multidex to root
1 parent 670f0b1 commit 88b58eb

File tree

4 files changed

+46
-35
lines changed

4 files changed

+46
-35
lines changed

docs/enabling-multidex.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
---
2+
title: Enabling Multidex
3+
description: Learn how to enable multidex on your Android application.
4+
---
5+
6+
As more native dependencies are added to your project, it may bump you over the
7+
64k method limit on the Android build system. Once this limit has been reached, you will start to see the following error
8+
whilst attempting to build your Android application:
9+
10+
```
11+
Execution failed for task ':app:mergeDexDebug'.
12+
```
13+
14+
To learn more about multidex, view the offical [Android documentation](https://developer.android.com/studio/build/multidex#mdex-gradle).
15+
16+
## Enabling Multidex
17+
18+
Open the `/android/app/build.gradle` file. Under `dependencies` we need to add the module, and then enable it
19+
within out `defaultConfig`:
20+
21+
```groovy
22+
android {
23+
defaultConfig {
24+
// ...
25+
multiDexEnabled true
26+
}
27+
// ...
28+
}
29+
30+
dependencies {
31+
implementation 'com.android.support:multidex:1.0.3'
32+
}
33+
```
34+
35+
Once added, rebuild your application: `npx react-native run-android`.

docs/firestore/enabling-multidex.md

Lines changed: 0 additions & 33 deletions
This file was deleted.

docs/firestore/usage/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ cd ios/ && pod install
2525
If you're using an older version of React Native without autolinking support, or wish to integrate into an existing project,
2626
you can follow the manual installation steps for [iOS](/firestore/usage/installation/ios) and [Android](firestore/usage/installation/android).
2727

28-
In some scenarios, your Android build may fail with the `app:mergeDexDebug` error. This required that multidex is enabled
29-
for your application. To learn more, read the [Enabling Multidex](/firestore/enabling-multidex) documentation.
28+
If you have started to receive a `app:mergeDexDebug` error after adding Cloud Firestore, please read the
29+
[Enabling Multidex](/enabling-multidex) documentation for more information on how to resolve this error.
3030

3131
# What does it do
3232

docs/index.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,15 @@ you can follow the manual installation steps for [iOS](/install-ios) and [Androi
156156

157157
# Miscellaneous
158158

159+
## Android Enabling Multidex
160+
161+
As your application starts to grow with more native dependencies, your builds may start to fail with the common
162+
`Execution failed for task ':app:mergeDexDebug'` error. This error occurs when Android reaches the
163+
[64k methods](https://developer.android.com/studio/build/multidex) limit.
164+
165+
One common solution is to [enable multidex](/enabling-multidex) support for Android. This is a common solution to solving
166+
the problem, however it is recommended you read the Android documentation to understand how it may impact your application.
167+
159168
## Hermes Support
160169

161170
At this time, React Native Firebase does not support the [Hermes](https://hermesengine.dev/) JavaScript engine due to

0 commit comments

Comments
 (0)