How do i use Android Studio?

Previous topic - Next topic

caffeinekid

Sorry to be a pain yet again, but sound is working now (yay) and I got a debug build working on my phone with sound (yay) but as soon as I sign the APK it stops working (boo!) and all I get is a black screen for a second and then the app closes down again... :(

I'm pulling my hair out as I thought it was all working great and uploaded an update to google and didn't realise there was a problem until I started getting one star reviews saying the game no longer works at all..

Why does debug work but not a signed apk? It is signing and installing with no errors... but then blackscreen and force close. :(

Thanks guys. (help me obi-wan, you are my only hope...)

Quote2020-09-19 16:33:54.984 1239-1384/? E/InputDispatcher: channel 'eff7c1d com.tcksoft.blitz/org.libsdl.app.SDLGlbasic (server)' ~ Channel is unrecoverably broken and will be disposed!


spacefractal

#16
Do not optimize the app to save space (dont do the bundle, sign it as APK). Google might want you to do that, but they do still accept it. This can cause the app to fails to run.

Also do not update the grandle version to a newer version, when you get asked by that either. Howover if you did that, its easy to revert throught.

Also if you have installed a debug version on it, uninstall it first. you cant have a signed and a debug version on same device.

Also do you have a full log and do you use the steam beta (which is a bit newer version than the official)?

Also if you have a long loading time that is over 5 secs, this might cause to crash, if you dont update the screen either (SHOWSCREEN).
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation - The beagle Jam - Cave Heroes 2023 - https://spacefractal.itch.io/

MrPlow

Yes- dont use the protection, obsfucation or any of that...
Comp:
Speccy-48k, Speccy-128k, Amigas, PCs

caffeinekid

I haven't optimised or used any fancy options. Just wanted to get it working - at all.

I didn't update gradle...

I put in some screen flashing code on the media loading so I can see if it did at least that and it was loading the media before crashing.

Funnily though I've just got the signed apk working on my phone but under strange circumstances. It doesn't work, but then if I clean the cache it will run.

Anyone have any idea what that's all about? Why does a new install have a cache with it and why does the game not run until it's cleared? :/

I think I'm really out of my depth and ought to give up on coding, especially for mobile. Things have changed a lot over the last half dozen years and it's just got more confusing to me.

MrPlow

#19
check your files in media folder if the filename is not correct case or has special chars or is missing - that can also crash the apk


[ EDIT - Also check your android manifest.xml to make sure the correct format is used ]

Also make sure minimum is set to android 6.0 (otherwise crash-time!!)

post your setup details here too from Android Studio AVD:

SDK version, Build-Tools version, etc. as that might flag something...
Comp:
Speccy-48k, Speccy-128k, Amigas, PCs

spacefractal

#20
that because glbasic does not have access to the files on the apk directly and needs to been extractly to the internal memory first. This is unlike Windows version, which have direct access to the file. This is nothing im can do. You can eventuelt try to do a DOESFILEEXIST() to see that does a different. This also force the file to been extracted before loading. But again, this should not been required anymore.

So Im have aboslute no idea without a example you need to give and also a logcat, so im have a change to see why its fails loading. Its property a memory issue somehow. But im need the logcat of a example, before im can help.

Also you should uses PLATFORMINFO$("APPDATA") on Android and not PLATFORMINFO$("DOCUMENT") which normally used on Windows. This is a little issue, but im choose not to fix it to avoid combatible issues. But in the later versions its should not matter througt.

Also you should NOT use any graphics commands at all when you resume your app, this will crash the game, etc in the GLB_ON_RESUME() and GLB_ON_PAUSE(). If you do that, its will crash on resume.

Also im have no idea how you uses your loading rutine without a example or a log. So you need to give a example so im can checkout. Im only need a Android Studio project to take a look on, not the glbasic source code.

You can do a DOESFILEEXISTS() command before a read to tryout, even its should do that automatic.

But im want the full logcat, so im can see what happens with the Java part.

Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation - The beagle Jam - Cave Heroes 2023 - https://spacefractal.itch.io/

JohnnyB

where do i set the path to the sdk? glbasic looks unter c:, i have installed it on d:

spacefractal

If you meant Android Studio, its best for its to been installed on the default path. Glbasic can been installed on other drive.

Android Studio uses Open JDK version of Java, so you do not need to install the official Java at all.
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation - The beagle Jam - Cave Heroes 2023 - https://spacefractal.itch.io/