Closed Jaybee4real closed 1 year ago
Hey everyone, i think i found a solution to it, please try this and don't forget to come back to indicate if it works for you! 😊
classpath 'com.android.tools.build:gradle:7.0.0'
(See example image below)@Jaybee4real - I have two higher versions: gradle 7.2 and build:gradle:7.0.1 and I still can't build for android when this library is used in my app.
Perhaps the combination of only 7.0.2 and 7.0.0 work?
Yes, that is what I found out @princefishthrower, you can try that
@Jaybee4real - I still can't build after implementing these changes. What version of react-native-vision-camera
are you using?
"react-native-vision-camera": "^2.14.1"
I fixed it by following the below steps :)
- watchman watch-del-all
- yarn cache clean --force
-
npm cache clean --force # optional - in case you have used npm
-
rm -rf node_modules/
rm yarn.lock
-
rm package-lock.json # optional - in case you have used npm
- rm -rf $TMPDIR/metro-*
- rm -rf $TMPDIR/haste-*
-
yarn install / npm install
-
yarn start --reset-cache
- cd ios && rm -rf Podfile.lock && rm -rf pods && pod install --verbose
Hey everyone, i think i found a solution to it, please try this and don't forget to come back to indicate if it works for you! 😊
- --> Step 1: Go into your gradle-wrapper.properties file and upgrade your gradle version to at least version 7.0.2 (See example image below)
- ---> Step 2: Go into your android/build.gradle and add an extra classpath to your dependencies in android/build.gradle
classpath 'com.android.tools.build:gradle:7.0.0'
(See example image below)
- ---> Optional Step: you might want to change all your dependencies URL to use "https" instead of "http" in your allProjects.repositories in android/build.gradle as you might face an error when building if you do not do this (See example image below)
@Jaybee4real I followed these steps, but I end up having this error, do you know how to fix it?
> Task :react-native-gradle-plugin:compileKotlin FAILED
FAILURE: Build failed with an exception.
@MohamedAhmed122
Check your bash_profile, do you see these values there?
(code ~/.bash_profile)
export ANDROID_SDK_ROOT=$HOME/Library/Android/sdk export PATH=$PATH:$ANDROID_SDK_ROOT/emulator export PATH=$PATH:$ANDROID_SDK_ROOT/platform-tools **export JAVA_HOME=$(/usr/libexec/java_home -v 1.8)**
(Especially the JAVA_HOME)
(EDIT): If you use a mac, you might want to check your ~/.zshrc file
Will be closing this now
Hey everyone, i think i found a solution to it, please try this and don't forget to come back to indicate if it works for you! 😊
- --> Step 1: Go into your gradle-wrapper.properties file and upgrade your gradle version to at least version 7.0.2 (See example image below)
- ---> Step 2: Go into your android/build.gradle and add an extra classpath to your dependencies in android/build.gradle
classpath 'com.android.tools.build:gradle:7.0.0'
(See example image below)
- ---> Optional Step: you might want to change all your dependencies URL to use "https" instead of "http" in your allProjects.repositories in android/build.gradle as you might face an error when building if you do not do this (See example image below)
This worked for me.
What were you trying to do?
I was trying to build the app with the package on android
Reproduceable Code
What happened instead?
The app crashes with the message above at 97% with the below error
Relevant log output
Device
Samsung S10 plus (Android 12)
VisionCamera Version
2.14.1
Additional information