Android 6 Crashing

Previous topic - Next topic

spacefractal

#15
which line?

if you also use a older SDK version as well, then im cant help. you need a least API 19 installed as well. The newest SDK the actuelly Android Extras using is API 22.

You might need to change you manifest to a least use that API as well. You should use this in your manifest.xml:

<uses-sdk android:minSdkVersion="10" android:targetSdkVersion="22" />

Recently im tested Greedy Mouse on a Samsung S8, which the game actuelly worked fine (im do not sure its crashed internally once?). Howover wide screen was not supported. Here im make sure we need a higher SDK version and few new lines to the manifest.

Also use PLATFORMINFO$("APPDATA") and not PLATFORMINFO$("DOCUMENTS") for saving data. And if the below fails, then its should now give a empty result:

Code (glbasic) Select

try
{

boolean ReadPermission = (getContext().checkCallingOrSelfPermission("android.permission.READ_EXTERNAL_STORAGE") == PackageManager.PERMISSION_GRANTED);           
boolean WritePermission = (getContext().checkCallingOrSelfPermission("android.permission.WRITE_EXTERNAL_STORAGE") == PackageManager.PERMISSION_GRANTED);
String ext_storage = "";
if (ReadPermission==true && WritePermission==true)
{ if (Build.VERSION.SDK_INT>18)
{ ext_storage = android.os.Environment.getExternalStoragePublicDirectory(android.os.Environment.DIRECTORY_DOCUMENTS).toString();
}
else
{ ext_storage = android.os.Environment.getExternalStoragePublicDirectory(android.os. Environment.DIRECTORY_DOWNLOADS).toString();
}
}
}
catch(Exception e)
{ ext_storage="";
}


But you might not could write with hiscore on some devices.....

Property because its now so far in Android versions im property will set DOCUMENTS to been same as APP_DATA. Android is simply just strange sometimes.
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation - The beagle Jam - Cave Heroes 2023 - https://spacefractal.itch.io/

MrPlow

Thanks SF

I am using 19 SDK at present but my min="9" so I might change to 10.
That might help?
Comp:
Speccy-48k, Speccy-128k, Amigas, PCs

MrPlow

#17
Hi SF

My app crashes with the new try catch code - is it correct?
Spotted error with a gap below - will retry now

Code (glbasic) Select
android.os.      Environment.DIRECTORY_DOWNLOADS

Comp:
Speccy-48k, Speccy-128k, Amigas, PCs

MrPlow

Hi

Still crashing with the new code - is there something I am missing?

I replaced the old code with this.

Comp:
Speccy-48k, Speccy-128k, Amigas, PCs

spacefractal

#19
You should uses api-22, or its might crash on newer platforms. And also im wont reallt want to support mixed version of old and news, which can also cause to crash, if the newest version dosent.

DIRECTORY_DOWNLOADS is very dumb, its might crash on SOME devices, such as Ouya (when they updated it, then its crashed Greedy Mouse out too as im remember), while DIRECTORY_DOCUMENTS is more future proff, but is only exists from API-19 (Android 4.4) and up. But that require you have installed SDK 19 and is present that api in the Android SDK to get working. If you dont have that sdk.... then its will fails and you get a null pointer issue under compiling or code (etc that api present under \android-sdk-windows\platforms, you can have more than one api installed).

Also make sure the SDK using is also present, or you might get a null pointer issue under compiling. Is its Java issue you get from compiling or by runtime? If by compliing, its a too old SDK you using. Here im cant support you. The changes was happens since the issues on Ouya.

Also current target is Android 5.1 (Api-22) for Android Extras. Api 21 was required to get full screen support, which require some code as well. You should still could use Api 22 with a older Android Extras Versions as long you compile against Android 22 api. This to make sure DIRECTORY_DOCUMENTS works as intended.

You should also not use TRY, its was just a blind test.
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation - The beagle Jam - Cave Heroes 2023 - https://spacefractal.itch.io/

MrPlow

Ahh good. Without the try part is code works.

Will it still avoid crashing or less likely?
Comp:
Speccy-48k, Speccy-128k, Amigas, PCs

spacefractal

If you uses 18 or older,  then it's might crash. Currently newest android extras uses 22. I'm shall uses newer version.... Mostly to support widescreen on newer android devices.

Android is sometimes also very strange and annoying.
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation - The beagle Jam - Cave Heroes 2023 - https://spacefractal.itch.io/

spacefractal

#22
Also.... Ads might also crash out glbasic when resumed on some devices. This was why I'm gave up that, removed it and newer got er implemented to newest android again..... If ever? I'm don't have time yet to do that. I'm simply just got uninspired by now when I'm no longer uses android.

What I'm should have done is It's should have use the glbasic loop function really to avoid this kind of issues, example if you try to draw graphics while display a ads or such. Also it's would been more automatically too. But it's did newer happens.

But again I'm simply just not like that android anymore, due all those constantly issues. :-(. Now I know have succes with steam.....
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation - The beagle Jam - Cave Heroes 2023 - https://spacefractal.itch.io/

MrPlow

Hi SF,

I found your Admob implementation very stable and never get an feedback about crashing (when used with pause routine)
I mean that - its been working great!

here is the sdl and manifest.

Comp:
Speccy-48k, Speccy-128k, Amigas, PCs

spacefractal

#24
It's not happens on all devices, but on some devices and some cases and not sure what happens. It's was happens here example due I ads. Soon I'm removed it, then it's worked nicely.

I'm also newer got Karma Miwa back to Google Play again due that and forgot all about it. Only Greedy Mouse. But for me I'm not using Android anymore (currently). Windows is the best platform. I'm also still using ios. Ios has a very great debugger.... Android.... You have none with glbasic and then hard to fix thing. I'm need a debugger some times.

Again I'm should reimplemented using the main loop function and not invoke it manually. Then it's would make sure nothing is draw in meantime.... I'm did few code, but got uninspired.

Property you can try out the newest version of Android extras and then copy back the I ads part back again?
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation - The beagle Jam - Cave Heroes 2023 - https://spacefractal.itch.io/

spacefractal

#25
look like im did not really removed iads, but just dropped it. All code in  SDLActivity.java is still present in the newest Android Extras (but do more checking the service is used or not). So its the glbasic part that need recoded completly..... not the Java part. Its would been untouched.
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation - The beagle Jam - Cave Heroes 2023 - https://spacefractal.itch.io/

spacefractal

#26
also... im also did indeeded fixed a crash issue when Ouya SDK is not used in 3.0.1 back in 2015. The Ouya code is simply just not used when the Ouya shop not used (its could crash if Ouya Shop could not find a key). You used 2.9.

Please note: Im have NOT removed iAds as im throught im did (dur crashed, im just leaved it)! Nor im have changed it. Only you can use more than one ads system and eventuelly the ads system will got removed when not used. So im have just slightly changed it. So you should been SAFE to use the newest version, even with glbasic 12.

Most thing was happens with improvement game controller support with better support to KEY() which was borked totally out. Etc to example get KEY(1) working and more.
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation - The beagle Jam - Cave Heroes 2023 - https://spacefractal.itch.io/

MrPlow

I will definitely think out up-ing my AE version.
I could create side folder for my GLB maybe in case it goes wrong.

Comp:
Speccy-48k, Speccy-128k, Amigas, PCs

spacefractal

but for me its no longer works with v14, due a compile error, but works with v12. Im need to talk with Gernot with that issue. Im have no clue here.
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation - The beagle Jam - Cave Heroes 2023 - https://spacefractal.itch.io/

MrPlow

Just noticed an error I never usually see

native: pc 000000000009463c  /data/app/com.gazzappergames.centiplode.centipedeshooter-1/lib/arm/libmain.so (_ZN14OpenGLRainbows8DrawRectEiiiim+208)
  native: pc 0000000000072390  /data/app/com.gazzappergames.centiplode.centipedeshooter-1/lib/arm/libmain.so (_ZN11__GLBASIC__8DRAWRECTEiiiii+80)

Seems to caused when doing a Drawrect?
Comp:
Speccy-48k, Speccy-128k, Amigas, PCs