Page 1 of 1

java.lang.UnsatisfiedLinkError: couldn't find DSO to load: libc++_shared.so caused by: couldn't find DSO to load: libc.

Posted: 2024年 Aug 13日 03:12
by honeyjar

I'm getting this very strange error with an old (free) version of the lib for Android

Code: Select all

implementation("com.tuya.smart:tuyasmart:3.26.5")

the code itself is trivial:

Code: Select all

TuyaHomeSdk.setDebugMode(true);
TuyaSmartSdk.setDebugMode(true);
TuyaSmartSdk.init(getApplication());
TuyaSdk.init(getApplication(), TuyaSmartSdk.getAppkey(), TuyaSmartSdk.getAppSecret()); // <= here it dumps!

This the logs content:

Code: Select all

java.lang.UnsatisfiedLinkError: couldn't find DSO to load: libc++_shared.so caused by: couldn't find DSO to load: libc.so
at com.facebook.soloader.SoLoader.doLoadLibraryBySoName(SoLoader.java:789)
at com.facebook.soloader.SoLoader.loadLibraryBySoName(SoLoader.java:639)
at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:577)
at com.facebook.soloader.SoLoader.loadLibrary(SoLoader.java:525)
at com.tuya.smart.security.load.TuyaLibraryLoader.securityLoadLibrary(TuyaLibraryLoader.java:17)
at com.tuya.smart.security.jni.JNICLibrary.doCommandNative(JNICLibrary.java:9)
at com.tuya.sdk.network.OooO00o.OooO00o(TuyaNetworkSecurityInit.java:1)
at com.tuya.smart.android.network.TuyaSmartNetWork.initialize(TuyaSmartNetWork.java:35)
at com.tuya.smart.sdk.TuyaSdk.initTuyaData(TuyaSdk.java:74)
at com.tuya.smart.sdk.TuyaSdk.init(TuyaSdk.java:146)
at com.tuya.smart.sdk.TuyaSdk.init(TuyaSdk.java:57)

It's clearly stating that it cannot log libc.so, which should however be part of the Android system
Any hint on how to troubleshoot this?


Re: java.lang.UnsatisfiedLinkError: couldn't find DSO to load: libc++_shared.so caused by: couldn't find DSO to load: li

Posted: 2024年 Aug 13日 09:34
by daxiong

Sorry, we no longer maintain the 3.x.x series SDK. We recommend that you upgrade to the latest 5.x.x series SDK. Regarding the issue you reported, it is very likely due to an outdated version of soloader. We suggest you upgrade soloader to version 0.10.5.


Re: java.lang.UnsatisfiedLinkError: couldn't find DSO to load: libc++_shared.so caused by: couldn't find DSO to load: li

Posted: 2024年 Aug 13日 19:58
by honeyjar

thanks your suggestion helped me fix, I added the following to the build.gradle

dependencies {
    // ... your other dependencies ...
    
// Specify the newer version of SOLoader you want to use implementation 'com.facebook.soloader:soloader:0.10.5' // Replace with the latest version } configurations.all { resolutionStrategy { force 'com.facebook.soloader:soloader:0.10.5' // Replace with the latest version // You can also exclude the old version if needed // exclude group: 'com.facebook.soloader', module: 'soloader' } }