Android 6 Crashing

Previous topic - Next topic

MrPlow

recently a lot of my apps have had increases in crashes...Not sure if this a Google update issue for certain models or devices or its down it my version v12 no longer compatible for certain phones??!


On ione app had suddendly 77 issues of this error...previously it occurred 1 time every few days.

java.lang.UnsatisfiedLinkError:
  at java.lang.Runtime.loadLibrary0(Runtime.java:996)
  at java.lang.System.loadLibrary(System.java:1530)
  at org.libsdl.app.SDLActivity.<clinit>(SDLActivity.java:235)
  at java.lang.Class.newInstance(Native Method:0)
  at android.app.Instrumentation.newActivity(Instrumentation.java:1067)
  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2297)
  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2456)
  at android.app.ActivityThread.-wrap11(ActivityThread.java:0)
  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1324)
  at android.os.Handler.dispatchMessage(Handler.java:102)
  at android.os.Looper.loop(Looper.java:148)
  at android.app.ActivityThread.main(ActivityThread.java:5485)
  at java.lang.reflect.Method.invoke(Native Method:0)
  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:828)
  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:718)


Another common error is

backtrace:
  native: pc 000000000033464c  /system/lib/libart.so (_ZN3art22CountStackDepthVisitor10VisitFrameEv+15)
  native: pc 000000000032bddd  /system/lib/libart.so (_ZN3art12StackVisitor9WalkStackEb+204)
  native: pc 000000000033ce69  /system/lib/libart.so (_ZNK3art6Thread24CreateInternalStackTraceILb0EEEP8_jobjectRKNS_33ScopedObjectAccessAlreadyRunnableE+48)
  native: pc 00000000002cba97  /system/lib/libart.so (_ZN3artL32Throwable_nativeFillInStackTraceEP7_JNIEnvP7_jclass+18)
  native: pc 0000000002f7bc0d  /system/framework/arm/boot.oat


Anyone having similar issues?


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

MrPlow

#1
My issue looks to be simular to msx's issues in this post...was this issue resolved?

http://www.glbasic.com/forum/index.php?topic=10771.15

Also my SDLActivity.java file is using a lot of log commands - should these be commented out for the production release?


One error points to line 238 or my SDLactivity file which shown in bold below.

    // Load the .so
    static {
        System.loadLibrary("SDL2");
        // System.loadLibrary("SDL2_image");
        System.loadLibrary("mikmod");
        System.loadLibrary("SDL2_mixer");
        // System.loadLibrary("SDL2_ttf");
        System.loadLibrary("main");
Comp:
Speccy-48k, Speccy-128k, Amigas, PCs

spacefractal

have been away a lots here. do you uses DOESFILEEXIST? Its mightbeen required for Android 6. Im have not checked that since (im have not coded in quite of time now).
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation - The beagle Jam - Cave Heroes 2023 - https://spacefractal.itch.io/

MrPlow

Anyone know if the mikmod library can be located to make sure it exists :)
Comp:
Speccy-48k, Speccy-128k, Amigas, PCs

spacefractal

Try to remove it line if you not using mods. Not sure why they crash. Could been a conflict.
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation - The beagle Jam - Cave Heroes 2023 - https://spacefractal.itch.io/

MrPlow

Hi SF

Should DOESFILEEXIST belong in the check_asset function of AE or before?

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

spacefractal

yes DOESFILEEXIST does same thing today as the old check_asset function. its should have do that automatic, but might fails for sound files, where you should uses it.
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation - The beagle Jam - Cave Heroes 2023 - https://spacefractal.itch.io/

MrPlow

Is Doesfileexist the same in v12 as in v14 or are they different?
Comp:
Speccy-48k, Speccy-128k, Amigas, PCs

spacefractal

It's also make sure it go copied into internal memory. Some crashes could due some low internal memory, but should not been issue today at all. It'd should have called for all file operation, but it's seens it's might fail on some systems for some odd reason. Better include it as safe.

You could done that in a function for image loading.....
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation - The beagle Jam - Cave Heroes 2023 - https://spacefractal.itch.io/

MrPlow

#9
Hi Sf,

You mean like this?
Code (glbasic) Select
  LOCAL ok
        Android.Check_Asset(File$) // copy assest file from APK to Memory
        ok = DOESFILEEXIST(GETCURRENTDIR$()+File$)
         IF ok THEN LOADSOUND GETCURRENTDIR$()+File$, ID,BUF


Something I do not use - cause it deletes my source Media assets is this...

Code (glbasic) Select
FUNCTION Check_AndroidMem: File$
LOCAL Memory=JavaCall$("memory:check")
IF Memory<100
// KILLFILE File$
// KILLFILE GETCURRENTDIR$()+"/"+File$
// KILLFILE GETCURRENTDIR$()+File$
ENDIF
ENDFUNCTION
Comp:
Speccy-48k, Speccy-128k, Amigas, PCs

spacefractal

Checkassest() was removed since I'm got the source code from gernot and I'm implementated it into DOESFILEEXISTS command instead. Don't use full path to that with that command. If it'd still crash, do a CREATEDIR("Media") and eventually sub folders you might use top or your code. This shall have done automatic and I'm should check the glbasic startup code why it's does not do correct. I'm take a look, but this should been a fixable work around by now.

Also don't use setcurrentdir() far than "Media".

This is why I'm don't want to support old android versions.......
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation - The beagle Jam - Cave Heroes 2023 - https://spacefractal.itch.io/

MrPlow

Hi SF

On GLB v12.304 - DOESFILEEXIST seems to work fine with Getcurrentdir command and Media - so far at least -
:)
Gonna see if the crashes decrease...

Still getting Mousecount issue crashing - but could that be screen touches not keeping up with LIMITFPS 50 ?
Anyhow - its a process of elimination - thanks for the tips...
Comp:
Speccy-48k, Speccy-128k, Amigas, PCs

spacefractal

Mousecount is im a aware allways set to 16, but property its should allways returns 4 or such? Its a static number that have been set to that. But for now dont use more inputs than required.

50 fps use a wierd frameskipipng and would not fell like a smooth game for some players, since screens is often updated to 60fps. Im do thinks this is something due virtual screen, which im have newer ever used for speed.

Now im or gernot should checks why that load thing fails, which should have done automatic. Only im can see its its might not have created the internal directories correctly and its tried to copy a media to a folder that did not exists under a startup.
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation - The beagle Jam - Cave Heroes 2023 - https://spacefractal.itch.io/

MrPlow

Another crash that occurs a bit is the null pointer exception

   String ext_storage = getExternalFilesDir(null).toString();
      if (ext_storage==null)
      {   ext_storage = android.os.Environment.getExternalStoragePublicDirectory(android.os.Environment.DIRECTORY_DOWNLOADS).toString();
      }
      
      if (Build.VERSION.SDK_INT>18)
      {   ext_storage = android.os.Environment.getExternalStoragePublicDirectory(android.os.Environment.DIRECTORY_DOCUMENTS).toString();
      }
      
Is there anything I can put into SDL activity to help avoid this crash?
Comp:
Speccy-48k, Speccy-128k, Amigas, PCs

spacefractal

version? and which line?

DIRECTORY_DOWNLOADS did crashed on SOME Android version 4.0 as well. So crazy is Android some times. ext_storage is that internal path the game should copy the media files too.
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation - The beagle Jam - Cave Heroes 2023 - https://spacefractal.itch.io/