autopilot
Apple Fan
Profile
Posts: 28
Reg: Feb 08, 2013
Hornsby Heights
2,980
02/03/14 02:04 AM (11 years ago)

java.lang.RuntimeException: Unable to start activity on app

Hey Dudes I've been getting some help getting my app going in Android land - Thanks Mark - legend. So I've published and all is cool ... except it doesn't work! The app loads its splash screen and then quits. Any idea what this means? java.lang.RuntimeException: Unable to start activity ComponentInfo{com.hornsbyeagles/com.hornsbyeagles.BT_activity_host}: java.lang.IndexOutOfBoundsException: Invalid index 0, size is 0 at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2295) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2349) at android.app.ActivityThread.access$700(ActivityThread.java:159) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1316) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:137) at android.app.ActivityThread.main(ActivityThread.java:5419) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:525) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1187) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003) at dalvik.system.NativeStart.main(Native Method) Caused by: java.lang.IndexOutOfBoundsException: Invalid index 0, size is 0 at java.util.ArrayList.throwIndexOutOfBoundsException(ArrayList.java:255) at java.util.ArrayList.get(ArrayList.java:308) at com.hornsbyeagles.BT_application.getHomeScreenData(BT_application.java:472) at com.hornsbyeagles.BT_activity_host.setupTabs(BT_activity_host.java:386) at com.hornsbyeagles.BT_activity_host.configureEnvironment(BT_activity_host.java:351) at com.hornsbyeagles.BT_activity_host.onCreate(BT_activity_host.java:128) at android.app.Activity.performCreate(Activity.java:5372) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1104) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2257) ... 11 more
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
02/03/14 02:37 AM (11 years ago)
Hey Dude :) The first thing I see is that 'IndexOutOfBoundsException'. I don't know where you are with respect to programming, but that usually indicates that a value was expected from an array, and no value was there. Which Value? Which Array? I have no real clue. However, if the splash screen comes up, and then the app dies, it's a pretty good bet that the value in question is probably your home screen. Figure out 'which' screen you want to be your home screen, and go to your control panel 'Layout' screen (one of the control panel options) and ensure either your Home Screen is selected (in the case of no tab bar) or that you've populated at least two tabs (in the case of tab bar). Save. And make sure you update your BT_config.txt file in your app if you make any 'major' changes in your app. Remember if you remove a screen, no problem. But if you 'add' a screen after you've downloaded your package, you *may not* have the code for that screen in your project. A good rule of thumb in the early stages is to download *everything* so if you make severe changes in your control panel, your project will be up to the challenge. Let us know what transpires! Cheers! -- Smug
 
autopilot
Apple Fan
Profile
Posts: 28
Reg: Feb 08, 2013
Hornsby Heights
2,980
like
02/03/14 04:35 AM (11 years ago)
Dude :-) As far as where I'm at re programming - zippo! At any rate - re the home screen - it was assigned - I saved it again to make doubly sure - but it was properly assigned. My home screen may well be the problem, though I've had no issues with it in Apple land (It's just a menu with buttons screen - had half a dozen flighttestapp people test things... no worries) Interestingly my beta dudes have had it working on tablets but not phones. Though it still crashes. I have some mp3s as button sounds (which aren't really working anyway - maybe I should just delete them? - I wonder if thats doing it?) Funny also - although I've had a number of people reporting crashes, i've only seen the one crash report in google land... Annnnd I think I'll try and buy a second hand android device tomorrow and do some troubleshooting myself. Enough late night computers for me for now. Scatterbrain were the band that performed "Don't Call Me Dude" - early 90s I reckon? I had fogotten that song till now .. Dude :)
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
02/03/14 09:09 AM (11 years ago)
Couple of things to mention, as I was the one that helped him get it online! * It was tested extensively on my Nexus 7 tablet, and had no issues at all (well, initially it did, but we fixed them) * It was tested extensively on several emulators, and it worked fine there as well * The crash dump indicates something about tabs, but this isn't a tabbed layout, so that's kinda odd Sounds can be problematic on Android, so it would be interesting to remove them and see what happens. We can always add them back later. Mark
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
02/03/14 12:13 PM (11 years ago)
Just sent you a new apk that hopefully fixes the problem. Mark
 
ehwright
Aspiring developer
Profile
Posts: 57
Reg: Feb 21, 2012
Perth
2,370
like
03/06/14 12:42 AM (11 years ago)
Hi, just had a user have one of my apps crash with the same output. I have tested the app on android 4.2.2, but crashed on 4.3. It gives the exact same log output. I do have tabs on my app, but no sounds. Did you find a fix for this? Liz
 
autopilot
Apple Fan
Profile
Posts: 28
Reg: Feb 08, 2013
Hornsby Heights
2,980
like
03/06/14 02:02 PM (11 years ago)
Hey Liz From memory we found a lot of the transition effects between screens didn't work in Android land. We changed them all to default and we were all good.
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
03/06/14 05:57 PM (11 years ago)
Autopilot has a point… transitions mess up my Android app, if I do anything 'special'. To me, 'special' meant any other transition but the default. Cheers! -- Smug
 
ehwright
Aspiring developer
Profile
Posts: 57
Reg: Feb 21, 2012
Perth
2,370
like
03/07/14 01:46 AM (11 years ago)
Hi again, been spending the day trying to debug this baby, even went and bought a phone which we knew was getting this error. Finally with the help of the logcat I found that it was the size of the background image. Not the file size, the dimensions. Not all android phones, only the Samsung Galaxy S4, the big one, not the mini. So anyway, I reduced the size of the background image to 75% and the problem disappears. Another quirky Android moment to keep us on our toes…...
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
03/07/14 07:12 AM (11 years ago)
Great sleuthing, @ehwright! What dimension did you end up using? That could be a template for the rest of us to follow, as we've been seeing tons of issues with Samsung devices lately. Mark
 
ehwright
Aspiring developer
Profile
Posts: 57
Reg: Feb 21, 2012
Perth
2,370
like
03/08/14 02:09 AM (11 years ago)
Hi, ended up with 768 * 1024. Samsung devices are a challenge, I just found out that the Galaxy 5 will be out soon. No doubt some more headaches there!
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.