We have an application using the Zbar library from BarcodeScanner with gradle:
compile 'me.dm7.barcodescanner:zbar:1.8.2'
Scanning works fine in all the devices except for those with 64bit. When we launch the scanner the screen turn black and we receive an exception:
java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/my.package.name-2/base.apk"],nativeLibraryDirectories=[/data/app/my.package.name-2/lib/arm64, /vendor/lib64, /system/lib64]]] couldn't find "libiconv.so"
at java.lang.Runtime.loadLibrary(Runtime.java:366)
at java.lang.System.loadLibrary(System.java:989)
at me.dm7.barcodescanner.zbar.ZBarScannerView.(ZBarScannerView.java:31)
at my.package.name.activity.BarcodeActivity.onCreate(BarcodeActivity.java:19)
at android.app.Activity.performCreate(Activity.java:6374)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1119)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2767)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2879)
at android.app.ActivityThread.access$900(ActivityThread.java:182)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1475)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:145)
at android.app.ActivityThread.main(ActivityThread.java:6141)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1399)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1194)
It seems to be fixed in 1.8.4.
Try using version 1.9
compile 'me.dm7.barcodescanner:zbar:1.9'
Related
For some reason my application dosent work in release mode (in debug mode everything is fine) on devices with api 21&22
when i am trying to lounch the app i am getting this error
java.lang.RuntimeException: Unable to instantiate application com.example.MyApplication: java.lang.ClassNotFoundException: Didn't find class "com.example.MyApplication" on path: DexPathList[[zip file "/data/app/com.example-1/base.apk"],nativeLibraryDirectories=[/data/app/com.example-1/lib/arm64, /vendor/lib64, /system/lib64]]
at android.app.LoadedApk.makeApplication(LoadedApk.java:566)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4534)
at android.app.ActivityThread.access$1500(ActivityThread.java:151)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1346)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5291)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899)
Try this: use the same version android support library in your project and library projects you included.
After Clean and Rebuild.
This question was already asked by someone, But there i can't find any clues about the issue. I am using MuPDF library to open and preview the .pdf files in our Android application. It's working fine other than few X86 architecture devices. I got the following issue
Fatal Exception: java.lang.UnsatisfiedLinkError: dlopen failed: "/data/app/com.demo-1/lib/x86/libmupdf.so" has unexpected e_machine: 40
at java.lang.Runtime.loadLibrary(Runtime.java:371)
at java.lang.System.loadLibrary(System.java:988)
at com.artifex.mupdfdemo.MuPDFCore.(MuPDFCore.java:19)
at com.demo.openwith.OpenwithFragment.openFile(OpenwithFragment.java:789)
at com.demo.openwith.OpenwithFragment.openPDF(OpenwithFragment.java:671)
at com.demo.openwith.OpenwithFragment.onCreateView(OpenwithFragment.java:346)
at android.app.Fragment.performCreateView(Fragment.java:2053)
at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:894)
at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:1067)
at android.app.BackStackRecord.run(BackStackRecord.java:834)
at android.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1452)
at android.app.Activity.performStart(Activity.java:6047)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2306)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2405)
at android.app.ActivityThread.access$800(ActivityThread.java:154)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1306)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5292)
at java.lang.reflect.Method.invoke(Method.java)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
previously i have used the old library(.so) of the MuPDF. Now i have updated the recent library, even i am getting the same issue. Can anyone help me to find the reason and fix the issue.
create libs folder in app/src/main
then create folder x86 download this file and insert it
https://github.com/minaairsupport/MuPDF_Android_Studio/blob/master/app/src/main/jniLibs/x86/libmupdf_java.so
locally on my machine my app built successfully & works fine when clicking to open an Kotlin Activity like:
galleryLayout.setOnClickListener(view -> startActivity(new Intent(PreferencesActivity.this, GalleryActivity.class)));
But after successfully built on Jenkins CI the click action will make app crash:
Fatal Exception: java.lang.NoClassDefFoundError: Failed resolution of: Lcom/noodoe/sunray/settings/preferences/gallery/GalleryActivity;
at com.noodoe.sunray.settings.preferences.PreferencesActivity.lambda$setupListener$9(PreferencesActivity.java:248)
at com.noodoe.sunray.settings.preferences.PreferencesActivity.access$lambda$9(PreferencesActivity.java)
at com.noodoe.sunray.settings.preferences.PreferencesActivity$$Lambda$10.onClick(Unknown Source)
at android.view.View.performClick(View.java:5226)
at android.view.View$PerformClick.run(View.java:21266)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:168)
at android.app.ActivityThread.main(ActivityThread.java:5845)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:797)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:687)
Caused by java.lang.ClassNotFoundException: Didn't find class "com.noodoe.sunray.settings.preferences.gallery.GalleryActivity" on path: DexPathList[[zip file "/data/app/com.noodoe.sunray.alpha-1/base.apk"],nativeLibraryDirectories=[/data/app/com.noodoe.sunray.alpha-1/lib/arm, /data/app/com.noodoe.sunray.alpha-1/base.apk!/lib/armeabi-v7a, /vendor/lib, /system/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
at com.noodoe.sunray.settings.preferences.PreferencesActivity.lambda$setupListener$9(PreferencesActivity.java:248)
at com.noodoe.sunray.settings.preferences.PreferencesActivity.access$lambda$9(PreferencesActivity.java)
at com.noodoe.sunray.settings.preferences.PreferencesActivity$$Lambda$10.onClick(Unknown Source)
at android.view.View.performClick(View.java:5226)
at android.view.View$PerformClick.run(View.java:21266)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:168)
at android.app.ActivityThread.main(ActivityThread.java:5845)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:797)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:687)
here's my build.gradle, please help if you have any idea. Thanks!
Run gradle clean and retry the build. Not sure about your Jenkins script and how your CI workflow runs, but a clean before the build is always recommended.
Why not post your Jenkinsfile / Jenkins CI script here =)
I'm trying to run my app with Backendless for the first time. I recieve this error:
java.lang.NoClassDefFoundError: Failed resolution of: Lcom/backendless/BackendlessCollection;
at com.backendless.Persistence.<init>(Persistence.java:72)
at com.backendless.Persistence.<clinit>(Persistence.java:62)
at com.backendless.Persistence.getInstance(Persistence.java:66)
at com.backendless.Backendless.<clinit>(Backendless.java:43)
at com.asd.asd.android.AndroidLauncher.onCreate(AndroidLauncher.java:89)
at android.app.Activity.performCreate(Activity.java:6289)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1119)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2646)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2758)
at android.app.ActivityThread.access$900(ActivityThread.java:177)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1448)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:145)
at android.app.ActivityThread.main(ActivityThread.java:5942)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1400)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1195)
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.backendless.BackendlessCollection" on path: DexPathList[[zip file "/data/app/com.asd.asd.android-1/base.apk"],nativeLibraryDirectories=[/data/app/com.asd.asd.android-1/lib/arm, /vendor/lib, /system/lib]]
The stacktrace gives me no clue on what may be wrong since I don't even use the BackendlessCollection class.
The error points at:
Backendless.initApp(this,app_ID,android_ID, version_id);
That is a known issue in Backendless, it has been fixed in their newer SDK. Here`s link on maven central http://mvnrepository.com/artifact/com.backendless/backendless/3.0.8.1
I have following libs in my project :
Armeabi , Armeabi-v7a , mips , x86 they all have libmupdf.so while Samsung device looking for lib/arm64.
I am getting below crash on Samsung Galaxy Edge 6 .
java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.engagebeyond.sasol-1/base.apk"],nativeLibraryDirectories=[/data/app/com.engagebeyond.sasol-1/lib/arm64, /vendor/lib64, /system/lib64]]] couldn't find "libmupdf.so"
at java.lang.Runtime.loadLibrary(Runtime.java:366)
at java.lang.System.loadLibrary(System.java:988)
at com.artifex.mupdflib.MuPDFCore.<clinit>(MuPDFCore.java:14)
at com.artifex.mupdflib.MuPDFActivity.openFile(MuPDFActivity.java:233)
at com.artifex.mupdflib.MuPDFActivity.onCreate(MuPDFActivity.java:445)
at android.app.Activity.performCreate(Activity.java:6500)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1120)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3072)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3218)
at android.app.ActivityThread.access$1000(ActivityThread.java:198)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1676)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:145)
at android.app.ActivityThread.main(ActivityThread.java:6837)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1404)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1199)
Do any one known how i can build lib for arm64 ?
As this phone will run 32bit libraries, one option is to just disable 64 for your application, which will then allow the Armeabi-v7a library to be used.
The easiest way to do this is using the abiFilter setting, see https://stackoverflow.com/a/30799825/292166