Azure-Samples / cognitive-services-android-customvision-sample

Sample Anroid app for image classification using a TensorFlow model exported from Microsoft Cognitive Services Custom Vision
58 stars 57 forks source link

i am trying to develop android app but the app keeps on crashing #8

Closed knikhil52 closed 6 years ago

knikhil52 commented 6 years ago

Please provide us with the following information:

This issue is for a: (mark with an x)

- [ ] bug report -> please search issues before submitting
- [ ] feature request
- [ ] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)

Minimal steps to reproduce

Any log messages given by the failure

Expected/desired behavior

app crashes instantly when its opened

OS and Version?

android 6.0.1 api 23

Versions

Mention any other details that might be useful


Thanks! We'll be in touch soon.

djkormo commented 6 years ago

The same problem on my HTC Desire 630 Dual with Android 6.0.1. api 23

E/art: No implementation found for void demo.tensorflow.org.customvision_sample.env.ImageUtils.convertYUV420SPToARGB8888(byte[], int[], int, int, boolean) (tried Java_demo_tensorflow_org_customvision_1sample_env_ImageUtils_convertYUV420SPToARGB8888 and Java_demo_tensorflow_org_customvision_1sample_env_ImageUtils_convertYUV420SPToARGB8888_3B_3IIIZ) E/AndroidRuntime: FATAL EXCEPTION: main Process: demo.tensorflow.org.customvision_sample, PID: 29610 java.lang.UnsatisfiedLinkError: No implementation found for void demo.tensorflow.org.customvision_sample.env.ImageUtils.convertYUV420SPToARGB8888(byte[], int[], int, int, boolean) (tried Java_demo_tensorflow_org_customvision_1sample_env_ImageUtils_convertYUV420SPToARGB8888 and Java_demo_tensorflow_org_customvision_1sample_env_ImageUtilsconvertYUV420SPToARGB88883B_3IIIZ) at demo.tensorflow.org.customvision_sample.env.ImageUtils.convertYUV420SPToARGB8888(Native Method) at demo.tensorflow.org.customvision_sample.CameraActivity.onPreviewFrame(CameraActivity.java:110) at android.hardware.Camera$EventHandler.handleMessage(Camera.java:1591) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:168) at android.app.ActivityThread.main(ActivityThread.java:5885) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:797) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:687)

muhtadi commented 6 years ago

same problem djkormo

djkormo commented 6 years ago

Waiting for fix .....

bradlindblad commented 6 years ago

Same, crashes instantly for me, too.

djkormo commented 6 years ago

Here you have working similar repo. https://github.com/MindorksOpenSource/AndroidTensorFlowMachineLearningExample

DengYiping commented 6 years ago

Same Issue here. Both crashed on my emulator and HTC phone, also on Google Glasses. A bit of debugging is needed.

DengYiping commented 6 years ago

I did a bit of research on the following. The problem is caused by ImageUtils.java file. The file have some Native method call, and somehow it doesn't match the signature. Maybe consider recompile the c files. Cheers.

DengYiping commented 6 years ago

Also, reference to the C file here: https://github.com/tensorflow/tensorflow/blob/master/tensorflow/examples/android/jni/imageutils_jni.cc Apparently, this sample clones part of the tensorflow example code.

ksujanpaul commented 6 years ago

the application is crashing immediately when we open it The ImageUtils.java is contains some funtions they are like errors

DengYiping commented 6 years ago

@ksujanpaul I think part of this project's code is forked from the example of tensorflow, and for tensorflow there are some JNI code included. Those codes are not correctly compiled here, and I think that is the problem here.

raulfmiranda commented 6 years ago

Here, it is also crashing immediately when it is opened. It crashes at line 110 of CameraActivity.java: ImageUtils.convertYUV420SPToARGB8888(bytes, rgbBytes, previewWidth, previewHeight, false);

W/tensorflow: ImageUtils: Native library not found, native RGB -> YUV conversion may be unavailable.
E/art: No implementation found for void demo.tensorflow.org.customvision_sample.env.ImageUtils.convertYUV420SPToARGB8888(byte[], int[], int, int, boolean) 

@DengYiping how can I recompile the c files? Can you explain how to do that?

DengYiping commented 6 years ago

@raulfmiranda Please refer to the original repo from TensorFlow. This project basically just fork the project from Google and build the app on top.

delfu commented 6 years ago

closed by PR #17