Tell us which versions you are using:
Tell us to which platform this issue is related
Link the android version react-native link react-native-image-crop-picker
Build fails
> Task :app:transformDexArchiveWithExternalLibsDexMergerForDebug FAILED
D8: Cannot fit requested classes in a single dex file. Try supplying a main-dex list.
# methods: 69982 > 65536
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDebug'.
Looked at the documentation but can't find proguard rules for react-native-image-crop-picker. Any pointers? Thanks
Love react-native-image-crop-picker? Please consider supporting our collective:
馃憠 https://opencollective.com/react-native-image-crop-picker/donate
Here's how I fixed this for me.
updated android/build.gradle
ext {
...
supportLibVersion = "27.1.0"
...
}
added line to android\app\build.gradle
dependencies {
...
implementation 'com.android.support:design:27.1.0'
...
}
Try this
android/build.gradle
dependencies {
implementation ('com.android.support:design:25.3.1') {
force = true
}
implementation ('com.android.support:appcompat-v7:26.1.0') {
force = true
}
}
If it still fails a DEX error, you can try multidex
in android/build.gradle
defaultConfig {
...
vectorDrawables.useSupportLibrary = true //image picker
multiDexEnabled true
}
This creates multiple DEX files if it can't fit all the dependency references in one file.
link
Thanks all,
Tried the suggestions, didn't work :).
I'm not really android dev so it's pretty possible I'm doing something wrong.
Not really keen on testing multidex, enabling it for one package yields me doing something wrong, following online advice, unless you're sure what you're doing, it shouldn't be enabled.
Most helpful comment
If it still fails a DEX error, you can try multidex
in
android/build.gradleThis creates multiple DEX files if it can't fit all the dependency references in one file.
link