surendramaran / YOLO

YOLOv8, YOLOv9, YOLOv10 in Mobile Devices, run different machine learning model inside Android and iOS.
https://www.surendramaran.com/
Other
39 stars 17 forks source link

Build error with YOLOv8-Object-Detector-Android-Tflite #3

Open tranzmatt opened 3 months ago

tranzmatt commented 3 months ago

$:~/StudioProjects/YOLO-android/YOLOv8-Object-Detector-Android-Tflite$ ./gradlew build Configuration on demand is an incubating feature.

Task :app:processDebugMainManifest [org.tensorflow:tensorflow-lite-support:0.4.4] /home/user/.gradle/caches/transforms-4/e82340e14be75f5c2d5f7997634811c1/transformed/tensorflow-lite-support-0.4.4/AndroidManifest.xml Warning: Namespace 'org.tensorflow.lite.support' is used in multiple modules and/or libraries: org.tensorflow:tensorflow-lite-support:0.4.4, org.tensorflow:tensorflow-lite-support-api:0.4.4. Please ensure that all modules and libraries have a unique namespace. For more information, See https://developer.android.com/studio/build/configure-app-module#set-namespace

Task :app:processReleaseMainManifest [org.tensorflow:tensorflow-lite-support:0.4.4] /home/user/.gradle/caches/transforms-4/e82340e14be75f5c2d5f7997634811c1/transformed/tensorflow-lite-support-0.4.4/AndroidManifest.xml Warning: Namespace 'org.tensorflow.lite.support' is used in multiple modules and/or libraries: org.tensorflow:tensorflow-lite-support:0.4.4, org.tensorflow:tensorflow-lite-support-api:0.4.4. Please ensure that all modules and libraries have a unique namespace. For more information, See https://developer.android.com/studio/build/configure-app-module#set-namespace

Task :app:compileDebugKotlin e: file:///home/user/StudioProjects/YOLO-android/YOLOv8-Object-Detector-Android-Tflite/app/src/main/java/com/surendramaran/yolov8tflite/MainActivity.kt:21:39 Unresolved reference: databinding e: file:///home/user/StudioProjects/YOLO-android/YOLOv8-Object-Detector-Android-Tflite/app/src/main/java/com/surendramaran/yolov8tflite/MainActivity.kt:26:35 Unresolved reference: ActivityMainBinding e: file:///home/user/StudioProjects/YOLO-android/YOLOv8-Object-Detector-Android-Tflite/app/src/main/java/com/surendramaran/yolov8tflite/MainActivity.kt:39:19 Unresolved reference: ActivityMainBinding e: file:///home/user/StudioProjects/YOLO-android/YOLOv8-Object-Detector-Android-Tflite/app/src/main/java/com/surendramaran/yolov8tflite/MainActivity.kt:59:13 Unresolved reference: isGpu e: file:///home/user/StudioProjects/YOLO-android/YOLOv8-Object-Detector-Android-Tflite/app/src/main/java/com/surendramaran/yolov8tflite/MainActivity.kt:59:48 Cannot infer a type for this parameter. Please specify it explicitly. e: file:///home/user/StudioProjects/YOLO-android/YOLOv8-Object-Detector-Android-Tflite/app/src/main/java/com/surendramaran/yolov8tflite/MainActivity.kt:59:60 Cannot infer a type for this parameter. Please specify it explicitly. e: file:///home/user/StudioProjects/YOLO-android/YOLOv8-Object-Detector-Android-Tflite/app/src/main/java/com/surendramaran/yolov8tflite/MainActivity.kt:64:87 Unresolved reference: R e: file:///home/user/StudioProjects/YOLO-android/YOLOv8-Object-Detector-Android-Tflite/app/src/main/java/com/surendramaran/yolov8tflite/MainActivity.kt:66:87 Unresolved reference: R e: file:///home/user/StudioProjects/YOLO-android/YOLOv8-Object-Detector-Android-Tflite/app/src/main/java/com/surendramaran/yolov8tflite/MainActivity.kt:189:35 Variable expected e: file:///home/user/StudioProjects/YOLO-android/YOLOv8-Object-Detector-Android-Tflite/app/src/main/java/com/surendramaran/yolov8tflite/MainActivity.kt:191:17 Unresolved reference: setResults e: file:///home/user/StudioProjects/YOLO-android/YOLOv8-Object-Detector-Android-Tflite/app/src/main/java/com/surendramaran/yolov8tflite/MainActivity.kt:192:17 Unresolved reference: invalidate e: file:///home/user/StudioProjects/YOLO-android/YOLOv8-Object-Detector-Android-Tflite/app/src/main/java/com/surendramaran/yolov8tflite/OverlayView.kt:46:60 Unresolved reference: R

Task :app:compileDebugKotlin FAILED

FAILURE: Build failed with an exception.

Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

For more on this, please refer to https://docs.gradle.org/8.7/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation.

surendramaran commented 3 months ago

Haven't try gradle 9.0 but these -api dependencies often cause problems. can you try to comment implementation("org.tensorflow:tensorflow-lite-api:2.16.1"), it won't affect the code.

tranzmatt commented 3 months ago

I modified your working YOLOv8-TfLite-Object-Detector, updated gradle to 8.5.1 and merged it into this repo and it works. I also renamed yolov8tflite to yolov8objectdetection for more clarity. I can do a PR if you want and let you cherry pick.