nnperfwins / nnPerf

10 stars 3 forks source link

Android Studio 构建APK闪退 #1

Closed B-JackMao closed 9 months ago

B-JackMao commented 11 months ago

当我使用给定配置构建程序时,同步和运行没有出现任何报错,但是APK会闪退,logcat提示一下问题: 2023-11-04 23:24:28.551 31542-31570/com.example.android.nnPerf E/AndroidRuntime: FATAL EXCEPTION: CameraBackground Process: com.example.android.nnPerf, PID: 31542 java.lang.IllegalArgumentException: ByteBuffer is not a valid flatbuffer model at org.tensorflow.lite.NativeInterpreterWrapper.createModelWithBuffer(Native Method) at org.tensorflow.lite.NativeInterpreterWrapper.(NativeInterpreterWrapper.java:74) at org.tensorflow.lite.Interpreter.(Interpreter.java:310) at com.example.android.nnPerf.ImageClassifier.(ImageClassifier.java:107) at com.example.android.nnPerf.ImageClassifierFloatMobileNetV3_Small.(ImageClassifierFloatMobileNetV3_Small.java:42) at com.example.android.nnPerf.Camera2BasicFragment.lambda$updateActiveModel$0$Camera2BasicFragment(Camera2BasicFragment.java:374) at com.example.android.nnPerf.Camera2BasicFragment$$Lambda$0.run(Unknown Source:8) at android.os.Handler.handleCallback(Handler.java:942) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loopOnce(Looper.java:201) at android.os.Looper.loop(Looper.java:288) at android.os.HandlerThread.run(HandlerThread.java:67)

nnperfwins commented 11 months ago

Thank you for your attention. Could you please provide the model of the deployment device and the operating system version? Have you encountered any errors during the direct installation via the APK? We suggest confirming whether permissions for pop-ups are allowed before initiating the installation. Also, please double-check the version numbers of various components in Android Studio. If there are still issues, we look forward to your response, and we are here to assist you in resolving them.

B-JackMao commented 11 months ago

手机型号:pixel4 ,Android 12;我在安装APK过程中没有遇到任何报错, Android Studio中各个组件的版本号与readme中要求的版本号相同。

nnperfwins commented 11 months ago

We have reconfirmed on the Pixel 3XL device with the Android 12 version and did not reproduce your issue. We suggest checking the integrity of the .tflite model file or trying to install and test the app directly using the nnPerf_v1.0.apk we provided. We will go ahead and get a Pixel 4 for further testing, and we appreciate your feedback.

B-JackMao commented 11 months ago

OK,thank you very much.