Forums - SNPE2.5 Android Sample Application - java.lang.UnsatisfiedLinkError: dlopen failed: library "libsnpe-android.so" not found

2 posts / 0 new
Last post
SNPE2.5 Android Sample Application - java.lang.UnsatisfiedLinkError: dlopen failed: library "libsnpe-android.so" not found
ubeewu
Join Date: 14 Feb 23
Posts: 1
Posted: Thu, 2023-02-23 03:53
SNPE2.5 Android Sample Application 
 
SNPE SDK Version: 2.5.0.4052
Example: $SNPE_ROOT/examples/android/image-classifiers
 
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 error
 
            try {
                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");UNCHER
Connected 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:jni
W/mageclassifier: Unexpected CPU variant for X86 using defaults: x86_64
W/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.imageclassifiers
V/studio.deploy: Startup agent attached to VM
V/studio.deploy: No existing instrumentation found. Loading instrumentation from instruments-b5380c1f.jar
W/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 location
V/studio.deploy: Applying transforms with cached classes
W/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: DISABLED
D/ApplicationLoaders: Returning zygote-cached class loader: /system/framework/android.test.base.jar
V/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 default
D/NetworkSecurityConfig: No Network Security Config specified, using platform default
D/libEGL: loaded /vendor/lib64/egl/libEGL_emulation.so
D/libEGL: loaded /vendor/lib64/egl/libGLESv1_CM_emulation.so
D/libEGL: loaded /vendor/lib64/egl/libGLESv2_emulation.so
D/AndroidRuntime: Shutting down VM
E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.qualcomm.qti.snpe.imageclassifiers, PID: 12141
    java.lang.UnsatisfiedLinkError: dlopen failed: library "libsnpe-android.so" not found
        at 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...
 
 
 
 
 
  • Up0
  • Down0
weihuan
Join Date: 12 Apr 20
Posts: 270
Posted: Sat, 2023-02-25 21:25

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

  • Up0
  • Down0
or Register

Opinions expressed in the content posted here are the personal opinions of the original authors, and do not necessarily reflect those of Qualcomm Incorporated or its subsidiaries (“Qualcomm”). The content is provided for informational purposes only and is not meant to be an endorsement or representation by Qualcomm or any other party. This site may also provide links or references to non-Qualcomm sites and resources. Qualcomm makes no representations, warranties, or other commitments whatsoever about any non-Qualcomm sites or third-party resources that may be referenced, accessible from, or linked to this site.