Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-16598] Android: Application may crash referencing Ti.Geolocation

GitHub Issuen/a
TypeBug
PriorityLow
StatusOpen
ResolutionUnresolved
Affected Version/sRelease 3.2.1
Fix Version/sn/a
ComponentsAndroid
Labelsandroid, geolocation
ReporterChris Apers
AssigneeUnknown
Created2014-03-09T18:09:56.000+0000
Updated2018-02-28T20:04:23.000+0000

Description

If you reference Ti.Geolocation somewhere in your code BUT don't use any of the methods/properties, the geolocation.res.zip will not be included in the build and the app may hang on splash screen and return the following exception in the trace: [ERROR] : JNIUtil: Couldn't find Java class: ti/modules/titanium/geolocation/GeolocationModule [WARN] : W/System.err: java.lang.NoClassDefFoundError: ti/modules/titanium/geolocation/GeolocationModule [WARN] : W/System.err: at org.appcelerator.kroll.runtime.v8.V8Runtime.nativeRunModule(Native Method) [WARN] : W/System.err: at org.appcelerator.kroll.runtime.v8.V8Runtime.doRunModule(V8Runtime.java:159) [WARN] : W/System.err: at org.appcelerator.kroll.KrollRuntime.handleMessage(KrollRuntime.java:289) [WARN] : W/System.err: at org.appcelerator.kroll.runtime.v8.V8Runtime.handleMessage(V8Runtime.java:185) [WARN] : W/System.err: at android.os.Handler.dispatchMessage(Handler.java:95) [WARN] : W/System.err: at android.os.Looper.loop(Looper.java:137) [WARN] : W/System.err: at org.appcelerator.kroll.KrollRuntime$KrollRuntimeThread.run(KrollRuntime.java:112) [WARN] : W/System.err: Caused by: java.lang.ClassNotFoundException: Didn't find class "ti.modules.titanium.geolocation.GeolocationModule" on path: /data/app/com.drizly.DrilzyDev6-1.apk [WARN] : W/System.err: at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:65) [WARN] : W/System.err: at java.lang.ClassLoader.loadClass(ClassLoader.java:501) [WARN] : W/System.err: at java.lang.ClassLoader.loadClass(ClassLoader.java:461) [WARN] : W/System.err: ... 7 more [INFO] : libc: Fatal signal 11 (SIGSEGV) at 0x00000000 (code=1), thread 9824 (KrollRuntimeThr)

Comments

  1. Chris Apers 2014-03-09

    Easy way to reproduce
       var coder = Ti.Geolocation;
       
       coder.forwardGeocoder(someAddress, function(response) {
       	console.log("coding", response);
       });
       
    Here the compiler will not detect usage of forwardGeocoder() and the lib will not be included!
  2. Ritu Agrawal 2014-03-10

    Moving this ticket to engineering as I can reproduce this issue easily with the provided test case. Same test case works fine with iOS platform.
       var coder = Ti.Geolocation;
        
       coder.forwardGeocoder("San Francisco, USA", function(response) {
           console.log("coding", response);
       });
       
    Stack trace: [WARN] : W/System.err: java.lang.NoClassDefFoundError: ti/modules/titanium/geolocation/GeolocationModule [ERROR] : JNIUtil: Couldn't find Java class: ti/modules/titanium/geolocation/GeolocationModule [WARN] : W/System.err: at org.appcelerator.kroll.runtime.v8.V8Runtime.nativeRunModule(Native Method) [WARN] : W/System.err: at org.appcelerator.kroll.runtime.v8.V8Runtime.doRunModule(V8Runtime.java:159) [WARN] : W/System.err: at org.appcelerator.kroll.KrollRuntime.handleMessage(KrollRuntime.java:289) [WARN] : W/System.err: at org.appcelerator.kroll.runtime.v8.V8Runtime.handleMessage(V8Runtime.java:185) [WARN] : W/System.err: at android.os.Handler.dispatchMessage(Handler.java:95) [WARN] : W/System.err: at android.os.Looper.loop(Looper.java:137) [WARN] : W/System.err: at org.appcelerator.kroll.KrollRuntime$KrollRuntimeThread.run(KrollRuntime.java:112) [WARN] : W/System.err: Caused by: java.lang.ClassNotFoundException: Didn't find class "ti.modules.titanium.geolocation.GeolocationModule" on path: /data/app/com.appcelerator.testproject-1.apk [WARN] : W/System.err: at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:65) [WARN] : W/System.err: at java.lang.ClassLoader.loadClass(ClassLoader.java:501) [WARN] : W/System.err: at java.lang.ClassLoader.loadClass(ClassLoader.java:461) [WARN] : W/System.err: ... 7 more

JSON Source