androidairadobeanetwilio-video

Adobe Android ANE support armeabi


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?


Solution

  • 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    
            ...