So I've been able to replicate soem crash reports I'm receiving, but it's not particularly helping to solve the problem.
Essentially as you'll see from the following stack traces I occasionally get a crash, but as you'll see some times the associated image is fine others time it causes a crash:
This is the stack trace working fine:
D/WindowProxy( 2252): (main) [4,133882] handleOpen E/TiContext( 2252): (main) [1,133883] BaseURL for context is app:// I/ActivityManager( 125): Starting activity: Intent { cmp=com.lidl.lidlmagic/org.appcelerator.titanium.TiActivity (has extras) } from pid 2252 D/TiBaseActivity( 2252): (main) [29,133912] Activity org.appcelerator.titanium.TiActivity@40947938 onPause D/SensorService( 125): enable: BMA150 3-axis Accelerometer D/SensorService( 125): SensorDevice::activate: handle = 0x0, enabled = 0x1 D/Sensors ( 125): [AkmSensor::enable] mEnabled = 0x1 D/SensorService( 125): pid=125, uid=1000 I/SurfaceFlinger( 125): SurfaceFlinger::setOrientation D/AK8975 ( 79): Compass Start I/WindowManager( 125): Setting rotation to 1, animFlags=1 D/PowerManagerService( 125): button light setOrientation:1 I/ActivityManager( 125): Config changed: { scale=1.0 imsi=234/10 loc=en_GB touch=3 keys=1/1/2 nav=1/1 orien=2 layout=18 uiMode=17 seq=24 skin=com.htc.skin.Slate} I/SurfaceFlinger( 125): SurfaceFlinger::setOrientation I/WindowManager( 125): Setting rotation to 0, animFlags=0 D/PowerManagerService( 125): button light setOrientation:0 I/ActivityManager( 125): Config changed: { scale=1.0 imsi=234/10 loc=en_GB touch=3 keys=1/1/2 nav=1/1 orien=1 layout=18 uiMode=17 seq=25 skin=com.htc.skin.Slate} E/NotificationService( 125): adbEnabled = false D/lights ( 125): [LedInfo] write attr ok name=/sys/class/leds/amber/brightness string=1,len=1 D/lights ( 125): [LedInfo] write attr ok name=/sys/class/leds/amber/blink string=0,len=1 D/lights ( 125): [LedInfo] write attr ok name=/sys/class/leds/amber/off_timer string=0 0,len=3 D/lights ( 125): [LedInfo] write attr ok name=/sys/class/leds/green/brightness string=0,len=1 V/NotificationService( 125): Charging... D/lights ( 125): [LedInfo] write attr ok name=/sys/class/leds/green/blink string=0,len=1 D/lights ( 125): [LedInfo] write attr ok name=/sys/class/leds/green/off_timer string=0 0,len=3 E/NotificationService( 125): adbEnabled = true D/NotificationService( 125): cancelNotification, ACTION_NOTIFICATION_REMOVE,pkg=android,id=17040240 D/TiBaseActivity( 2252): (main) [211,134123] Activity org.appcelerator.titanium.TiActivity@40a22fe8 onCreate D/KrollProxy( 2252): (main) [16,134139] New: ActivityProxy D/KrollProxy( 2252): (main) [8,134147] New: IntentProxy D/dalvikvm( 209): GC_CONCURRENT freed 434K, 47% free 3367K/6279K, external 0K/0K, paused 4ms+9ms D/TiBaseActivity( 2252): (main) [117,134264] Activity org.appcelerator.titanium.TiActivity@40a22fe8 onStart D/StatusBarService( 188): addNotification notification = StatusBarNotification(package=android id=17040240 tag=null notification=Notification(vibrate=null,sound=null,defaults=0x0,flags=0x2)), key = android.os.BinderProxy@405b2158, fullScreenIntent = null, contentIntent = PendingIntent{405e26c8: android.os.BinderProxy@405be320} D/TiBaseActivity( 2252): (main) [3,134267] Activity org.appcelerator.titanium.TiActivity@40a22fe8 onResume D/TiUIWindow( 2252): (main) [56,134323] Received Activity creation message I/ActivityManager( 125): Displayed com.lidl.lidlmagic/org.appcelerator.titanium.TiActivity: +422ms D/TiViewProxy( 2252): (main) [24,134347] getView: ViewProxy D/TiViewProxy( 2252): (main) [2,134349] getView: LabelProxy D/TiUILabel( 2252): (main) [1,134350] Creating a text label W/TiUIHelper( 2252): (main) [3,134353] Unsupported font: 'Droid Mono' supported fonts are 'monospace', 'serif', 'sans-serif'. W/TiUIHelper( 2252): (main) [4,134357] No alignment set - old vert align was: 16 D/TiViewProxy( 2252): (main) [2,134359] getView: ViewProxy D/TiViewProxy( 2252): (main) [6,134365] getView: ScrollViewProxy W/TiUIScrollView( 2252): (main) [3,134368] Both scroll bars cannot be shown. Defaulting to vertical shown W/TiUIScrollView( 2252): (main) [2,134370] Scroll direction could not be determined based on the provided view properties. Default VERTICAL scroll direction being used. Use the 'scrollType' property to explicitly set the scrolling direction. D/TiUIScrollView( 2252): (main) [2,134372] creating vertical scroll view D/TiViewProxy( 2252): (main) [66,134438] getView: ViewProxy D/TiViewProxy( 2252): (main) [7,134445] getView: ImageViewProxy D/TiUIImageView( 2252): (main) [0,134445] Creating an ImageView D/TiFileFactory( 2252): (main) [89,134534] getting initial from parts: app://images/recipe/recipe1Header.png D/TiDrawableReference( 2252): (main) [79,134613] Bitmap sampling results: inSampleSize=1; srcWidth=320; srcHeight=180; finalWidth=320; finalHeight=180And here it is with a crash:
D/WindowProxy( 2197): (main) [1,78622] handleOpen E/TiContext( 2197): (main) [1,78623] BaseURL for context is app:// I/ActivityManager( 125): Starting activity: Intent { cmp=com.lidl.lidlmagic/org.appcelerator.titanium.TiActivity (has extras) } from pid 2197 D/TiBaseActivity( 2197): (main) [29,78652] Activity org.appcelerator.titanium.TiActivity@40673508 onPause D/SensorService( 125): enable: BMA150 3-axis Accelerometer D/SensorService( 125): SensorDevice::activate: handle = 0x0, enabled = 0x1 D/Sensors ( 125): [AkmSensor::enable] mEnabled = 0x1 D/SensorService( 125): pid=125, uid=1000 D/AK8975 ( 79): Compass Start I/wpa_supplicant( 292): Reset vh_switch_counter due to receive LINKSPEED cmd D/ConnectivityService( 125): getMobileDataEnabled returning true D/TiBaseActivity( 2197): (main) [63,78715] Activity org.appcelerator.titanium.TiActivity@4098e968 onCreate I/SurfaceFlinger( 125): SurfaceFlinger::setOrientation I/WindowManager( 125): Setting rotation to 1, animFlags=0 D/PowerManagerService( 125): button light setOrientation:1 D/KrollProxy( 2197): (main) [3,78718] New: ActivityProxy D/KrollProxy( 2197): (main) [1,78719] New: IntentProxy I/ActivityManager( 125): Config changed: { scale=1.0 imsi=234/10 loc=en_GB touch=3 keys=1/1/2 nav=1/1 orien=2 layout=18 uiMode=17 seq=22 skin=com.htc.skin.Slate} E/NotificationService( 125): adbEnabled = false D/lights ( 125): [LedInfo] write attr ok name=/sys/class/leds/amber/brightness string=1,len=1 D/lights ( 125): [LedInfo] write attr ok name=/sys/class/leds/amber/blink string=0,len=1 D/lights ( 125): [LedInfo] write attr ok name=/sys/class/leds/amber/off_timer string=0 0,len=3 D/lights ( 125): [LedInfo] write attr ok name=/sys/class/leds/green/brightness string=0,len=1 D/lights ( 125): [LedInfo] write attr ok name=/sys/class/leds/green/blink string=0,len=1 V/NotificationService( 125): Charging... D/lights ( 125): [LedInfo] write attr ok name=/sys/class/leds/green/off_timer string=0 0,len=3 E/NotificationService( 125): adbEnabled = true D/NotificationService( 125): cancelNotification, ACTION_NOTIFICATION_REMOVE,pkg=android,id=17040240 D/TiBaseActivity( 2197): (main) [71,78790] Activity org.appcelerator.titanium.TiActivity@4098e968 onStart D/TiBaseActivity( 2197): (main) [3,78793] Activity org.appcelerator.titanium.TiActivity@4098e968 onResume D/TiUIWindow( 2197): (main) [9,78802] Received Activity creation message D/StatusBarService( 188): addNotification notification = StatusBarNotification(package=android id=17040240 tag=null notification=Notification(vibrate=null,sound=null,defaults=0x0,flags=0x2)), key = android.os.BinderProxy@405df2b0, fullScreenIntent = null, contentIntent = PendingIntent{405df410: android.os.BinderProxy@405be320} D/TiViewProxy( 2197): (main) [55,78857] getView: ViewProxy D/TiViewProxy( 2197): (main) [4,78861] getView: LabelProxy D/TiUILabel( 2197): (main) [5,78866] Creating a text label W/TiUIHelper( 2197): (main) [4,78870] Unsupported font: 'Droid Mono' supported fonts are 'monospace', 'serif', 'sans-serif'. W/TiUIHelper( 2197): (main) [1,78871] No alignment set - old vert align was: 16 D/TiViewProxy( 2197): (main) [1,78872] getView: ViewProxy D/TiViewProxy( 2197): (main) [16,78888] getView: ScrollViewProxy W/TiUIScrollView( 2197): (main) [3,78891] Both scroll bars cannot be shown. Defaulting to vertical shown W/TiUIScrollView( 2197): (main) [1,78892] Scroll direction could not be determined based on the provided view properties. Default VERTICAL scroll direction being used. Use the 'scrollType' property to explicitly set the scrolling direction. D/TiUIScrollView( 2197): (main) [0,78892] creating vertical scroll view D/TiViewProxy( 2197): (main) [42,78934] getView: ViewProxy D/TiViewProxy( 2197): (main) [3,78937] getView: ImageViewProxy D/TiUIImageView( 2197): (main) [0,78937] Creating an ImageView D/TiFileFactory( 2197): (main) [37,78974] getting initial from parts: app://images/recipe/recipe1Header.png W/ResourceType( 2197): Failure getting entry for 0x7f020013 (t=1 e=19) in package 0 (error -75) E/TiDrawableReference( 2197): (main) [3,78977] Drawable resource could not be opened. Are you sure you have the resource for the current device configuration (orientation, screen size, etc.)? D/AndroidRuntime( 2197): Shutting down VM W/dalvikvm( 2197): threadid=1: thread exiting with uncaught exception (group=0x400205a0) E/TiUncaughtHandler( 2197): (main) [2,78979] Sending event: exception on thread: main msg:android.content.res.Resources$NotFoundException: Resource ID #0x7f020013; Titanium 1.8.0,2011/09/30 16:42,58a2236 E/TiUncaughtHandler( 2197): android.content.res.Resources$NotFoundException: Resource ID #0x7f020013The app is designed to work in portrait only, so my line of thinking is that perhaps a slight change in orientation is causing a problem and it's looking for that image in the landscape resource folder.
Any help on this would be hugely appreciated...
2 Answers
hi =)...
you can lock the screen to PORTRAIT only by setting it to PORTRAIT only... In my case i use..
var win = Ti.UI.createWindow( { backgroundColor: 'gray', fullscreen: true, navBarHidden: false, opacity : 0.50, id : "login" }); win.orientationModes = [Ti.UI.PORTRAIT]; win.open();I hope this will help you... CodeStrong =)...
You have to specify the window's orientationModes in the constructor as well as after the window is created, and it must be an array. You also must not remove orientation from the list of config changes in the Android manifest. And all of your windows must have the orientationModes set.
Also, have you tried Project > Clean and/or removing the "build" folder? Sometimes, the resources aren't rebuilt like you'd expect.
Your Answer
Think you can help? Login to answer this question!