BASIC

Author Topic: Android 6 Crashing  (Read 1758 times)

Offline MrPlow

  • Prof. Inline
  • *****
  • Posts: 1177
    • View Profile
Android 6 Crashing
« on: 2017-Jun-23 »
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?


« Last Edit: 2017-Jun-23 by MrPlow »
Comp:
Speccy-48k, Speccy-128k, Amigas, PCs

Offline MrPlow

  • Prof. Inline
  • *****
  • Posts: 1177
    • View Profile
Re: Android 6
« Reply #1 on: 2017-Jun-23 »
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");
« Last Edit: 2017-Jun-23 by MrPlow »
Comp:
Speccy-48k, Speccy-128k, Amigas, PCs

Offline spacefractal

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 3326
    • View Profile
    • Space Fractal
Re: Android 6 Crashing
« Reply #2 on: 2017-Jul-09 »
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).
Greedy Mouse - Karma Miwa - Spot Race - CatchOut - Android Extras - is on a vacation trip, home before end of few days in jan.

Offline MrPlow

  • Prof. Inline
  • *****
  • Posts: 1177
    • View Profile
Re: Android 6 Crashing
« Reply #3 on: 2017-Aug-24 »
Anyone know if the mikmod library can be located to make sure it exists :)
Comp:
Speccy-48k, Speccy-128k, Amigas, PCs

Offline spacefractal

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 3326
    • View Profile
    • Space Fractal
Re: Android 6 Crashing
« Reply #4 on: 2017-Aug-25 »
Try to remove it line if you not using mods. Not sure why they crash. Could been a conflict.
Greedy Mouse - Karma Miwa - Spot Race - CatchOut - Android Extras - is on a vacation trip, home before end of few days in jan.

Offline MrPlow

  • Prof. Inline
  • *****
  • Posts: 1177
    • View Profile
Re: Android 6 Crashing
« Reply #5 on: 2017-Aug-26 »
Hi SF

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

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

Offline spacefractal

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 3326
    • View Profile
    • Space Fractal
Re: Android 6 Crashing
« Reply #6 on: 2017-Aug-26 »
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.
Greedy Mouse - Karma Miwa - Spot Race - CatchOut - Android Extras - is on a vacation trip, home before end of few days in jan.

Offline MrPlow

  • Prof. Inline
  • *****
  • Posts: 1177
    • View Profile
Re: Android 6 Crashing
« Reply #7 on: 2017-Aug-27 »
Is Doesfileexist the same in v12 as in v14 or are they different?
Comp:
Speccy-48k, Speccy-128k, Amigas, PCs

Offline spacefractal

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 3326
    • View Profile
    • Space Fractal
Re: Android 6 Crashing
« Reply #8 on: 2017-Aug-27 »
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.....
Greedy Mouse - Karma Miwa - Spot Race - CatchOut - Android Extras - is on a vacation trip, home before end of few days in jan.

Offline MrPlow

  • Prof. Inline
  • *****
  • Posts: 1177
    • View Profile
Re: Android 6 Crashing
« Reply #9 on: 2017-Aug-27 »
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
« Last Edit: 2017-Aug-27 by MrPlow »
Comp:
Speccy-48k, Speccy-128k, Amigas, PCs

Offline spacefractal

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 3326
    • View Profile
    • Space Fractal
Re: Android 6 Crashing
« Reply #10 on: 2017-Aug-28 »
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.......
Greedy Mouse - Karma Miwa - Spot Race - CatchOut - Android Extras - is on a vacation trip, home before end of few days in jan.

Offline MrPlow

  • Prof. Inline
  • *****
  • Posts: 1177
    • View Profile
Re: Android 6 Crashing
« Reply #11 on: 2017-Aug-28 »
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

Offline spacefractal

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 3326
    • View Profile
    • Space Fractal
Re: Android 6 Crashing
« Reply #12 on: 2017-Aug-28 »
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.
Greedy Mouse - Karma Miwa - Spot Race - CatchOut - Android Extras - is on a vacation trip, home before end of few days in jan.

Offline MrPlow

  • Prof. Inline
  • *****
  • Posts: 1177
    • View Profile
Re: Android 6 Crashing
« Reply #13 on: 2017-Aug-29 »
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

Offline spacefractal

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 3326
    • View Profile
    • Space Fractal
Re: Android 6 Crashing
« Reply #14 on: 2017-Aug-29 »
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.
Greedy Mouse - Karma Miwa - Spot Race - CatchOut - Android Extras - is on a vacation trip, home before end of few days in jan.