Reputation: 757
My app builds fine on Android Studio, it runs fine with react-native run-android
but when I try to generate the .apk
it fails with ./gradlew assembleRelease
command. I get the following error.
* What went wrong:
Could not determine the dependencies of task ':react-native-camera:compileMlkitReleaseAidl'.
> Could not resolve all task dependencies for configuration ':react-native-camera:mlkitReleaseCompileClasspath'.
> Could not find com.google.firebase:firebase-ml-vision:12.0.1.
Required by:
project :react-native-camera
> Could not find com.google.firebase:firebase-ml-vision-face-model:12.0.1.
Required by:
project :react-native-camera
"react": "16.8.3",
"react-native": "0.59.10",
"react-native-camera": "^3.7.1",
"react-native-image-picker": "^0.28.1",
"react-native-qrcode-scanner": "^1.2.3",
classpath('com.android.tools.build:gradle:3.4.0') // FROM android/gradle.build
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip // FROM gradle-wrapper.properties
I have followed the installation instructions here and followed GitHub links here and here.
All have the same solution which I have completed, i.e. adding;
android {
defaultConfig {
missingDimensionStrategy 'react-native-camera', 'general'
}
}
The issue is because android is looking for mlkit
dependencies even when I have not opted for them. I think this is happening because I use react-native-image-picker
and react-native-qrcode-scanner
one of these packages is looking mlkit dependencies. But I don't know how to debug and fix it.
Upvotes: 1
Views: 1820
Reputation: 31
Be sure that in the android/app/build.gradle you added this
missingDimensionStrategy 'react-native-camera', 'general' in *defaultConfig*
Then check your internet connectivity is good while building. If it doesn't work, use npm run release
Upvotes: 1