Can anybody help with an Android stack trace or two?

You must Login before you can answer or comment on any questions.

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=180
And 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 #0x7f020013
The 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 =)...

— answered 1 year ago by Ken Crucillo
answer permalink
3 Comments
  • Hi Ken, thanks for the info - however I've got all windows locked to Portrait like this, explicitly after creation for the sake of Android.

    recipeWin.orientationModes = [Titanium.UI.PORTRAIT];
    prizeDrawWin.orientationModes = [Titanium.UI.PORTRAIT];
    toolsWin.orientationModes = [Titanium.UI.PORTRAIT];
    listWin.orientationModes = [Titanium.UI.PORTRAIT];
    It just seems to be a haphazard bug and hard to track down, the reason I'm saying it could be to do with orientation is that the only thing I can think that I did to cause the crash was to turn the device around...

    — commented 1 year ago by Chris Leyton

  • i guess there is Titanium.UI.UPSIDE_PORTRAIT?? add it too.. maybe it will fix it..

    recipeWin.orientationModes = [Titanium.UI.PORTRAIT,Titanium.UI.UPSIDE_PORTRAIT];
    prizeDrawWin.orientationModes = [Titanium.UI.PORTRAIT,Titanium.UI.UPSIDE_PORTRAIT];
    toolsWin.orientationModes = [Titanium.UI.PORTRAIT,Titanium.UI.UPSIDE_PORTRAIT];
    listWin.orientationModes = [Titanium.UI.PORTRAIT,Titanium.UI.UPSIDE_PORTRAIT];

    — commented 1 year ago by Ken Crucillo

  • also.. can u add your codes in pastie.. so others can take a look... maybe you miss something out.. who knows =)..

    — commented 1 year ago by Ken Crucillo

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.

— answered 1 year ago by Keith Gable
answer permalink
2 Comments
  • Hi Keith, thanks for your answer. I think my problem probably lies in the Android Manifest, I have created the following lines in my TiApp.xml file, but really this was stumbling blindly from somebody else suggestion:

    <application>
                    <activity android:configChanges="keyboardHidden"
                        android:name="com.lidl.lidlmagic" android:screenOrientation="portrait"/>
                    <activity android:configChanges="keyboardHidden"
                        android:name="ti.modules.titanium.ui.TiTabActivity" android:screenOrientation="portrait"/>
                    <activity
                        android:configChanges="keyboardHidden|orientation"
                        android:name="org.appcelerator.titanium.TiActivity" android:screenOrientation="portrait"/>
                </application>
    I'm not sure whether anything else is needed there or even if I've got that correct.

    — commented 1 year ago by Chris Leyton

  • Your configChanges needs to be keyboardHidden|orientation.

    This is what I ended up with, which works:

    <android xmlns:android="http://schemas.android.com/apk/res/android">
        <manifest>
            <application>
                <activity
                    android:configChanges="keyboardHidden|orientation"
                    android:name="org.appcelerator.titanium.TiActivity" android:screenOrientation="portrait"/>
                <activity
                    android:configChanges="keyboardHidden|orientation"
                    android:label="AppName"
                    android:name=".AppNameActivity"
                    android:screenOrientation="portrait" android:theme="@style/Theme.Titanium">
                    <intent-filter>
                        <action android:name="android.intent.action.MAIN"/>
                        <category android:name="android.intent.category.LAUNCHER"/>
                    </intent-filter>
                </activity>
                <activity
                    android:configChanges="keyboardHidden|orientation"
                    android:launchMode="singleTask"
                    android:name="ti.modules.titanium.map.TiMapActivity" android:screenOrientation="portrait"/>
                <activity
                    android:configChanges="keyboardHidden|orientation"
                    android:name="org.appcelerator.titanium.TiTranslucentActivity"
                    android:screenOrientation="portrait" android:theme="@android:style/Theme.Translucent"/>
                <activity
                    android:configChanges="keyboardHidden|orientation"
                    android:name="org.appcelerator.titanium.TiModalActivity"
                    android:screenOrientation="portrait" android:theme="@android:style/Theme.Translucent"/>
                <activity
                    android:configChanges="keyboardHidden|orientation"
                    android:name="ti.modules.titanium.ui.TiTabActivity" android:screenOrientation="portrait"/>
                <activity
                    android:name="ti.modules.titanium.ui.android.TiPreferencesActivity" android:screenOrientation="portrait"/>
            </application>
        </manifest>
    </android>

    — commented 1 year ago by Keith Gable

Your Answer

Think you can help? Login to answer this question!