Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-5138] Android: After building for emulator, application crashes on launch on device

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2012-01-10T13:16:40.000+0000
Affected Version/sRelease 1.7.2, Release 1.8.0
Fix Version/sSprint 2011-40, Release 1.8.0, Release 1.8.0.1
ComponentsAndroid
Labelsmerge-1.7.6, module_emulator, qe-testadded, regression
ReporterVikramjeet Singh
AssigneeBill Dawson
Created2011-08-26T16:55:22.000+0000
Updated2014-06-19T12:46:35.000+0000

Description

New: 1.create a simple app with 1.8.0 2.run it in the emulator 3.install to device 4.eyeball device results:app crashes on launch OLD steps: Steps to reproduce: 1. Create a titanium mobile project for android using TiMob: 1.8.0.v20110819142548 2. Add following to tiapp.xml within and tags which would look something like this: http://schemas.android.com/apk/res/android"> 3. Build and run it on Android Emulator. 4. Install it on Android device. (It works on Android Emulator though.) 5. Try to run the application. 6. It would say. sorry, app quits unexpectedly. (Note: I runs properly if we directly install it on device without running it in Emulator) adb logcat output is pasted below. Note: If you create the mobile with TiMob 1.7.2 and follow above from steps2 to step6, application would run properly. Also, if you first create the project with TiMob 1.7.2 and then change it to TiMob 1.8.0.v20110819142548 from tiapp.xml, and then repeat the steps from step2 to step6, it will again run properly.

E/AndroidRuntime( 5726): FATAL EXCEPTION: main
E/AndroidRuntime( 5726): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.appcelerator.anyApp/com.appcelerator.anyApp.AnyappActivity}: java.lang.NullPointerException
E/AndroidRuntime( 5726): 	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2663)
E/AndroidRuntime( 5726): 	at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
E/AndroidRuntime( 5726): 	at android.app.ActivityThread.access$2300(ActivityThread.java:125)
E/AndroidRuntime( 5726): 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
E/AndroidRuntime( 5726): 	at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime( 5726): 	at android.os.Looper.loop(Looper.java:123)
E/AndroidRuntime( 5726): 	at android.app.ActivityThread.main(ActivityThread.java:4627)
E/AndroidRuntime( 5726): 	at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime( 5726): 	at java.lang.reflect.Method.invoke(Method.java:521)
E/AndroidRuntime( 5726): 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:858)
E/AndroidRuntime( 5726): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
E/AndroidRuntime( 5726): 	at dalvik.system.NativeStart.main(Native Method)
E/AndroidRuntime( 5726): Caused by: java.lang.NullPointerException
E/AndroidRuntime( 5726): 	at java.io.Reader.<init>(Reader.java:65)
E/AndroidRuntime( 5726): 	at java.io.InputStreamReader.<init>(InputStreamReader.java:65)
E/AndroidRuntime( 5726): 	at ti.modules.titanium.yahoo.YahooModule.bindContextSpecific(YahooModule.java:39)
E/AndroidRuntime( 5726): 	at org.appcelerator.titanium.TiApplication.bindModules(TiApplication.java:117)
E/AndroidRuntime( 5726): 	at org.appcelerator.titanium.kroll.KrollBridge.<init>(KrollBridge.java:42)
E/AndroidRuntime( 5726): 	at org.appcelerator.titanium.TiContext.createTiContext(TiContext.java:319)
E/AndroidRuntime( 5726): 	at org.appcelerator.titanium.TiLaunchActivity.onCreate(TiLaunchActivity.java:96)
E/AndroidRuntime( 5726): 	at org.appcelerator.titanium.TiRootActivity.onCreate(TiRootActivity.java:39)
E/AndroidRuntime( 5726): 	at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
E/AndroidRuntime( 5726): 	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
E/AndroidRuntime( 5726): 	... 11 more
W/ActivityManager( 1096):   Force finishing activity com.appcelerator.anyApp/.AnyappActivity
W/ActivityManager( 1096): Activity pause timeout for HistoryRecord{449a5c48 com.appcelerator.anyApp/.AnyappActivity}
D/dalvikvm( 5290): GC_EXPLICIT freed 3797 objects / 254792 bytes in 65ms
E/QSB.Suggestions( 5290): LEAK! Finalized without being closed: Suggestions[]
W/ActivityManager( 1096): Activity destroy timeout for HistoryRecord{449a5c48 com.appcelerator.anyApp/.AnyappActivity}
D/dalvikvm( 5337): GC_EXPLICIT freed 244 objects / 9416 bytes in 75ms
I/power   ( 1096): *** set_screen_state 0
D/SurfaceFlinger( 1096): About to give-up screen, flinger = 0x120f38
D/Sensors ( 1096): using accelerometer (name=accelerometer)
D/WifiService( 1096): ACTION_SCREEN_OFF
D/WifiService( 1096): setting ACTION_DEVICE_IDLE timer for 900000ms
D/StatusBar( 1096): DISABLE_EXPAND: yes
D/GoogleLoginService( 1214): onBind: Intent { act=android.accounts.AccountAuthenticator cmp=com.google.android.gsf/.loginservice.GoogleLoginService }
D/dalvikvm( 1214): GC_EXPLICIT freed 1248 objects / 62624 bytes in 79ms
E/Tethering( 1096): active iface (usb0) reported as added, ignoring
D/WifiService( 1096): ACTION_BATTERY_CHANGED pluggedType: 2

Attachments

FileDateSize
timob5158Diff.txt2011-09-09T11:48:36.000+000010132

Comments

  1. Natalie Huynh 2011-09-08

    Also encountering it with just a new project on 10.6.8 with 1.8.0.v20110906155354 1. Create project 2. Run on emulator 3. Run on device See the same errors as the log above
  2. Eric Merriman 2011-09-09

    I ran through the steps and when it failed, I grabbed the folder. I then cleaned and tried again without launching simulator first. I ran a diff on the folders and it looks like there are some differences that might be a factor. See attached txt file.
  3. Thomas Huelbert 2011-09-12

    was - Android: tag does not let application launch on Android device, rewritten to describe behavior
  4. Bill Dawson 2011-10-04

    While I'm working on this, i just want to be sure everybody knows the workaround is to do Project -> Clean from inside Studio before building for device. If you're not using Studio, you can "touch" the tiapp.xml file to get it to work.
  5. Bill Dawson 2011-10-04

    Pull request: https://github.com/appcelerator/titanium_mobile/pull/525
  6. Natalie Huynh 2011-10-07

    Tested with Titanium Studio, build: 1.0.5.201109301412 using: 1.8.0.v20111007112617 with Nexus S 2.3.6 Hero 2.1
  7. Don Thorp 2011-11-05

    Standardizing summary and labels.
  8. Natalie Huynh 2011-12-20

    As of 1.8.0.1.v20111219180133 we are not seeing this issue on rhino/v8 on win 7 and 10.6.8
  9. Marshall Culpepper 2011-12-28

    Marking as resolved per Natalie's comment
  10. Michael Pettiford 2012-01-10

    Closing issue Tested with Ti Studio 1.0.8.201201091758 Ti Mob SDK 1.8.0.1 OSX Lion Droid 3, emulator 2.2 v8 and rhino Expected behavior is shown
  11. Dustin Hyde 2012-01-10

    Added Label: qe-testadded.

JSON Source