Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-26727] Hyperloop: Android app using hyperloop 4.0.0 hangs on splash when built with 7.5.0.GA & latest 7.5.1

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2019-01-16T16:21:07.000+0000
Affected Version/sRelease 7.5.0, Release 7.5.1
Fix Version/sRelease 8.0.0
ComponentsHyperloop
Labelsn/a
ReporterLokesh Choudhary
AssigneeGary Mathews
Created2019-01-15T00:18:32.000+0000
Updated2019-01-18T23:08:39.000+0000

Description

Steps to reproduce:

1. Create a default app having hyperloop 4.0.0. 2. Build for Android device/emulator.

Actual result:

1. App is stuck at splash at launch & we do see this error in logcat:
01-14 15:55:32.437  2950  2950 D AndroidRuntime: Shutting down VM
01-14 15:55:32.437  2950  2950 E AndroidRuntime: FATAL EXCEPTION: main
01-14 15:55:32.437  2950  2950 E AndroidRuntime: Process: com.app.timob26719, PID: 2950
01-14 15:55:32.437  2950  2950 E AndroidRuntime: java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "_ZN8titanium11TiViewProxy16getProxyTemplateEN2v85LocalINS1_7ContextEEE" referenced by "/data/app/com.app.timob26719-MEEWudT-8rk457q_wUWhzg==/lib/arm64/libhyperloop.so"...
01-14 15:55:32.437  2950  2950 E AndroidRuntime: 	at java.lang.Runtime.loadLibrary0(Runtime.java:1016)
01-14 15:55:32.437  2950  2950 E AndroidRuntime: 	at java.lang.System.loadLibrary(System.java:1669)
01-14 15:55:32.437  2950  2950 E AndroidRuntime: 	at org.appcelerator.kroll.runtime.v8.V8Runtime.loadExternalModules(V8Runtime.java:139)
01-14 15:55:32.437  2950  2950 E AndroidRuntime: 	at org.appcelerator.kroll.runtime.v8.V8Runtime.initRuntime(V8Runtime.java:113)
01-14 15:55:32.437  2950  2950 E AndroidRuntime: 	at org.appcelerator.kroll.KrollRuntime.doInit(KrollRuntime.java:207)
01-14 15:55:32.437  2950  2950 E AndroidRuntime: 	at org.appcelerator.kroll.KrollRuntime$KrollRuntimeThread.run(KrollRuntime.java:113)
01-14 15:55:32.437  2950  2950 E AndroidRuntime: 	at org.appcelerator.kroll.KrollRuntime.init(KrollRuntime.java:135)
01-14 15:55:32.437  2950  2950 E AndroidRuntime: 	at com.app.timob26719.Timob26719Application.onCreate(Timob26719Application.java:95)
01-14 15:55:32.437  2950  2950 E AndroidRuntime: 	at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1154)
01-14 15:55:32.437  2950  2950 E AndroidRuntime: 	at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5871)
01-14 15:55:32.437  2950  2950 E AndroidRuntime: 	at android.app.ActivityThread.access$1100(ActivityThread.java:199)
01-14 15:55:32.437  2950  2950 E AndroidRuntime: 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1650)
01-14 15:55:32.437  2950  2950 E AndroidRuntime: 	at android.os.Handler.dispatchMessage(Handler.java:106)
01-14 15:55:32.437  2950  2950 E AndroidRuntime: 	at android.os.Looper.loop(Looper.java:193)
01-14 15:55:32.437  2950  2950 E AndroidRuntime: 	at android.app.ActivityThread.main(ActivityThread.java:6669)
01-14 15:55:32.437  2950  2950 E AndroidRuntime: 	at java.lang.reflect.Method.invoke(Native Method)
01-14 15:55:32.437  2950  2950 E AndroidRuntime: 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
01-14 15:55:32.437  2950  2950 E AndroidRuntime: 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)

Expected result:

1. App should not be stuck on the splash screen & should launch fine.

Comments

  1. Lokesh Choudhary 2019-01-15

    I also do see this error below when I try to run IOS app using SDK 7.5.0.GA.
       [ERROR] :  You cannot use the Hyperloop compiler with a version of Titanium older than 8.0.0
       [ERROR] :  Set the value of <sdk-version> to a newer version in tiapp.xml.
       [ERROR] :  For example:
       [ERROR] :  	<sdk-version>8.0.0.GA</sdk-version>
       
    If hyperloop 4.0.0 is not supposed to be used with SDK below 8.0.0 then I guess we should update the module manifest so that the right module version is enabled when SDK below 8.0.0 is used.
  2. Gary Mathews 2019-01-15

    Nope, this should not be a breaking change. Modules should be backwards compatible. I believe this is due to the Hyperloop module being built with an SDK prior to the changes here https://github.com/appcelerator/titanium_mobile/commit/1234b7447d431343696910974fc1175f272c05f2#diff-6f5d533396b30acbdea39dee3f511ab7
  3. Jan Vennemann 2019-01-15

    [~gmathews], i built the modules with the latest available build from 8_0_X which is 8.0.0.v20190114160512. Removing the module from the app or setting the SDK back to 8.0.0 will make it work normally again. [~jquick], i don't get any exception at all. The logs look like this:
       -- Start application log -----------------------------------------------------
       [INFO]  Project built successfully in 56s 845ms
       
       [WARN]  zygote: Unexpected CPU variant for X86 using defaults: x86_64
       [INFO]  TiApplication: (main) [0,0] checkpoint, app created.
       [INFO]  zygote: Background concurrent copying GC freed 12177(2MB) AllocSpace objects, 4(240KB) LOS objects, 50% free, 5MB/11MB, paused 3.074ms total 492.503ms
       [INFO]  MultiDex: VM with version 2.1.0 has multidex support
       [INFO]  MultiDex: Installing application
       [INFO]  MultiDex: VM has multidex support, MultiDex support library is disabled.
       [DEBUG] APSAnalytics: APSAnalytics initialization started...
       [DEBUG] AndroidRuntime: Shutting down VM
       
    *Steps to reproduce*

    Build module with SDK 8.0.0.v20190114160512, e.g. [ti.identitiy](https://github.com/appcelerator-modules/titanium-identity)

    Add that module to a test project. Make sure the selected SDK version for the app project is set to 7.5.0.GA

    Add the following test case

       const win = Ti.UI.createWindow({ layout: 'vertical' });
       const label = Ti.UI.createLabel({ text: 'Now you see me' });
       win.add(label);
       win.open();
       

    Run the app on Android simulator or device

    *Actual behavior* The app hangs on splash screen. No exception is thrown, the only indicator that something went wrong is a log message with [DEBUG] AndroidRuntime: Shutting down VM. *Expected behavior* App starts and a simple window with a label "No you see me" is shown.
  4. Joshua Quick 2019-01-15

    The following logged message is interesting...
       [WARN]  zygote: Unexpected CPU variant for X86 using defaults: x86_64
       
    Sounds like an x86 architecture issue. Like your module might be missing an x86 .so for the module. If you unzip your APK file (ie: change the .apk extension to .zip and then unzip it), then you can find all of the .so libraries under the unzipped APK's "lib" folder. You should have a matching .so library under every architecture subfolder such as "x86" and "armeabi-v7a". If there is a different amount of libraries under the subfolders, then that's the problem.
  5. Joshua Quick 2019-01-15

    Oh never mind. I'm able to reproduce this using the current 2.1.1 pre-release of the module on 7.5.0. The issue is that a 8.0.0 compiled modules will implicitly link to its version of V8's C++ classes. And we have V8 wrapper interfaces in 8.0.0 to make 7.0.0 built module backward compatible on 8.0.0. So, for this particular case, we have a "forward" compatibility issue. The 8.0.0 built module is trying to link to V8 C++ classes that don't exist with 7.0.0's version of V8. There really is no easy solution to this problem in C++. It can be easily done with C APIs, but not with C++ other than to make separate .so files. Which means the simple solution is to have 8.0.0 built modules have a min Titanium version so that they can't be used by older versions of Titanium.
  6. Gary Mathews 2019-01-16

    We just needed to update the templates to not use the the new method signatures but continue to use the old ones for compatibility. master: https://github.com/appcelerator/titanium_mobile/pull/10619 8_0_X: https://github.com/appcelerator/titanium_mobile/pull/10618 We will need to recompile our modules with the new build.
  7. Christopher Williams 2019-01-16

    Just to confirm - even though these PRs are merged, presumably we need a Hyperloop 4.0.1 build against the latest 8_0_X build and include that in the SDK in another PR? cc [~jvennemann]
  8. Lokesh Choudhary 2019-01-18

    Verified the fix with SDK 8.0.0.v20190117115226 & hyperloop 4.0.1. Closing. Studio Ver: 5.1.2.201812191831 SDK Ver: 8.0.0.v20190117115226 OS Ver: 10.14 Xcode Ver: Xcode 10.1 Appc NPM: 4.2.13 Appc CLI: 7.0.10-master.5 Daemon Ver: 1.1.3 Ti CLI Ver: 5.1.1 Alloy Ver: 1.13.7 Node Ver: 8.9.1 NPM Ver: 5.5.1 Java Ver: 10.0.2

JSON Source