Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-24542] Hyperloop: Android - Static variable is returned as null

GitHub Issuen/a
TypeBug
PriorityNone
StatusClosed
ResolutionNot Our Bug
Resolution Date2017-04-04T15:18:08.000+0000
Affected Version/sRelease 6.0.3
Fix Version/sn/a
ComponentsAndroid, Hyperloop
Labelsn/a
Reporter Ricardo Ramirez
AssigneeChristopher Williams
Created2017-03-29T08:45:22.000+0000
Updated2018-08-06T17:52:09.000+0000

Description

Issue Description

When customer is trying to access a static variable in the third party library, it is returned as null. (Unable to access the constants and enums in the third party library, it is returned as null) H5. Steps to Replicate

Download the attached project

Run

Click on the label

Attachments

FileDateSize
HyperLoop_Example (1).zip2017-03-29T08:45:20.000+00005170630

Comments

  1. Christopher Williams 2017-04-04

    It would have been helpful to have more info here, like logs. In any case, I attempted to reproduce the issue locally. When I run the above steps I see this in my logs:
       [ERROR] HyperloopProxy: (main) [103417,108847] Exception thrown during invocation of method: public static com.kofax.kmc.kut.utilities.error.ErrorInfo com.kofax.kmc.kut.utilities.Licensing.setMobileSDKLicense(java.lang.String), args: [tt$,^0XzL#dRFXd#Z&Trt$4zd&J$D2VF6p[089dN5n[6qb04[(NPIUEAWGUNKl;dfvkhzdf7rglcvjck=,mIOF&^BUL?!!!!!!$n]
       [ERROR] HyperloopProxy: java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.axway.timob24542-1/base.apk"],nativeLibraryDirectories=[/data/app/com.axway.timob24542-1/lib/x86, /data/app/com.axway.timob24542-1/base.apk!/lib/x86, /vendor/lib, /system/lib]]] couldn't find "libAtalaBar.so"
       [ERROR] HyperloopProxy: 	at java.lang.Runtime.loadLibrary(Runtime.java:367)
       [ERROR] HyperloopProxy: 	at java.lang.System.loadLibrary(System.java:1076)
       [ERROR] HyperloopProxy: 	at com.kofax.kmc.kut.utilities.IpLibUtil.<clinit>(SourceFile:70)
       [ERROR] HyperloopProxy: 	at com.kofax.kmc.kut.utilities.Licensing.setMobileSDKLicense(SourceFile:41)
       [ERROR] HyperloopProxy: 	at java.lang.reflect.Method.invoke(Native Method)
       [ERROR] HyperloopProxy: 	at hyperloop.BaseProxy.invokeMethod(BaseProxy.java:145)
       [ERROR] HyperloopProxy: 	at hyperloop.BaseProxy.callNativeFunction(BaseProxy.java:127)
       [ERROR] HyperloopProxy: 	at org.appcelerator.kroll.runtime.v8.V8Object.nativeFireEvent(Native Method)
       [ERROR] HyperloopProxy: 	at org.appcelerator.kroll.runtime.v8.V8Object.fireEvent(V8Object.java:62)
       [ERROR] HyperloopProxy: 	at org.appcelerator.kroll.KrollProxy.doFireEvent(KrollProxy.java:872)
       [ERROR] HyperloopProxy: 	at org.appcelerator.kroll.KrollProxy.handleMessage(KrollProxy.java:1095)
       [ERROR] HyperloopProxy: 	at org.appcelerator.titanium.proxy.TiViewProxy.handleMessage(TiViewProxy.java:360)
       [ERROR] HyperloopProxy: 	at android.os.Handler.dispatchMessage(Handler.java:98)
       [ERROR] HyperloopProxy: 	at android.os.Looper.loop(Looper.java:148)
       [ERROR] HyperloopProxy: 	at android.app.ActivityThread.main(ActivityThread.java:5417)
       [ERROR] HyperloopProxy: 	at java.lang.reflect.Method.invoke(Native Method)
       [ERROR] HyperloopProxy: 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
       [ERROR] HyperloopProxy: 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
       
    The important part there is that it's failing to load a native library named libAtalaBar.so I recompiled the platform/android/kfxutilities.jar and see that through chain of calls, we get to com.kofax.kmc.kut.utilities.IpLibutil class, which attempts to load the native libraries: AtalaBar and EvrsJniWrapper. That means there should be an libAtalaBar.so and libEvrsJniWrapper.so somewhere to load. Since this is a JAR file, it isn't inside it. So the basic issue stems from missing native libraries that aren't packaged with this app, but are required by the kfxutilities.jar they're trying to consume. They need to make sure if they have Java libraries that require native libraries that they include those as well (They'd end up at a location like platform/android/libs/<arch>/libAtalaBar.so where arch is x86 or armeabi-v7a). Typically you'd package this up all of this as an AAR so the java code in this jar would be included as well as the native libraries it depends upon and you wouldn't have to worry about copying multiple files/paths over.
  2. Eric Merriman 2018-08-06

    Closing as "not our bug". If you disagree, please reopen.

JSON Source