-
Notifications
You must be signed in to change notification settings - Fork 8
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
Can't build Android version #19
Comments
It seems the crash is happening in coroutine scope in the file SegmentationAndStyleTransferViewModel.kt line 113 . Share the code causing the problem, I may help you. |
I'm trying to build the project as cloned, no modifications. The code is in the repo. |
After hours of struggling with versions I got no success too. |
The error is due to a mismatch in the version for the TFlite Support library which is used by the other libraries such as the task API. Try the following:
|
used latest tflite support library implementation("org.tensorflow:tensorflow-lite-support:0.1.0") |
For everyone visiting the thread, please use latest tflite support library to solve the issue, I used: |
ColorSpaceType not found. Tried many versions of tensorflow libraries, always the same failure. App crashes after taking a picture.
[...]
E/AndroidRuntime: FATAL EXCEPTION: DefaultDispatcher-worker-1
Process: com.e2etflite.segmentation_and_style_transfer, PID: 31987
java.lang.NoClassDefFoundError: Failed resolution of: Lorg/tensorflow/lite/support/image/ColorSpaceType;
at org.tensorflow.lite.task.vision.segmenter.OutputType$1.createMasksFromBuffer(OutputType.java:74)
at org.tensorflow.lite.task.vision.segmenter.ImageSegmenter.segment(ImageSegmenter.java:224)
at org.tensorflow.lite.task.vision.segmenter.ImageSegmenter.segment(ImageSegmenter.java:176)
at com.e2etflite.sample.backgroundstylizer.ui.segmentation.SegmentationAndStyleTransferViewModel.cropPersonFromPhoto(SegmentationAndStyleTransferViewModel.kt:113)
at com.e2etflite.sample.backgroundstylizer.ui.segmentation.SegmentationAndStyleTransferFragment$onViewCreated$1.invokeSuspend(SegmentationAndStyleTransferFragment.kt:193)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:56)
at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:571)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:738)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:678)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:665)
Caused by: java.lang.ClassNotFoundException: Didn't find class "org.tensorflow.lite.support.image.ColorSpaceType" on path: DexPathList[[zip file "/data/app/com.e2etflite.segmentation_and_style_transfer-LymZPOPdqyQVEYQ9JNYlRA==/base.apk"],nativeLibraryDirectories=[/data/app/com.e2etflite.segmentation_and_style_transfer-LymZPOPdqyQVEYQ9JNYlRA==/lib/arm, /data/app/com.e2etflite.segmentation_and_style_transfer-LymZPOPdqyQVEYQ9JNYlRA==/base.apk!/lib/armeabi-v7a, /system/lib, /vendor/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:134)
[,,,]
The text was updated successfully, but these errors were encountered: