SNPE2.5 Android Sample Application
SNPE SDK Version: 2.5.0.4052
Example: $SNPE_ROOT/examples/android/image-classifiers
I follow https://developer.qualcomm.com/sites/default/files/docs/snpe/android_tutorial.html to build APP using Android Studio,
I figure out that the problem come from the process of init of SNPE:
private static synchronized void init(Application application) {if (!sInitialized) {System.loadLibrary("snpe-android"); // this line cause errortry {nativeInit(application.getApplicationInfo().nativeLibraryDir);} catch (IllegalStateException var2) {throw SnpeError.getInstance().getSnpeNativeError(var2.getMessage());}sInitialized = true;}}
Full error message here:
02/23 19:42:11: Launching 'MainActivity' on Pixel 4 API 31.Install successfully finished in 900 ms.$ adb shell am start -n "com.qualcomm.qti.snpe.imageclassifiers/com.qualcomm.qti.snpe.imageclassifiers.MainActivity" -a android.intent.action.MAIN -c android.intent.category.LASystem.loadLibrary("snpe-android");UNCHERConnected to process 12141 on device 'Pixel_4_API_31 [emulator-5554]'.Capturing and displaying logcat messages from application. This behavior can be disabled in the "Logcat output" section of the "Debugger" settings page.I/mageclassifier: Late-enabling -Xcheck:jniW/mageclassifier: Unexpected CPU variant for X86 using defaults: x86_64W/re-initialized>: type=1400 audit(0.0:179): avc: granted { execute } for path="/data/user/0/com.qualcomm.qti.snpe.imageclassifiers/code_cache/startup_agents/8dee6a62-agent.so" dev="dm-5" ino=196640 scontext=u:r:untrusted_app_25:s0:c512,c768 tcontext=u:object_r:app_data_file:s0:c512,c768 tclass=file app=com.qualcomm.qti.snpe.imageclassifiersV/studio.deploy: Startup agent attached to VMV/studio.deploy: No existing instrumentation found. Loading instrumentation from instruments-b5380c1f.jarW/mageclassifier: DexFile /data/data/com.qualcomm.qti.snpe.imageclassifiers/code_cache/.studio/instruments-b5380c1f.jar is in boot class path but is not in a known locationV/studio.deploy: Applying transforms with cached classesW/mageclassifier: Redefining intrinsic method java.lang.Thread java.lang.Thread.currentThread(). This may cause the unexpected use of the original definition of java.lang.Thread java.lang.Thread.currentThread()in methods that have already been compiled.W/mageclassifier: Redefining intrinsic method boolean java.lang.Thread.interrupted(). This may cause the unexpected use of the original definition of boolean java.lang.Thread.interrupted()in methods that have already been compiled.D/CompatibilityChangeReporter: Compat change id reported: 171979766; UID 10147; state: DISABLEDD/ApplicationLoaders: Returning zygote-cached class loader: /system/framework/android.test.base.jarV/GraphicsEnvironment: ANGLE Developer option for 'com.qualcomm.qti.snpe.imageclassifiers' set to: 'default'V/GraphicsEnvironment: Neither updatable production driver nor prerelease driver is supported.D/NetworkSecurityConfig: No Network Security Config specified, using platform defaultD/NetworkSecurityConfig: No Network Security Config specified, using platform defaultD/libEGL: loaded /vendor/lib64/egl/libEGL_emulation.soD/libEGL: loaded /vendor/lib64/egl/libGLESv1_CM_emulation.soD/libEGL: loaded /vendor/lib64/egl/libGLESv2_emulation.soD/AndroidRuntime: Shutting down VME/AndroidRuntime: FATAL EXCEPTION: mainProcess: com.qualcomm.qti.snpe.imageclassifiers, PID: 12141java.lang.UnsatisfiedLinkError: dlopen failed: library "libsnpe-android.so" not foundat java.lang.Runtime.loadLibrary0(Runtime.java:1077)at java.lang.Runtime.loadLibrary0(Runtime.java:998)at java.lang.System.loadLibrary(System.java:1656)at com.qualcomm.qti.snpe.SNPE.init(SNPE.java:72)at com.qualcomm.qti.snpe.SNPE.access$000(SNPE.java:57)at com.qualcomm.qti.snpe.SNPE$Logger.initializeLogging(SNPE.java:472)at com.qualcomm.qti.snpe.imageclassifiers.MainActivity.onCreate(MainActivity.java:25)at android.app.Activity.performCreate(Activity.java:8051)at android.app.Activity.performCreate(Activity.java:8031)at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1329)at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3608)at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3792)at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:103)at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2210)at android.os.Handler.dispatchMessage(Handler.java:106)at android.os.Looper.loopOnce(Looper.java:201)at android.os.Looper.loop(Looper.java:288)at android.app.ActivityThread.main(ActivityThread.java:7839)at java.lang.reflect.Method.invoke(Native Method)at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003)W/System: A resource failed to call close.
I'm looking forward to your reply, thanks in advance...
Dear developer,
Could you please help to share the full code snippet to us through Google driver or other cloud storage. That may help you to dig into the root cause.
Also, it's appreciate the you can share full logs to us.
BR.
Wei