Fatal Exception: java.lang.UnsatisfiedLinkError: couldn't find "librenderscript-toolkit.so" - android

I'm facing a crash on console with this native library. I've imported this library as a module in project. I think, maybe I'm missing something with NDK.
Crash Trace:
Fatal Exception: java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/photocollage.photoeditor.layout.collagemaker.photo.grid-26CYJoq73H483tupCrzMjg==/base.apk"],nativeLibraryDirectories=[/data/app/com.example.app-26CYJoq73H483tupCrzMjg==/lib/arm64, /system/lib64, /hw_product/lib64, /system/product/lib64]]] couldn't find "librenderscript-toolkit.so"
at java.lang.Runtime.loadLibrary0(Runtime.java:1067)
at java.lang.Runtime.loadLibrary0(Runtime.java:1007)
at java.lang.System.loadLibrary(System.java:1668)
at com.google.android.renderscript.Toolkit.<clinit>(Toolkit.kt:1097)
at FragmentCollageLayout.updateBlurBg(FragmentCollageLayout.kt:353)
at FragmentCollageLayout.updateBlurBg$default(FragmentCollageLayout.kt:351)
at FragmentCollageLayout.initBlurBg(FragmentCollageLayout.kt:334)
at FragmentCollageLayout.checkDefaultSettings(FragmentCollageLayout.java:316)
at FragmentCollageLayout.access$checkDefaultSettings(FragmentCollageLayout.java:56)
at FragmentCollageLayout$initCollage$1.onGlobalLayout(FragmentCollageLayout.kt:308)
at android.view.ViewTreeObserver.dispatchOnGlobalLayout(ViewTreeObserver.java:1056)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2858)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1876)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:8167)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1057)
at android.view.Choreographer.doCallbacks(Choreographer.java:875)
at android.view.Choreographer.doFrame(Choreographer.java:776)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1042)
at android.os.Handler.handleCallback(Handler.java:900)
at android.os.Handler.dispatchMessage(Handler.java:103)
at android.os.Looper.loop(Looper.java:219)
at android.app.ActivityThread.main(ActivityThread.java:8349)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:513)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1055)

Related

After upgrade to android 31 get error " Failed resolution of: Landroidx/startup"

My project is with multiple sub-modules.
after upgrading it to android 31, I m getting "AndroidRuntime: FATAL EXCEPTION: main java.lang.NoClassDefFoundError: Failed resolution of: Landroidx/startup/R$string;" error.
I tried with many ways to solve this, but no results yet. Please help me.
adding stacktrace
--------- beginning of crash
2022-12-06 11:31:54.377 4537-4537 AndroidRuntime pid-4537 E FATAL EXCEPTION: main
Process: com.easypay.ican, PID: 4537
java.lang.NoClassDefFoundError: Failed resolution of: Landroidx/startup/R$string;
at androidx.startup.AppInitializer.discoverAndInitialize(AppInitializer.java:216)
at androidx.startup.AppInitializer.discoverAndInitialize(AppInitializer.java:206)
at androidx.startup.InitializationProvider.onCreate(InitializationProvider.java:45)
at android.content.ContentProvider.attachInfo(ContentProvider.java:2404)
at android.content.ContentProvider.attachInfo(ContentProvider.java:2374)
at android.app.ActivityThread.installProvider(ActivityThread.java:7422)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:6939)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6710)
at android.app.ActivityThread.access$1500(ActivityThread.java:247)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2053)
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)
Caused by: java.lang.ClassNotFoundException: Didn't find class "androidx.startup.R$string" on path: DexPathList[[zip file "/data/app/~~zsypRkw3OTJxLIDeKKQKdQ==/com.easypay.ican-LRtgK_OiOc4mTtKIqazSwA==/base.apk"],nativeLibraryDirectories=[/data/app/~~zsypRkw3OTJxLIDeKKQKdQ==/com.easypay.ican-LRtgK_OiOc4mTtKIqazSwA==/lib/x86_64, /data/app/~~zsypRkw3OTJxLIDeKKQKdQ==/com.easypay.ican-LRtgK_OiOc4mTtKIqazSwA==/base.apk!/lib/x86_64, /system/lib64, /system_ext/lib64]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:218)
at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
at androidx.startup.AppInitializer.discoverAndInitialize(AppInitializer.java:216) 
at androidx.startup.AppInitializer.discoverAndInitialize(AppInitializer.java:206) 
at androidx.startup.InitializationProvider.onCreate(InitializationProvider.java:45) 
at android.content.ContentProvider.attachInfo(ContentProvider.java:2404) 
at android.content.ContentProvider.attachInfo(ContentProvider.java:2374) 
at android.app.ActivityThread.installProvider(ActivityThread.java:7422) 
at android.app.ActivityThread.installContentProviders(ActivityThread.java:6939) 
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6710) 
at android.app.ActivityThread.access$1500(ActivityThread.java:247) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2053) 
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) 
2022-12-06 11:31:54.381 4537-4537 CustomActivityOnCrash pid-4537 E App has crashed, executing CustomActivityOnCrash's UncaughtExceptionHandler
java.lang.NoClassDefFoundError: Failed resolution of: Landroidx/startup/R$string;

Android Chromium Build fail with NDK Library Load

Whenever we trying to build Chromium in android studio that time its fail to load NDK library.
Error logs are here :
org.chromium.base.library_loader.ProcessInitException: errorCode=4
at org.chromium.chrome.browser.init.AsyncInitializationActivity.onStartupFailure(AsyncInitializationActivity.java:286)
at org.chromium.chrome.browser.init.NativeInitializationController$1.onFailure(NativeInitializationController.java:101)
at org.chromium.chrome.browser.init.AsyncInitTaskRunner.tasksPossiblyComplete(AsyncInitTaskRunner.java:182)
at org.chromium.chrome.browser.init.AsyncInitTaskRunner.lambda$null$0$AsyncInitTaskRunner(AsyncInitTaskRunner.java:127)
at org.chromium.chrome.browser.init.-$$Lambda$AsyncInitTaskRunner$cJc0Kjib2rp_haGN4uefBvQ1s58.run(Unknown Source:4)
at android.os.Handler.handleCallback(Handler.java:883)
at android.os.Handler.dispatchMessage(Handler.java:100)
at android.os.Looper.loop(Looper.java:237)
at android.app.ActivityThread.main(ActivityThread.java:8167)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:496)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1100)
Caused by: org.chromium.base.library_loader.ProcessInitException: errorCode=2
at org.chromium.base.library_loader.LibraryLoader.loadMainDexAlreadyLocked(LibraryLoader.java:662)
at org.chromium.base.library_loader.LibraryLoader.ensureMainDexInitialized(LibraryLoader.java:456)
at org.chromium.base.library_loader.LibraryLoader.ensureInitialized(LibraryLoader.java:440)
at org.chromium.chrome.browser.init.AsyncInitTaskRunner.loadNativeLibrary(AsyncInitTaskRunner.java:138)
at org.chromium.chrome.browser.init.AsyncInitTaskRunner.lambda$startBackgroundTasks$1$AsyncInitTaskRunner(AsyncInitTaskRunner.java:126)
at org.chromium.chrome.browser.init.-$$Lambda$AsyncInitTaskRunner$xIQXLdsNGYGpypXLZkBvhfVEoSo.run(Unknown Source:2)
at java.lang.Thread.run(Thread.java:919)
Caused by: java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/org.chromium.chrome-3FZb2O0sMrWWCQ2kNEh8Og==/base.apk"],nativeLibraryDirectories=[/data/app/org.chromium.chrome-3FZb2O0sMrWWCQ2kNEh8Og==/lib/arm, /data/app/org.chromium.chrome-3FZb2O0sMrWWCQ2kNEh8Og==/base.apk!/lib/armeabi-v7a, /system/lib]]] couldn't find "libc++_chrome.cr.so"
at java.lang.Runtime.loadLibrary0(Runtime.java:1067)
at java.lang.Runtime.loadLibrary0(Runtime.java:1007)
at java.lang.System.loadLibrary(System.java:1667)
at org.chromium.base.library_loader.LibraryLoader.loadWithSystemLinkerAlreadyLocked(LibraryLoader.java:617)
at org.chromium.base.library_loader.LibraryLoader.loadMainDexAlreadyLocked(LibraryLoader.java:653)
Please review this and share solution if you have any thank you.

couldn't find "libconscrypt_jni.so"

I followed https://stackoverflow.com/a/61560589/6447123 to support TLS 1.2 on Android 4.x
It worked before , but currently I don't know why I have the following error
2020-05-31 09:13:08.567 8735-8735/com.my_app E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.my_app, PID: 8735
java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.my_app-jygsQuNVVcvr6CclEptz5A==/base.apk"],nativeLibraryDirectories=[/data/app/com.my_app-jygsQuNVVcvr6CclEptz5A==/lib/arm64, /data/app/com.my_app-jygsQuNVVcvr6CclEptz5A==/base.apk!/lib/arm64-v8a, /system/lib64, /system/vendor/lib64]]] couldn't find "libconscrypt_jni.so"
at java.lang.Runtime.loadLibrary0(Runtime.java:1011)
at java.lang.System.loadLibrary(System.java:1657)
at org.conscrypt.NativeCryptoJni.init(NativeCryptoJni.java:28)
at org.conscrypt.NativeCrypto.<clinit>(NativeCrypto.java:63)
at org.conscrypt.NativeCrypto.checkAvailability(NativeCrypto.java:80)
at org.conscrypt.OpenSSLProvider.<init>(OpenSSLProvider.java:58)
at org.conscrypt.OpenSSLProvider.<init>(OpenSSLProvider.java:51)
at org.conscrypt.OpenSSLProvider.<init>(OpenSSLProvider.java:47)
at com.my_app.MainApplication.onCreate(MainApplication.java:51)
at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1119)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5877)
at android.app.ActivityThread.-wrap1(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1690)
at android.os.Handler.dispatchMessage(Handler.java:105)
at android.os.Looper.loop(Looper.java:173)
at android.app.ActivityThread.main(ActivityThread.java:6698)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:782)
It crashed on a phone that works before
In you class, you should add static block to add conscrypt as security provider
static {
// add Conscrypt in list of security providers for device
Security.addProvider(Conscrypt.newProvider());
}

Exception "java.lang.ClassNotFoundException: Didn't find class..." on Android 4.4.2

When I try to run my existing application (using Android Studio 3.1.3) on Android 4.4.2 it is not running and showing this error:
E/AndroidRuntime: FATAL EXCEPTION: main
Process: my.project, PID: 9428
java.lang.NoClassDefFoundError: uz/uno/models/Transaction
at java.lang.Class.getDeclaredFields(Native Method)
at java.lang.Class.getDeclaredFields(Class.java:610)
at com.activeandroid.util.ReflectionUtils.getDeclaredColumnFields(ReflectionUtils.java:73)
at com.activeandroid.TableInfo.<init>(TableInfo.java:66)
at com.activeandroid.ModelInfo.loadModelFromMetaData(ModelInfo.java:101)
at com.activeandroid.ModelInfo.<init>(ModelInfo.java:61)
at com.activeandroid.Cache.initialize(Cache.java:66)
at com.activeandroid.ActiveAndroid.initialize(ActiveAndroid.java:44)
at com.activeandroid.ActiveAndroid.initialize(ActiveAndroid.java:34)
at com.activeandroid.content.ContentProvider.onCreate(ContentProvider.java:39)
at android.content.ContentProvider.attachInfo(ContentProvider.java:1591)
at android.content.ContentProvider.attachInfo(ContentProvider.java:1562)
at android.app.ActivityThread.installProvider(ActivityThread.java:5233)
at android.app.ActivityThread.installContentProviders(ActivityThread.java:4827)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4710)
at android.app.ActivityThread.access$1600(ActivityThread.java:174)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1367)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:146)
at android.app.ActivityThread.main(ActivityThread.java:5593)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1283)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1099)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.ClassNotFoundException: Didn't find class "my.project.models.Transaction" on path: DexPathList[[zip file "/data/app/my.project-5.apk"],nativeLibraryDirectories=[/data/app-lib/my.project-5, /vendor/lib, /system/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:67)
at java.lang.ClassLoader.loadClass(ClassLoader.java:497)
Pay attention to the exception:
Caused by: java.lang.ClassNotFoundException: Didn't find class "my.project.models.Transaction" on path: DexPathList[[zip file "/data/app/my.project-5.apk"],nativeLibraryDirectories=[/data/app-lib/my.project-5, /vendor/lib, /system/lib]]
I found out that everytime when I try to run and it crashes the number in the exception increases my.project-5. (First time it was my.project-1, then my.project-2, and so on).
What is the problem and how can I fix this error?
Note: This error is also occuring on android 4.3. However, for android 5.0 and above it is working well.
Edit: Answer
After doing some research, I found the answer here:
NoClassDefFoundError with Android Studio on Android 4
https://developer.android.com/studio/build/multidex
I think you have a conflict with some code that requires at least android 5.0 but you are running in 4.4.2.
See the documentation here: https://developer.android.com/training/basics/supporting-devices/platforms and here: https://developer.android.com/guide/practices/compatibility
Post the code so we can help you better.

Cocos2d-x v3.7.1 Unfortunately, libcocos2dx has stopped

I'm compiling a new project through proj.android-studio using:
cocos compile -p android --android-studio
But when I start app on android device, it shows me a message:
Unfortunately, libcocos2dx has stopped
Can you help me? What I'm doing wrong?
Here is logcat:
09-07 12:07:47.711 23074-23074/? E/AndroidRuntime﹕ FATAL EXCEPTION: main
Process: org.cocos2dx.TestGame, PID: 23074
java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "srand" referenced by "libcocos2dcpp.so"...
at java.lang.Runtime.loadLibrary(Runtime.java:371)
at java.lang.System.loadLibrary(System.java:553)
at org.cocos2dx.lib.Cocos2dxActivity.onLoadNativeLibraries(Cocos2dxActivity.java:288)
at org.cocos2dx.lib.Cocos2dxActivity.onCreate(Cocos2dxActivity.java:303)
at android.app.Activity.performCreate(Activity.java:5343)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1088)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2331)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2429)
at android.app.ActivityThread.access$800(ActivityThread.java:151)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1342)
at android.os.Handler.dispatchMessage(Handler.java:110)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:5341)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:825)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:641)
at dalvik.system.NativeStart.main(Native Method)
Usually the app stops working if your code contains errors.
Are there errors in your code? What does the LogCat say?

Categories

Resources