nonth / react-native-face-detection

react-native face detection using Google ML Kit
MIT License
45 stars 21 forks source link

Android build failing #11

Open andrisole92 opened 7 months ago

andrisole92 commented 7 months ago

Failing:

[RUN_GRADLEW] FAILURE: [RUN_GRADLEW] Build failed with an exception. [RUN_GRADLEW] What went wrong: [RUN_GRADLEW] Could not determine the dependencies of task ':react-native-face-detection:bundleLibCompileToJarDebug'. [RUN_GRADLEW] > Could not create task ':react-native-face-detection:compileDebugJavaWithJavac'. [RUN_GRADLEW] > In order to compile Java 9+ source, please set compileSdkVersion to 30 or above [RUN_GRADLEW] Try: [RUN_GRADLEW] > Run with --stacktrace option to get the stack trace. [RUN_GRADLEW] > Run with --info or --debug option to get more log output. [RUN_GRADLEW] > Run with --scan to get full insights. [RUN_GRADLEW] * Get more help at https://help.gradle.org [RUN_GRADLEW] BUILD FAILED in 34s

MuazzezA commented 5 months ago

@andrisole92 Go into the package from node modules and edit the versions in android > build.gradle according to your own project.

example diff

--- a/node_modules/react-native-face-detection/android/build.gradle
+++ b/node_modules/react-native-face-detection/android/build.gradle

 android {
-    compileSdkVersion safeExtGet('FaceDetection_compileSdkVersion', 29)
-    buildToolsVersion safeExtGet('FaceDetection_buildToolsVersion', '29.0.2')
+    compileSdkVersion safeExtGet('FaceDetection_compileSdkVersion', 34)
+    buildToolsVersion safeExtGet('FaceDetection_buildToolsVersion', '34.0.0')
     defaultConfig {
-        minSdkVersion safeExtGet('FaceDetection_minSdkVersion', 16)
-        targetSdkVersion safeExtGet('FaceDetection_targetSdkVersion', 29)
+        minSdkVersion safeExtGet('FaceDetection_minSdkVersion', 26)
+        targetSdkVersion safeExtGet('FaceDetection_targetSdkVersion', 34)
         versionCode 1
         versionName "1.0"