I tried to upgrade my react native project to the newest version (0.59.2). Unfortunately, now when trying to run react-native run-android im getting this error:
Could not determine the dependencies of task ':app:preDebugBuild'. > Could not resolve all task dependencies for configuration ':app:debugRuntimeClasspath'. > Could not resolve project :react-native-camera.  Required by:      project :app   > Cannot choose between the following variants of project :react-native-camera:       - generalDebugRuntimeElements       - mlkitDebugRuntimeElements     All of them match the consumer attributes:       - Variant 'generalDebugRuntimeElements':           - Required com.android.build.api.attributes.BuildTypeAttr 'debug' and found compatible value 'debug'.           - Found com.android.build.api.attributes.VariantAttr 'generalDebug' but wasn't required.           - Required com.android.build.gradle.internal.dependency.AndroidTypeAttr 'Aar' and found compatible value 'Aar'.           - Required org.gradle.usage 'java-runtime' and found compatible value 'java-runtime'.           - Found react-native-camera 'general' but wasn't required.       - Variant 'mlkitDebugRuntimeElements':           - Required com.android.build.api.attributes.BuildTypeAttr 'debug' and found compatible value 'debug'.           - Found com.android.build.api.attributes.VariantAttr 'mlkitDebug' but wasn't required.           - Required com.android.build.gradle.internal.dependency.AndroidTypeAttr 'Aar' and found compatible value 'Aar'.           - Required org.gradle.usage 'java-runtime' and found compatible value 'java-runtime'.           - Found react-native-camera 'mlkit' but wasn't required.   I have already tried to create a new project however this results in the same error. Reinstalling the node modules didn't help either. On iOS it works fine.
Insert the following lines in android/app/build.gradle
android {   ...   defaultConfig {     ...     missingDimensionStrategy 'react-native-camera', 'general' <-- insert this line   } } 
                        Please insert the following line in android/app/build.gradle inside defaultConfig block either
missingDimensionStrategy 'react-native-camera', 'general'  or
missingDimensionStrategy 'react-native-camera', 'mlkit'  Add jitpack to android/build.gradle
allprojects {     repositories {         maven { url "https://jitpack.io" }         maven { url "https://maven.google.com" }     } }  Complete guide
Could not resolve project :react-native-camera. on Android
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With