Titanium JIRA Archive
Appcelerator Community (AC)

[AC-3044] Android V8 Runtime error.

GitHub Issuen/a
TypeBug
Priorityn/a
StatusClosed
ResolutionNeeds more info
Resolution Date2012-06-11T06:15:53.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsTitanium SDK & CLI
LabelsC2DM, android
ReporterSurajit Biswas
AssigneeEduardo Gomez
Created2012-05-25T02:11:30.000+0000
Updated2016-03-08T07:48:05.000+0000

Description

I have implemented C2DM module for android. But when I use it in Titanium project it throws me run time error as below: 05-25 14:12:58.935: ERROR/TiApplication(3701): (KrollRuntimeThread) [42,2032] Sending event: exception on thread: KrollRuntimeThread msg:java.lang.UnsatisfiedLinkError: Couldn't load com.findlaw.c2dm: findLibrary returned null; Titanium 1.8.2,2012/02/23 17:46,59b3a90 05-25 14:12:58.935: ERROR/TiApplication(3701): java.lang.UnsatisfiedLinkError: Couldn't load com.findlaw.c2dm: findLibrary returned null 05-25 14:12:58.935: ERROR/TiApplication(3701): at java.lang.Runtime.loadLibrary(Runtime.java:429) 05-25 14:12:58.935: ERROR/TiApplication(3701): at java.lang.System.loadLibrary(System.java:554) 05-25 14:12:58.935: ERROR/TiApplication(3701): at org.appcelerator.kroll.runtime.v8.V8Runtime.loadExternalModules(V8Runtime.java:88) 05-25 14:12:58.935: ERROR/TiApplication(3701): at org.appcelerator.kroll.runtime.v8.V8Runtime.initRuntime(V8Runtime.java:68) 05-25 14:12:58.935: ERROR/TiApplication(3701): at org.appcelerator.kroll.KrollRuntime.doInit(KrollRuntime.java:146) 05-25 14:12:58.935: ERROR/TiApplication(3701): at org.appcelerator.kroll.KrollRuntime$KrollRuntimeThread.run(KrollRuntime.java:99) 05-25 14:12:58.970: ERROR/AndroidRuntime(3701): FATAL EXCEPTION: KrollRuntimeThread 05-25 14:12:58.970: ERROR/AndroidRuntime(3701): java.lang.UnsatisfiedLinkError: Couldn't load com.findlaw.c2dm: findLibrary returned null 05-25 14:12:58.970: ERROR/AndroidRuntime(3701): at java.lang.Runtime.loadLibrary(Runtime.java:429) 05-25 14:12:58.970: ERROR/AndroidRuntime(3701): at java.lang.System.loadLibrary(System.java:554) 05-25 14:12:58.970: ERROR/AndroidRuntime(3701): at org.appcelerator.kroll.runtime.v8.V8Runtime.loadExternalModules(V8Runtime.java:88) 05-25 14:12:58.970: ERROR/AndroidRuntime(3701): at org.appcelerator.kroll.runtime.v8.V8Runtime.initRuntime(V8Runtime.java:68) 05-25 14:12:58.970: ERROR/AndroidRuntime(3701): at org.appcelerator.kroll.KrollRuntime.doInit(KrollRuntime.java:146) 05-25 14:12:58.970: ERROR/AndroidRuntime(3701): at org.appcelerator.kroll.KrollRuntime$KrollRuntimeThread.run(KrollRuntime.java:99) I am getting this error when I run this project in V8. But if I run it in Rhino it is working fine. I have attached the Titanium project and C2DM android module respectively. I have also tested this in Titanium mobilesdk-2.0.2.v20120522180515-win32, but result is same.

Attachments

FileDateSize
c2dm_app_old_24_05_2012.zip2012-05-25T02:11:30.000+0000773410
com.findlaw.c2dm-android-0.1.zip2012-06-05T15:43:37.000+000033924
Kuraturpa-titanium-c2dm-700c7c9_22_05_2012.zip2012-05-25T02:11:30.000+000096441

Comments

  1. Eduardo Gomez 2012-06-05

    After built module as per following settings was able to get it compiled successfully:

    build.properties

       titanium.platform=/Library/Application Support/Titanium/mobilesdk/osx/1.8.2/android
       android.platform=/Users/egomez/android-sdks/platforms/android-8
       
       google.apis=/Users/egomez/android-sdks/add-ons/addon_google_apis_google_inc_8
       android.ndk=/Users/egomez/android-ndk-r8
       

    DDMS output

       06-05 17:28:09.003: I/ActivityManager(515): Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.appc.test/.Tc923Activity } from pid 885
       06-05 17:28:09.058: D/ActivityRenderTarget(885): onPause
       06-05 17:28:09.097: W/ApplicationContext(515): Unable to create files directory
       06-05 17:28:09.113: I/gralloc(515): Allocated 0x3d646573 size 1936482662
       06-05 17:28:09.175: I/ActivityManager(515): Start proc com.appc.test for activity com.appc.test/.Tc923Activity: pid=21565 uid=10149 gids={1015, 3003}
       06-05 17:28:09.230: I/TiApplication(21565): (main) [0,0] checkpoint, app created.
       06-05 17:28:09.261: I/TiApplication(21565): (main) [33,33] Titanium 2.0.1 (2012/04/12 16:36 999c68a)
       06-05 17:28:09.933: I/TiDbHelper(21565): (main) [667,700] No value in database for platform key: 'unique_machine_id' returning supplied default ''
       06-05 17:28:09.941: I/TiDbHelper(21565): (main) [10,710] No value in database for platform key: 'hardware_machine_id' returning supplied default ''
       06-05 17:28:10.050: I/TiApplication(21565): (main) [106,816] Titanium Javascript runtime: v8
       06-05 17:28:10.058: D/dalvikvm(21565): Trying to load lib /data/data/com.appc.test/lib/libstlport_shared.so 0x4051c970
       06-05 17:28:10.058: D/dalvikvm(21565): Added shared lib /data/data/com.appc.test/lib/libstlport_shared.so 0x4051c970
       06-05 17:28:10.066: D/dalvikvm(21565): No JNI_OnLoad found in /data/data/com.appc.test/lib/libstlport_shared.so 0x4051c970, skipping init
       06-05 17:28:10.066: D/dalvikvm(21565): Trying to load lib /data/data/com.appc.test/lib/libkroll-v8.so 0x4051c970
       06-05 17:28:10.089: D/dalvikvm(21565): Added shared lib /data/data/com.appc.test/lib/libkroll-v8.so 0x4051c970
       06-05 17:28:10.097: I/TiRootActivity(21565): (main) [0,0] checkpoint, on root activity create, savedInstanceState: null
       06-05 17:28:10.128: D/TiAnalyticsDb(21565): (main) [30,30] Creating Database tianalytics.db
       06-05 17:28:10.128: I/TiAnalyticsDb(21565): (main) [0,30] Upgrading Database from 1 to 4
       06-05 17:28:10.371: E/TiApplication(21565): (KrollRuntimeThread) [243,273] APP PROXY: ti.modules.titanium.app.AppModule@405bc4f0
       06-05 17:28:10.394: D/dalvikvm(21565): Trying to load lib /data/data/com.appc.test/lib/libcom.findlaw.c2dm.so 0x4051c970
       06-05 17:28:10.394: D/dalvikvm(21565): Added shared lib /data/data/com.appc.test/lib/libcom.findlaw.c2dm.so 0x4051c970
       06-05 17:28:10.394: D/dalvikvm(21565): No JNI_OnLoad found in /data/data/com.appc.test/lib/libcom.findlaw.c2dm.so 0x4051c970, skipping init
       06-05 17:28:10.410: I/TiAPI(21565): senderId is => android123developer@gmail.com
       06-05 17:28:10.441: I/TiAPI(21565): module is => [object Object]
       06-05 17:28:10.441: I/TiAPI(21565): Registering...
       06-05 17:28:10.441: D/C2dmModule(21565): (KrollRuntimeThread) [71,344] registerC2dm called
       06-05 17:28:10.441: D/C2dmModule(21565): (KrollRuntimeThread) [0,344] get registrationId property
       06-05 17:28:10.464: W/SocketListener(257): Num of active clients:1
       06-05 17:28:10.488: D/dalvikvm(21565): GC_EXTERNAL_ALLOC freed 495K, 45% free 3300K/5959K, external 2357K/2773K, paused 36ms
       06-05 17:28:10.542: I/TiRootActivity(21565): (main) [0,0] checkpoint, on root activity resume. activity = com.appc.test.Tc923Activity@40595be0
       06-05 17:28:10.558: W/InputManagerService(515): Starting input on non-focused client com.android.internal.view.IInputMethodClient$Stub$Proxy@4097b598 (uid=10035 pid=885)
       06-05 17:28:10.566: I/gralloc(515): Allocated 0x660072 size 6488161
       06-05 17:28:10.613: I/ActivityManager(515): Displayed com.appc.test/.Tc923Activity: +1s442ms
       06-05 17:28:15.542: W/TiVerify(21565): (Timer-0) [5005,5005] Verifying module licenses...
       06-05 17:28:15.605: W/SocketListener(257): Num of active clients:2
       06-05 17:28:15.675: D/dalvikvm(885): GC_EXPLICIT freed 792K, 48% free 4681K/8903K, external 8676K/9662K, paused 47ms
       06-05 17:28:15.816: D/dalvikvm(935): GC_CONCURRENT freed 1375K, 41% free 5234K/8839K, external 2357K/2773K, paused 2ms+4ms
       06-05 17:28:15.824: W/SocketListener(257): Num of active clients:2
       06-05 17:28:16.519: D/LSAPP_TelMon(797): onCellTowerChanged CDMA :: {"NetTyp":"CDMA","BaseStnLat":"297036","NetOp":"33404","BaseStnId":"505","BaseStnLng":"-1488748","CntryISO":"mx","NetId":"0","SysId":"24587"}
       06-05 17:28:16.550: D/LSAPP_TelMon(797): Telmon : celltower changed...new cell...clear bouncing cells upon new cell and no pending timer 
       06-05 17:28:16.550: D/LSAPP_TelMon(797): emptyBouncingCells :: 
       06-05 17:28:16.558: D/LSAPP_LocMon(797): stopLocationUpdate :: stop request location update after removed listener...
       06-05 17:28:16.566: D/LSAPP_LSDet(797): setStateFlag: flag=2 Set(true)Reset(false)=false mStateFlag=1
       06-05 17:28:16.566: D/LSAPP_LSDet(797): runDetection: stop loc req upon wifi connected and inside poi and clear fix pending flag.Run Detection upon cell tower change event : {CurPOI:Home:NextPOI:null}
       06-05 17:28:16.597: D/LSAPP_Heal(797): updateCurrentLocAccuTime :: update current location :: where (StartTime = 1333630877560 )row=1 starttime : 1333630877560
       06-05 17:28:16.597: D/LSAPP_LSMan(797): hasCellTowerChanged :: Yes :start tracking : cur cell :{"NetTyp":"CDMA","BaseStnLat":"297292","NetOp":"11104","BaseStnId":"753","BaseStnLng":"-1488700","CntryISO":"","NetId":"0","SysId":"24587"}&&{"NetTyp":"CDMA","BaseStnLat":"297292","NetOp":"33404","BaseStnId":"753","BaseStnLng":"-1488700","CntryISO":"mx","NetId":"0","SysId":"24587"}&&{"NetTyp":"CDMA","BaseStnLat":"2147483647","NetOp":"33404","BaseStnId":"623","BaseStnLng":"2147483647","CntryISO":"mx","NetId":"0","SysId":"24587"}&&{"NetTyp":"CDMA","BaseStnLat":"2147483647","NetOp":"","BaseStnId":"0","BaseStnLng":"2147483647","CntryISO":"","NetId":"0","SysId":"0"}:: new cell :{"NetTyp":"CDMA","BaseStnLat":"297036","NetOp":"33404","BaseStnId":"505","BaseStnLng":"-1488748","CntryISO":"mx","NetId":"0","SysId":"24587"}
       06-05 17:28:16.597: D/LSAPP_LSMan(797): isLatestLocationWithinPoi: DetPoi:Home CurLocPoi:Home
       06-05 17:28:16.597: D/LSAPP_LSMan(797): celltower changed...  new cell..we are moving.. :: latest location within poi, stop timer, do nothing...
       06-05 17:28:21.011: I/TiVerify(21565): (Timer-0) [5469,10474] Succesfully verified module licenses
       
    Can you update your ndk version? Furthermore, if it doesn't works, can you install [gperf](http://www.gnu.org/software/gperf/) and give another try? I'm not currently able to install & test gperf, but as per user reports it is needed for Windows 7 (win32) to work around Android module Errors out in V8 with java.lang.UnsatisfiedLinkError (which I got after trying to use your module bundle version). I'll leave this open for a while in case of questions or further clarifications.
  2. Eduardo Gomez 2012-06-05

    5.6.12 - Uploaded generated "com.findlaw.c2dm-android-0.1.zip". Ported & tested from "/Library/Application\ Support/Titanium/modules/android/com.findlaw.c2dm"
  3. Surajit Biswas 2012-06-11

    Hello Gomez, Thanks for your reply. Issue was with the ndk version and also gperf was not installed in my system. After installing gperf and also get the latest ndk i.e r8 it has worked successfully. You can close this bug.

JSON Source