klaxit / hidden-secrets-gradle-plugin

🔒 Deeply hide secrets on Android
MIT License
395 stars 40 forks source link

Fatal Exception: java.lang.UnsatisfiedLinkError #44

Open Sonampasi opened 3 years ago

Sonampasi commented 3 years ago

I am getting below crash for some devices like Gionee M7 power and Xiaomi Redmi 4a.

Fatal Exception: java.lang.UnsatisfiedLinkError
dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/mypackage.myapp-2/base.apk", zip file "/data/app/mypackage.myapp-2/split_config.arm64_v8a.apk", zip file "/data/app/mypackage.myapp-2/split_config.xhdpi.apk"],nativeLibraryDirectories=[/data/app/mypackage.myapp-2/lib/arm64, /vendor/lib64, /system/lib64]]] couldn't find "libsecrets.so"
       at java.lang.Runtime.loadLibrary(Runtime.java:367)
       at java.lang.System.loadLibrary(System.java:1076)
       at air.com.religare.iPhone.Secrets.<clinit>(Secrets.java:10)

Let me know if you need more information.

Please help

ben-j69 commented 3 years ago

Hello @Sonampasi ,

it is working well for other devices ? What did you try to solve this issue ?

Thanks

Sonampasi commented 3 years ago

Hi @ben-j69,

Thanks for the quick response.

Yes, it's working fine for other devices. I am using abiFilters for the issue but it's still not working.

build.gradle(app)

android {
     defaultConfig {
          ndk {
                 abiFilters 'x86', 'x86_64', 'armeabi-v7a', 'arm64-v8a'
           }
      }
}
ben-j69 commented 3 years ago

Hello @Sonampasi ,

I don't think this filter will change anything because you are filtering but with the list of all abis so it should have no effect. In more restricting architectures will not allow it to work on some devices.

We apparently have no issue with this devices in our production app using Hidden Secret v0.1.2.

Do you have 100% of crash on these devices or it just occur sometimes ? It could be just an installation issue or something like this.

iremalbayrak commented 3 years ago

Hello @Sonampasi

I am having the same problems. Did you find a solution?

Fatal Exception: java.lang.UnsatisfiedLinkError dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.flirt.dating-m03hAqtxJtGEp-FQIe2dBg==/base.apk"],nativeLibraryDirectories=[/data/app/com.flirt.dating-m03hAqtxJtGEp-FQIe2dBg==/lib/x86, /system/lib, /vendor/lib]]] couldn't find "libsecrets.so"

ben-j69 commented 3 years ago

Hello @iremalbayrak can I see your gradle file please ?

Sonampasi commented 2 years ago

Hello @Sonampasi ,

I don't think this filter will change anything because you are filtering but with the list of all abis so it should have no effect. In more restricting architectures will not allow it to work on some devices.

We apparently have no issue with this devices in our production app using Hidden Secret v0.1.2.

Do you have 100% of crash on these devices or it just occur sometimes ? It could be just an installation issue or something like this.

It happens sometimes on these devices.

Now I am having this issue in more devices, mostly in android 6.0.1 (98%). Xioami - Redmi 3S, Redmi 4 Pro Samsung - Galaxy On7 Pro LeMobile - Le 2 GIONEE - M7 Power

Sonampasi commented 2 years ago

Hello @Sonampasi

I am having the same problems. Did you find a solution?

Fatal Exception: java.lang.UnsatisfiedLinkError dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.flirt.dating-m03hAqtxJtGEp-FQIe2dBg==/base.apk"],nativeLibraryDirectories=[/data/app/com.flirt.dating-m03hAqtxJtGEp-FQIe2dBg==/lib/x86, /system/lib, /vendor/lib]]] couldn't find "libsecrets.so"

No, not yet.

dorozhans commented 2 years ago

I checked on M1 and for me libsecrets.so can't be generated at all. Any suggestions why it can be? Other .so libraries used in project successfully built.

androidGrafena commented 2 years ago

Currently having this trouble for Pixel 3 XL. any idea how to solve this?

ben-j69 commented 2 years ago

I checked on M1 and for me libsecrets.so can't be generated at all. Any suggestions why it can be? Other .so libraries used in project successfully built.

There is a PR about M1, feel free to review it : https://github.com/klaxit/hidden-secrets-gradle-plugin/pull/46

yoobi commented 2 years ago

Hello, I'm getting the same crash while using classpath "com.klaxit.hiddensecrets:HiddenSecretsPlugin:0.1.5" I'm also on mac M1

Fatal Exception: java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.my.application-k3NGrJChpymO2ia7c4Gl_w==/base.apk"],nativeLibraryDirectories=[/data/app/com.my.application-k3NGrJChpymO2ia7c4Gl_w==/lib/arm, /data/app/com.my.application-k3NGrJChpymO2ia7c4Gl_w==/base.apk!/lib/armeabi-v7a, /system/lib, /vendor/lib]]] couldn't find "libsecrets.so"
       at java.lang.Runtime.loadLibrary0(Runtime.java:1011)
       at java.lang.System.loadLibrary(System.java:1661)
       at com.my.application.Secrets.<clinit>(Secrets.kt:10)
       at com.my.application.MainViewModel.<init>(MainViewModel.kt:36)
       at java.lang.Class.newInstance(Class.java)
       at androidx.lifecycle.ViewModelProvider$NewInstanceFactory.create(ViewModelProvider.java:219)
       at androidx.lifecycle.ViewModelProvider$AndroidViewModelFactory.create(ViewModelProvider.java:278)
       at androidx.lifecycle.SavedStateViewModelFactory.create(SavedStateViewModelFactory.java:112)
       at androidx.lifecycle.ViewModelProvider.get(ViewModelProvider.java:185)
       at androidx.lifecycle.ViewModelProvider.get(ViewModelProvider.java:150)
       at com.my.application.MainActivity$viewModel$2.invoke(MainActivity.kt:42)
       at com.my.application.MainActivity$viewModel$2.invoke(MainActivity.kt:41)
       at kotlin.SynchronizedLazyImpl.getValue(LazyJVM.kt:74)
       at com.my.application.MainActivity.getViewModel(MainActivity.kt:41)
       at com.my.application.MainActivity.initLanguageAndCountry(MainActivity.kt:184)
       at com.my.application.MainActivity.onCreate(MainActivity.kt:54)
       at android.app.Activity.performCreate(Activity.java:7110)
       at android.app.Activity.performCreate(Activity.java:7101)
       at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1214)
       at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2922)
       at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3047)
       at android.app.ActivityThread.-wrap11(ActivityThread.java)
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1777)
       at android.os.Handler.dispatchMessage(Handler.java:106)
       at android.os.Looper.loop(Looper.java:166)
       at android.app.ActivityThread.main(ActivityThread.java:6861)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:450)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936)

Any idea?

Nghicv commented 1 year ago

I got the same crash on my application on some devices. 99% of them are in the background. @ben-j69 do we have any update on this issue?

Nghicv commented 1 year ago

@Sonampasi do you find any solution for this issue?

megyux commented 1 year ago

I'm having same issue:

Fatal Exception: java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/**.***.*****-Ottf6qqwM4kTbogQ099KKQ==/base.apk"],nativeLibraryDirectories=[/data/app/**.***.*****-Ottf6qqwM4kTbogQ099KKQ==/lib/arm64, /system/lib64, /system/vendor/lib64]]] couldn't find "libsecrets.so"
plugins {
    id "com.klaxit.hiddensecrets" version "0.2.1"
}

0% background, is there a solution or a clarification ?
thanks.

megyux commented 1 year ago

Edit: problem not solved problem solved (I think) by adding this in build.gradle:

android{
  ...
  defaultConfig{
    ...
    ndk {
            abiFilters "armeabi-v7a", "x86", "arm64-v8a", "x86_64"
        }
  }
}

apparently the problem occurred only in arm64 devices /lib/arm64, /system/lib64, /system/vendor/lib64.
sources:
https://medium.com/mobiwise-blog/unsatisfiedlinkerror-problem-on-some-android-devices-b77f2f83837d https://developer.android.com/reference/tools/gradle-api/7.1/com/android/build/api/dsl/Ndk#abifilters https://developer.android.com/ndk/guides/abis.html#sa