Android - Scandit - java.lang.UnsatisfiedLinkError - android

Scandit SDK started crashing when initializing. It was working fine, but it just started erroring out. I have tried googling around for a solution, and I've tried every suggestion. But nothing seems to fix it. It doesn't seem to be a proguard issue and the build path seems correct.
E/AndroidRuntime(25471): java.lang.UnsatisfiedLinkError: Couldn't load scanditsdk-android-3.5.3 from loader dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.android.example-1.apk"],nativeLibraryDirectories=[/data/app-lib/com.android.example-1, /vendor/lib, /system/lib]]]: findLibrary returned null
E/AndroidRuntime(25471): at java.lang.Runtime.loadLibrary(Runtime.java:358)
E/AndroidRuntime(25471): at java.lang.System.loadLibrary(System.java:526)
E/AndroidRuntime(25471): at com.mirasense.scanditsdk.ScanditSDKBarcodePicker.initializeRecognitionEngine(ScanditSDKBarcodePicker.java:1364)
E/AndroidRuntime(25471): at com.mirasense.scanditsdk.ScanditSDKBarcodePicker.<init>(ScanditSDKBarcodePicker.java:333)
E/AndroidRuntime(25471): at com.mirasense.scanditsdk.ScanditSDKBarcodePicker.<init>(ScanditSDKBarcodePicker.java:255)
E/AndroidRuntime(25471): at com.venueplus.android.VPScannerActivity.onCreate(VPScannerActivity.java:99)
E/AndroidRuntime(25471): at android.app.Activity.performCreate(Activity.java:5231)
E/AndroidRuntime(25471): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
E/AndroidRuntime(25471): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2159)
E/AndroidRuntime(25471): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245)
E/AndroidRuntime(25471): at android.app.ActivityThread.access$800(ActivityThread.java:135)
E/AndroidRuntime(25471): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
E/AndroidRuntime(25471): at android.os.Handler.dispatchMessage(Handler.java:102)
E/AndroidRuntime(25471): at android.os.Looper.loop(Looper.java:136)
E/AndroidRuntime(25471): at android.app.ActivityThread.main(ActivityThread.java:5017)
E/AndroidRuntime(25471): at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime(25471): at java.lang.reflect.Method.invoke(Method.java:515)
E/AndroidRuntime(25471): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
E/AndroidRuntime(25471): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
E/AndroidRuntime(25471): at dalvik.system.NativeStart.main(Native Method)
Help is much appreciated

After talking with a Scandit engineer, it turns the problem was that I didn't have a directory named "armeabi-v7a" in addition to "armeabi". So the libscandit-sdk-android-3.5.3.so file must be present in both subfolders.
Hope this helps someone

Related

Djinni - Android Crash - UnsatisfiedLinkError

very much stuck here I had the project working fine now for some reason every time i launch i get a crash. any help on this would be appreciated.
Process: com.amr, PID: 4185
java.lang.UnsatisfiedLinkError: Couldn't load amr_android from loader dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.amr-1.apk"],nativeLibraryDirectories=[/data/app-lib/com.amr-1, /system/lib]]]: findLibrary returned null
at java.lang.Runtime.loadLibrary(Runtime.java:358)
at java.lang.System.loadLibrary(System.java:526)
at com.amr.RandomRumbers.<clinit>(RandomRumbers.java:25)
at java.lang.Class.newInstanceImpl(Native Method)
at java.lang.Class.newInstance(Class.java:1208)
at android.app.Instrumentation.newActivity(Instrumentation.java:1061)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2112)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245)
at android.app.ActivityThread.access$800(ActivityThread.java:135)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5017)
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:779)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
at dalvik.system.NativeStart.main(Native Method)
This is because in the apk there is no native library for the specific processor type of the target device. You should check which one you have and provide the apk with the native library compiled for that type.

Android Navigation Drawer with Page Sliding tab Strip

I'm trying to use Android Navigation Drawer with Page (Pager) Sliding tab Strip (https://github.com/Balaji-K13/Navigation-drawer-page-sliding-tab-strip), but i couldn't make it work. I'm using android studio. I made the imports in main project, and doesn't show any error, but when i run into a device (virtual or real) get this error:
05-22 10:38:20.200 1434-1434/com.webileapps.navdrawer E/AndroidRuntime﹕ FATAL EXCEPTION: main
Process: com.webileapps.navdrawer, PID: 1434
java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.webileapps.navdrawer/com.webileapps.navdrawer.MainActivity}: java.lang.ClassNotFoundException: Didn't find class "com.webileapps.navdrawer.MainActivity" on path: DexPathList[[zip file "/data/app/com.webileapps.navdrawer-1.apk"],nativeLibraryDirectories=[/data/app-lib/com.webileapps.navdrawer-1, /system/lib]]
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2102)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2226)
at android.app.ActivityThread.access$700(ActivityThread.java:135)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1397)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4998)
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:777)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:593)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.webileapps.navdrawer.MainActivity" on path: DexPathList[[zip file "/data/app/com.webileapps.navdrawer-1.apk"],nativeLibraryDirectories=[/data/app-lib/com.webileapps.navdrawer-1, /system/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:497)
at java.lang.ClassLoader.loadClass(ClassLoader.java:457)
at android.app.Instrumentation.newActivity(Instrumentation.java:1061)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2093)
            at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2226)
            at android.app.ActivityThread.access$700(ActivityThread.java:135)
            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1397)
            at android.os.Handler.dispatchMessage(Handler.java:102)
            at android.os.Looper.loop(Looper.java:137)
            at android.app.ActivityThread.main(ActivityThread.java:4998)
            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:777)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:593)
            at dalvik.system.NativeStart.main(Native Method)
So, thoughts?
I was also trying to implement it and got the same error .After lot of effort I was able to run it but received the similar error as you have received .
I resolved the issue by
1:Close and start your eclipse .
2: copying the v4 jar of main project in all the library projects and deleting the existing ones .
The error comes due to mismatch of supportv4jar. Make all the supportv4jar of same version
3:after that Delete the gen and bin folder and clean the project and run .

Android Studio with javaCv and FFMPEG

So I am using the new Android Studio and I am trying to get JavaCV installed in the most basic setup. I made a brand new project with nothing in it, imported (I think unsuccessfully) the JavaCV library and then I am running one of the samples given in the JavaCV repo and I am getting the following error.
Process: com.example.calvintmoss.dejavid, PID: 1187
java.lang.UnsatisfiedLinkError: Couldn't load jniopencv_core from loader dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.example.calvintmoss.dejavid-1.apk"],nativeLibraryDirectories=[/data/app-lib/com.example.calvintmoss.dejavid-1, /system/lib]]]: findLibrary returned null
at java.lang.Runtime.loadLibrary(Runtime.java:358)
at java.lang.System.loadLibrary(System.java:526)
at org.bytedeco.javacpp.Loader.loadLibrary(Loader.java:535)
at org.bytedeco.javacpp.Loader.load(Loader.java:410)
at org.bytedeco.javacpp.Loader.load(Loader.java:353)
at org.bytedeco.javacpp.opencv_core.<clinit>(opencv_core.java:10)
at org.bytedeco.javacpp.helper.opencv_core$AbstractIplImage.create(opencv_core.java:909)
at com.example.calvintmoss.dejavid.MainActivity.initRecorder(MainActivity.java:249)
at com.example.calvintmoss.dejavid.MainActivity.onCreate(MainActivity.java:151)
at android.app.Activity.performCreate(Activity.java:5231)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2148)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2233)
at android.app.ActivityThread.access$800(ActivityThread.java:135)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5001)
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:785)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.UnsatisfiedLinkError: Couldn't load opencv_core from loader dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.example.calvintmoss.dejavid-1.apk"],nativeLibraryDirectories=[/data/app-lib/com.example.calvintmoss.dejavid-1, /system/lib]]]: findLibrary returned null
at java.lang.Runtime.loadLibrary(Runtime.java:358)
at java.lang.System.loadLibrary(System.java:526)
at org.bytedeco.javacpp.Loader.loadLibrary(Loader.java:535)
at org.bytedeco.javacpp.Loader.load(Loader.java:401)
            at org.bytedeco.javacpp.Loader.load(Loader.java:353)
            at org.bytedeco.javacpp.opencv_core.<clinit>(opencv_core.java:10)
            at org.bytedeco.javacpp.helper.opencv_core$AbstractIplImage.create(opencv_core.java:909)
            at com.example.calvintmoss.dejavid.MainActivity.initRecorder(MainActivity.java:249)
            at com.example.calvintmoss.dejavid.MainActivity.onCreate(MainActivity.java:151)
            at android.app.Activity.performCreate(Activity.java:5231)
            at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
            at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2148)
            at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2233)
            at android.app.ActivityThread.access$800(ActivityThread.java:135)
            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
            at android.os.Handler.dispatchMessage(Handler.java:102)
            at android.os.Looper.loop(Looper.java:136)
            at android.app.ActivityThread.main(ActivityThread.java:5001)
            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:785)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
            at dalvik.system.NativeStart.main(Native Method)
I have read several of the other top posts on the issue but I cannot figure out what is wrong. I downloaded the JavaCV through gradle, then I added the lib and lib/areabi folders. I imported ffmpeg.jar, javacpp.jar, javacv.jar and opencv.jar all to the lib folder. and I extracted all the .SO files from opencv-android-arm.jar and ffmpeg-android-arm.jar and put them in the lib/armeabi just like the instructions on the git repo. I cannot figure out what is going on. Anyone have any ideas? Also my current setup is. Project->AppModule and then inside of that is where I have my lib and inside of lib i have the armeabi. Does anyone have any info on whats going on?
I had the same problem, I took the library from google.
Projects in use FFMpegRecoder and IplImage
My libs:
javacv-0.7-src.zip
javacv-0.7-bin.zip
javacv-0.7-cppjars.zip
https://code.google.com/p/javacv/
Try to add these five codes in dependency:
compile 'org.bytedeco:javacv:+'
compile 'org.bytedeco.javacpp-presets:opencv:3.0.0-1.1:android-x86'
compile 'org.bytedeco.javacpp-presets:ffmpeg:2.8.1-1.1:android-x86'
compile 'org.bytedeco.javacpp-presets:opencv:3.0.0-1.1:android-arm'
compile 'org.bytedeco.javacpp-presets:ffmpeg:2.8.1-1.1:android-arm'
Here you are using bytedeco instead of googlecode now

Android Studio intermittent ClassNotFoundException

I've already read serveral Q&A's from SO and did not found a solution.
My problem is: I run my app from AndroidStudio and get the error bellow, then I run gradlew clean installDebug and code works just fine (outside AS, with NO changes).
I did NOT forgot to include my activity into AndroidManifest.
10-13 13:36:18.261 1457-1457/my.package E/AndroidRuntime﹕ FATAL EXCEPTION: main
Process: my.package, PID: 1457
java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{my.package/my.package.activity.MainActivity}: java.lang.ClassNotFoundException: Didn't find class "my.package.activity.MainActivity" on path: DexPathList[[zip file "/data/app/my.package-1.apk"],nativeLibraryDirectories=[/data/app-lib/my.package-1, /system/lib]]
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2110)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2233)
at android.app.ActivityThread.access$800(ActivityThread.java:135)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5001)
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:785)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.ClassNotFoundException: Didn't find class "my.package.activity.MainActivity" on path: DexPathList[[zip file "/data/app/my.package-1.apk"],nativeLibraryDirectories=[/data/app-lib/my.package-1, /system/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:497)
at java.lang.ClassLoader.loadClass(ClassLoader.java:457)
at android.app.Instrumentation.newActivity(Instrumentation.java:1061)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2101)
            at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2233)
            at android.app.ActivityThread.access$800(ActivityThread.java:135)
            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
            at android.os.Handler.dispatchMessage(Handler.java:102)
            at android.os.Looper.loop(Looper.java:136)
            at android.app.ActivityThread.main(ActivityThread.java:5001)
            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:785)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
            at dalvik.system.NativeStart.main(Native Method)
I'm using Android Studio 0.8.12 and this is reproducible with real devices and emulator (Genymotion).
EDIT
I've tried both "full path" and "class name only" into my AndroidManifest file to declare activities. And it still doesn't explain (IMHO) why it works via command line with gradle.

Relation of appcompat_v7_4 with armeabi-v7a

When i add appcompat_v7_4 as an library project to my android project, my app tries to find native libs in armeabi-v7a folder, but i only have armeabi folder. And then app crashes because cant find the native libs. I created armeabi-v7a folder and copied armeabi folder content to armeabi-v7a folder and app worked without crash. What is the relation of appcompat_v7_4 with armeabi-v7a?
The stack trace is the following:
java.lang.NoClassDefFoundError: java.lang.ClassNotFoundException: com.googlecode.javacv.cpp.avcodec
at com.googlecode.javacpp.Loader.load(Loader.java:455)
at com.googlecode.javacv.cpp.avformat.<clinit>(avformat.java:76)
at com.butterfly.recorder.FFmpegFrameRecorder.<init>(FFmpegFrameRecorder.java:231)
at com.butterfly.RecordActivity.createRecorder(RecordActivity.java:329)
at com.butterfly.RecordActivity.initRecorder(RecordActivity.java:314)
at com.butterfly.RecordActivity.onClick(RecordActivity.java:518)
at android.view.View.performClick(View.java:4438)
at android.view.View$PerformClick.run(View.java:18422)
at android.os.Handler.handleCallback(Handler.java:733)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5017)
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:779)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.ClassNotFoundException: com.googlecode.javacv.cpp.avcodec
at java.lang.Class.classForName(Native Method)
at java.lang.Class.forName(Class.java:251)
at com.googlecode.javacpp.Loader.load(Loader.java:453)
... 16 more
Caused by: java.lang.UnsatisfiedLinkError: Couldn't load jniavcodec from loader dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.butterfly-2.apk"],nativeLibraryDirectories=[/data/app-lib/com.butterfly-2, /vendor/lib, /system/lib]]]: findLibrary returned null
at java.lang.Runtime.loadLibrary(Runtime.java:358)
at java.lang.System.loadLibrary(System.java:526)
at com.googlecode.javacpp.Loader.loadLibrary(Loader.java:593)
at com.googlecode.javacpp.Loader.load(Loader.java:489)
at com.googlecode.javacpp.Loader.load(Loader.java:431)
at com.googlecode.javacv.cpp.avcodec.<clinit>(avcodec.java:86)
... 19 more
Caused by: java.lang.UnsatisfiedLinkError: Couldn't load avcodec from loader dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.butterfly-2.apk"],nativeLibraryDirectories=[/data/app-lib/com.butterfly-2, /vendor/lib, /system/lib]]]: findLibrary returned null
at java.lang.Runtime.loadLibrary(Runtime.java:358)
at java.lang.System.loadLibrary(System.java:526)
at com.googlecode.javacpp.Loader.loadLibrary(Loader.java:593)
at com.googlecode.javacpp.Loader.load(Loader.java:481)
... 21 more

Categories

Resources