Closed emad-eldeen closed 2 years ago
Thank you for your using and report. But nowadays, little bit busy. Please wait a couple weeks. After that, I will check it.
Hi @Emad-Eldeen
Thank you for your report. You are right. It seems to not refer JNI lib, Now I struggling to refer it.
flutter_mediapipe/example/android/app/build.gradle
externalNativeBuild {
ndkBuild {
path '../../../android/src/main/jniLibs/arm64-v8a/libopencv_java3.so', '../../../android/src/main/jniLibs/arm64-v8a/libmediapipe_jni.so'
}
}
But, in order to do that, release key from google is required, it seems.
* Where:
Build file '/Users/hoge/flutter_mediapipe/example/android/app/build.gradle' line: 27
* What went wrong:
A problem occurred evaluating project ':app'.
> No signature of method: build_9vdixiby72husarqd7bfv6pf9.android() is applicable for argument types: (build_9vdixiby72husarqd7bfv6pf9$_run_closure2) values: [build_9vdixiby72husarqd7bfv6pf9$_run_closure2@2dd56c8c]
It needs much more time to solve it. Thank you for your patience.
If there is any other way to fix, please let me know. Actually, it is my first time to make Smartphone application.
@Emad-Eldeen
I am keeping to investigate it. I confirmed app-release.apk contains JNI libs with extracting file. The difference of size between app-debub.apk and app-release.apk is kernel_blob.bin size basically.
So, I think the reason is the permission for release. https://flutter.dev/docs/deployment/android
signingConfigs {
release {
keyAlias keystoreProperties['keyAlias']
keyPassword keystoreProperties['keyPassword']
storeFile keystoreProperties['storeFile'] ? file(keystoreProperties['storeFile']) : null
storePassword keystoreProperties['storePassword']
}
}
Currently, I don't want to release this sample for Android Play. If you tried other example of the app-release.apk, please let me know.
Thanks, tac.
Hello Tac, Thanks for the hint. I will check that and in case I was able to solve it, I will create a pull request.
BR
I was finally able to fix this issue. The issue is coming from R8 shrinking and minimizing in Gradle. It seems that it is detecting some mediapipe code as not needed and removing it for some reason. The issue was fixed by setting the following config in build.grade file:
Thank you for your help. I will check it.
Hi,
Thanks for the plugin. It works great in debugging apk. However, when I tried to build a release apk (flutter build apk), the app is crashing on opening the camera. I am building the example in your plugin package. I did not do any modifications on the code. I got the following errors in Logcat: