-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🐛 Android Build Issue #13
Comments
Hm, it looks like ktlint is causing problems for you. Could you try removing it from the |
Thanks very much for your quick answer. What I did: I also updated Gradle plugin version from 3.5.3 to 4.1.2 on my project build.gradle file: After these modification Ktlint error during building disappeared but I had a new error message telling me to update minSdkVersion from 16 to 21 (minSdkVersion 21 is used by react-native-vision-camera): After updating minSdkVersion, I have now these warnings and error messages concerning react-native-vision-camera:
e: /Users/nm/Dev/MyApp/node_modules/react-native-vision-camera/android/src/main/java/com/mrousavy/camera/CameraViewModule.kt: (152, 74): Unresolved reference: R FAILURE: Build failed with an exception.
I then also upgraded Android Studio from 4.0 to 4.1.2 but I had the same buildings errors. Looking into the App example code in example folder I see that you have the following lines in the project build.gradle. I dont't know if I need them but I tried to add them in my build.gradle project file but I am still experiencing the same build errors. Here is my updated build.gradle: And my updated gradle.wrapper.properties: I don't know what I am missing ! |
Getting the same problem
|
Finally I found a way to build !!!! :) I needed to update SDK version from 29 to 30 in my project build.gradle: Now my build.gradle looks like: And my gradle.wrapper.properties: |
Oh, that should be a requirement. I've added that to the documentation, thanks for mentioning! |
Thanks !
Also minSdkVersion needs to be 21 "in build.gradle file in order to be able to build (we need at least the same minSdkVersion as react-native-vision-camera module): |
Hi,
Thanks very much for this new library
I am experiencing a build issue on Android just after having installed react-native-vision-camera.
IOS build is working fine.
I am getting the following error message when building with "npx react-native run-android" command.
Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.2/userguide/command_line_interface.html#sec:command_line_warnings
FAILURE: Build completed with 2 failures.
1: Task failed with an exception.
Where:
Build file '/Users/nm/Dev/MyApp/node_modules/react-native-vision-camera/android/build.gradle' line: 26
What went wrong:
A problem occurred evaluating project ':react-native-vision-camera'.
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
==============================================================================
2: Task failed with an exception.
A problem occurred configuring project ':react-native-vision-camera'.
When opening the project on Android Studio I get the following message:
11:14 AM Gradle sync failed: Could not run phased build action using Gradle distribution 'https://services.gradle.org/distributions/gradle-6.2-all.zip'.
Consult IDE log for more details (Help | Show Log) (1 s 252 ms)
For the first issue I found the following link if it may help:
https://stackoverflow.com/questions/65179275/the-kotlin-android-extensions-gradle-plugin-is-deprecated
Environment
React Native: 0.63.4
Android Studio: 4.0
Gradle Plugin: 3.5.3
Gradle: 6.2
Platform(s):
react-native version: 0.63.4
react-native-vision-camera version: 1.0.0
react-native-reanimated version: 1.13.1
My gradle-wrapper.properties file:
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https://services.gradle.org/distributions/gradle-6.2-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
My build.gradle file:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext {
buildToolsVersion = "29.0.2"
minSdkVersion = 16
compileSdkVersion = 29
targetSdkVersion = 29
googlePlayServicesVersion = "17.0.0"
}
repositories {
google()
jcenter()
}
dependencies {
classpath("com.android.tools.build:gradle:3.5.3")
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
mavenLocal()
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url("$rootDir/../node_modules/react-native/android")
}
maven {
// Android JSC is installed from npm
url("$rootDir/../node_modules/jsc-android/dist")
}
}
Many thanks for your help.
The text was updated successfully, but these errors were encountered: