Adobe Android ANE support armeabi - android

I am integrating Twilio video in android with my adobe air app. I can successfully add video sdk in ane but twilio video sdk uses com.getkeepsafe.relinker SDK.
This SDK gives me below error
Process: air.TestApp, PID: 585
java.lang.RuntimeException: Unable to start activity ComponentInfo{air.TestApp/com.nethram.video.views.MainActivity}: com.getkeepsafe.relinker.MissingLibraryException: lib/armeabi/libjingle_peerconnection_so.so
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2456)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2539)
at android.app.ActivityThread.access$900(ActivityThread.java:159)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1384)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:152)
at android.app.ActivityThread.main(ActivityThread.java:5507)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
Caused by: com.getkeepsafe.relinker.MissingLibraryException: lib/armeabi/libjingle_peerconnection_so.so
at com.getkeepsafe.relinker.ApkLibraryInstaller.installLibrary(ApkLibraryInstaller.java:85)
at com.getkeepsafe.relinker.ReLinkerInstance.loadLibraryInternal(ReLinkerInstance.java:180)
at com.getkeepsafe.relinker.ReLinkerInstance.loadLibrary(ReLinkerInstance.java:136)
at com.getkeepsafe.relinker.ReLinker.loadLibrary(ReLinker.java:70)
at com.getkeepsafe.relinker.ReLinker.loadLibrary(ReLinker.java:51)
at com.twilio.video.MediaFactory.instance(MediaFactory.java:47)
at com.twilio.video.LocalAudioTrack.create(LocalAudioTrack.java:98)
at com.twilio.video.LocalAudioTrack.create(LocalAudioTrack.java:75)
at com.nethram.video.views.MainActivity.createAudioAndVideoTracks(MainActivity.java:260)
at com.nethram.video.views.MainActivity.onCreate(MainActivity.java:131)
at android.app.Activity.performCreate(Activity.java:6304)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1118)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2409)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2539)
at android.app.ActivityThread.access$900(ActivityThread.java:159)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1384)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:152)
at android.app.ActivityThread.main(ActivityThread.java:5507)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
When I look into this error, I think this package uses armeabi split.
Is there any method to resolve this issue?

When packaging an ANE that uses an SDK that relies on native (jni) libraries you need to ensure they are also included in your ANE package. These must be placed in the libs directory in the appropriate architecture directory (armeabi etc).
If dealing with an aar file, then you can simply check if it contains a jni directory and copy it's contents to the libs directory in your ANE platform implementation.
You should end up with the following structure:
[ANDROID_PLATFORM]/
your_ane_implementation.jar
your_ane_res/
libs/
armeabi/
libXXXXX.so
armeabi-v7a/
libXXXXX.so
...

Related

Can't add .so file to Android Studio 3.5.3 using jniLibs

I'm trying to add a .so file to a new Android project. I'm using Android Studio 3.5.3. I've done what was recommended here and here ; so I created folders (jniLibs/arm64-v8a, etc) in src/main and added this to app/build.gradle:
sourceSets {
main {
jniLibs.srcDirs = ['src/main/jniLibs']
}
}
I placed the libhl.so file in /app/src/main/jniLibs/arm64-v8a (yes, 64-bit should be ok). The project will compile just fine, but on execution it will show the following error in logcat:
02-17 10:25:31.719 3691-3691/com.example.bmdtest03 E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.bmdtest03, PID: 3691
java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.example.bmdtest03-2/base.apk"],nativeLibraryDirectories=[/data/app/com.example.bmdtest03-2/lib/x86_64, /vendor/lib64, /system/lib64]]] couldn't find "libhl.so"
at java.lang.Runtime.loadLibrary(Runtime.java:366)
at java.lang.System.loadLibrary(System.java:989)
at com.example.bmdtest03.MainActivity.<clinit>(MainActivity.java:14)
at java.lang.reflect.Constructor.newInstance(Native Method)
at java.lang.Class.newInstance(Class.java:1572)
at android.app.Instrumentation.newActivity(Instrumentation.java:1065)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2199)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2360)
at android.app.ActivityThread.access$800(ActivityThread.java:144)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1278)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5221)
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)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:694)
Conclusion: the file is there, the source is updated in build.gradle, what am I missing?
You can manually generate the .so file with NDK . Then you can add the lib.so file in your jni folder.
Add the NDK path to your local.properties.
Refer this page : https://developer.android.com/studio/projects/gradle-external-native-builds
If its not works. You can create javah then you can access it.
Link to make javah : https://developer.android.com/training/articles/perf-jni

MuPDF Library not working on X86 architectures

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

Android Application crashed when share debug APK from output folder

I am working on one application that have only one screen barcode scanning and I am achieve this with zxing Library. But my problem is if I am install app with android studio it is working fine but if I share this apk from output folder with Bluetooth, Email, Xender, etc.. Application is install but when I open the app it will crash and Exception is NoClassFoundException.
Here is Logcat:
FATAL EXCEPTION: main
Process: com.jenex.cartracking, PID: 31223
java.lang.RuntimeException: Unable to instantiate activity
ComponentInfo{com.jenex.cartracking/com.jenex.cartracking.MainActivity}: java.lang.ClassNotFoundException: Didn't find class "com.jenex.cartracking.MainActivity" on path: DexPathList[[zip file "/data/app/com.jenex.cartracking-1/base.apk"],nativeLibraryDirectories=[/vendor/lib, /system/lib]]
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3029)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3300)
at android.app.ActivityThread.access$1000(ActivityThread.java:211)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1705)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:145)
at android.app.ActivityThread.main(ActivityThread.java:6946)
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)
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.jenex.cartracking.MainActivity" on path: DexPathList[[zip file "/data/app/com.jenex.cartracking-1/base.apk"],nativeLibraryDirectories=[/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 android.app.Instrumentation.newActivity(Instrumentation.java:1094)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3019)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3300) 
at android.app.ActivityThread.access$1000(ActivityThread.java:211) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1705) 
at android.os.Handler.dispatchMessage(Handler.java:102) 
at android.os.Looper.loop(Looper.java:145) 
at android.app.ActivityThread.main(ActivityThread.java:6946) 
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) 
Suppressed: java.lang.ClassNotFoundException: com.jenex.cartracking.MainActivity
at java.lang.Class.classForName(Native Method)
at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
... 13 more
Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack available
You have to clean build before share the app and make a debug build.
Follow this simple steps,
Goto Build -> Clean Project
Goto Build -> Build Apk
This will generate build Apk. Share this Apk.
Hope this helps.
It seems like I have the same problem. Such an exception happens now with any project, even with empty and clean just created. I used to share myproject_debug.apk with testers, but now it crashes on start up. Maybe it started after some update of Android Studio or platform-tools, I'm not sure.
So, I found some work around that work for me
Before copy project-debug.apk from output folder:
go to menu in Android Studio and open menu 'Build'
click 'Build APK'
After successful build I copy myproject-debug.apk from output folder and it works well.

Using Zbar.jar for Bar code scan, but it is not working in Android 6.0 and up

I am getting error while opening scanning bar code on the below line of code:
static
{
System.loadLibrary("iconv");
}
After that getting run time exception as mentioned below:
02-19 00:35:54.101 17727-17727/com.trialliancebarcode E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.trialliancebarcode, PID: 17727
java.lang.UnsatisfiedLinkError: dlopen failed: /data/app/com.trialliancebarcode-1/lib/arm/libiconv.so: has text relocations
at java.lang.Runtime.loadLibrary(Runtime.java:372)
at java.lang.System.loadLibrary(System.java:1076)
at com.trialliancebarcode.BarcodeScanner.<clinit>(BarcodeScanner.java:48)
at java.lang.Class.newInstance(Native Method)
at android.app.Instrumentation.newActivity(Instrumentation.java:1090)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2327)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2490)
at android.app.ActivityThread.-wrap11(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1354)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5443)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:728)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
Please help me on this.
i'm not using ZBAR but i work on project Reading barcode
i use mobile vision Api supported by google try it
Check this Link
Please try this:
Download the latest ZBar project here
grab the latest .so from barcodescanner/zbar/src/main/jniLibs, and replace the relative .so in your project.
Run your app.
(Works well targetSdkVersion 25, buildToolsVersion '25.0.3', compileSdkVersion 25, or below)

Mupdf lib crash on Samsung Galaxy Edge 6

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

Categories

Resources