Main forum > Bug Reports

SHOEBOX does not work on ANDROID

(1/3) > >>

adaz:
Hi,

My simple code works on Win32:

--- Code: GLBasic ---SETCURRENTDIR("Media") // go to media files

SETSHOEBOX "1.sbx",""

LOADANIM "kockak.png",1,45,45

DRAWANIM 1,1,50,50

SHOWSCREEN
MOUSEWAIT

But LOADANIM command crashes on Android:


--- Quote ---I/glbasic ( 9200): Extracting asset file:
F/libc    ( 9200): Fatal signal 11 (SIGSEGV) at 0x7fffffff (code=1), thread 9222 (SDLThread)
I/DEBUG   ( 1522): pid: 9200, tid: 9222, pkg name: com.company.title
I/DEBUG   ( 1522): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
I/DEBUG   ( 1522): Build fingerprint: 'motorola/ghost_retasia/ghost:4.4.2/KOT49H/G900FXXU1ANCE:user/release-keys'
I/DEBUG   ( 1522): Revision: '0'
I/DEBUG   ( 1522): pid: 9200, tid: 9222, name: SDLThread  >>> com.company.title <<<
I/DEBUG   ( 1522): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 7fffffff
W/NativeCrashListener( 1698): Couldn't find ProcessRecord for pid 1885955130
I/DEBUG   ( 1522):     eax 7fffffff  ebx 18083260  ecx 00000001  edx 8956bd4f
I/DEBUG   ( 1522): AM write failure (32 / Broken pipe)
I/DEBUG   ( 1522):     esi 1a215030  edi 00000000
I/DEBUG   ( 1522):     xcs 00000073  xds 0000007b  xes 0000007b  xfs 00000043  xss 0000007b
I/DEBUG   ( 1522):     eip 8a47ab72  ebp 1a215000  esp 8966c744  flags 00210287
I/DEBUG   ( 1522):
I/DEBUG   ( 1522): backtrace:
I/DEBUG   ( 1522):     #00  pc 00076b72  /system/lib/lib3btrans.so (memcpy+3730)
I/DEBUG   ( 1522):
I/DEBUG   ( 1522): stack:
I/DEBUG   ( 1522):          8966c704  8a791a58
I/DEBUG   ( 1522):          8966c708  0000001c
I/DEBUG   ( 1522):          8966c70c  8966c71c  [stack:9222]
I/DEBUG   ( 1522):          8966c710  8a4b2fdd  /system/lib/lib3btrans.so
I/DEBUG   ( 1522):          8966c714  00000000
I/DEBUG   ( 1522):          8966c718  b76aa370  /system/lib/libc.so (free+32)
I/DEBUG   ( 1522):          8966c71c  8966c74c  [stack:9222]
I/DEBUG   ( 1522):          8966c720  8a58860c  /system/lib/lib3btrans.so
I/DEBUG   ( 1522):          8966c724  1453f924  /system/lib/arm/libc.so (strtol+544)
I/DEBUG   ( 1522):          8966c728  00000000
I/DEBUG   ( 1522):          8966c72c  1a215030  [stack:9212]
I/DEBUG   ( 1522):          8966c730  b76aa356  /system/lib/libc.so (free+6)
I/DEBUG   ( 1522):          8966c734  00000000
I/DEBUG   ( 1522):          8966c738  180163c6
I/DEBUG   ( 1522):          8966c73c  8a592706  /system/lib/lib3btrans.so
I/DEBUG   ( 1522):          8966c740  8a585227  /system/lib/lib3btrans.so
I/DEBUG   ( 1522):     #00  8966c744  1a215030  [stack:9212]
I/DEBUG   ( 1522):          8966c748  00000000
I/DEBUG   ( 1522):          8966c74c  18083260
I/DEBUG   ( 1522):          8966c750  18083291
I/DEBUG   ( 1522):          8966c754  8956bd4f
I/DEBUG   ( 1522):          8966c758  7fffffff
I/DEBUG   ( 1522):          8966c75c  00000001
I/DEBUG   ( 1522):          8966c760  8966c770  [stack:9222]
I/DEBUG   ( 1522):          8966c764  00000000
I/DEBUG   ( 1522):          8966c768  00000000
I/DEBUG   ( 1522):          8966c76c  00000000
I/DEBUG   ( 1522):          8966c770  8966c798  [stack:9222]
I/DEBUG   ( 1522):          8966c774  8966c760  [stack:9222]
I/DEBUG   ( 1522):          8966c778  8a5926dd  /system/lib/lib3btrans.so
I/DEBUG   ( 1522):          8966c77c  8966c988  [stack:9222]
I/DEBUG   ( 1522):          8966c780  00000000
I/DEBUG   ( 1522):
I/DEBUG   ( 1522): memory map around fault addr 7fffffff:
I/DEBUG   ( 1522):     1c260000-1c263000 rwx
I/DEBUG   ( 1522):     (no map for address)
I/DEBUG   ( 1522):     88a67000-88a89000 rwx
D
--- End quote ---

I attached the shoebox file, please rename it to .sbx!

I've already tried it with other images, png's, bmp's, jpg's, etc... Tried on real phones and on Bluestacks as well.
It is very important to me, because I'm now porting my iOS game to Android, and it uses a lot of shoeboxed data. It worked on iOS.

Thank you,
Adaz

GLBasic 15.089, latest AE, api-22

spacefractal:
This is due file copy issue on Android. ALL files from the APK files require to been copy to the internal memory, before its can been used.

What you can try to do is do a DOESFILEEXISTS() before any file checking. That command make sure the file got extracted from the APK file to internal memory before uses.

Also a file copy from Android APK to internal is required for ALL files when used on Android. This is just a bit crappy design, but nothing im can do. So Shoebox can been fiffly on Android. Sorry about it.

So this is a issue im will not fix.

adaz:
Thanks spacefractal. The file exists, I already used DOESFILEEXISTS(), but LOADSPRITE still cannot access the sbx, or even doesn't try to access it, I don't know. All my levelpacks and graphics are based on this, so I'm very despondent if it really won't work on Android :-(

By the way, here is the _logview.bat's result when LOADSPRITE failed to load from the sbx:


--- Quote ---02-19 15:31:48.309  5757  5757 F DEBUG   : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
02-19 15:31:48.310  5757  5757 F DEBUG   : Build fingerprint: 'HUAWEI/VTR-L29/HWVTR:7.0/HUAWEIVTR-L29/C432B151:user/release-keys'
02-19 15:31:48.310  5757  5757 F DEBUG   : Revision: '0'
02-19 15:31:48.310  5757  5757 F DEBUG   : ABI: 'arm'
02-19 15:31:48.310  5757  5757 F DEBUG   : pid: 5688, tid: 5728, name: SDLThread  >>> com.adaz.antirock <<<
02-19 15:31:48.310  5757  5757 F DEBUG   : signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x7fffffff
02-19 15:31:48.310  5757  5757 F DEBUG   :     r0 ce17ea1f  r1 7fffffff  r2 80000000  r3 00000000
02-19 15:31:48.310  5757  5757 F DEBUG   :     r4 ce17ea54  r5 008000ff  r6 00000001  r7 00000000
02-19 15:31:48.310  5757  5757 F DEBUG   :     r8 00040a74  r9 00000000  sl 7fffffff  fp ce17ecfc
02-19 15:31:48.310  5757  5757 F DEBUG   :     ip 20000000  sp ce17e1b0  lr e51042e0  pc ee9c15cc  cpsr 80030010
02-19 15:31:48.311  5757  5757 F DEBUG   :
02-19 15:31:48.311  5757  5757 F DEBUG   : backtrace:
02-19 15:31:48.311  5757  5757 F DEBUG   :     #00 pc 000175cc  /system/lib/libc.so (memcpy+196)
02-19 15:31:48.311  5757  5757 F DEBUG   :     #01 pc 0009f2dc  /data/app/com.adaz.antirock-1/lib/arm/libmain.so (_ZN12OPENGL_IMAGE12LoadImageBMPEPKcm+340)

--- End quote ---

spacefractal:
filesystem on Android is crap...... on IOS, you have direct file access to the files, that is not on on the case with the Android.

Im recommend you to use folder based files instead to access your file and perform a function to that.

Currectly its a issue that wont been fixed in near feature, and its a hell on Android really.

This is why im newer used them. its really dont give any mean at all on Android, since you dont have direct access and require some "hacking" to that.

The media files is also copied to the main document folde ron Android before access. Howover the file might get deleted before its try access. im can take a look here, because the deleting should not do that on shoebox files really, but stay it. here the deleting of tiles happens in the Java file too. "EDIT". Just checked, its should not do that really. So its can been a bug, but its much more compliced here. Android is here very strange.

spacefractal:
btw you can try to do those two things:


--- Code: GLBasic ---        ?IFDEF ANDROID
                IF DOESDIREXIST("Media")=0 THEN CREATEDIR("Media")
                IF DOESDIREXIST("Media/levels")=0 THEN CREATEDIR("Media/levels")
                IF DOESDIREXIST("Media/levels/paid")=0 THEN CREATEDIR("Media/levels/paid")
                IF DOESDIREXIST("Media/levels/maze")=0 THEN CREATEDIR("Media/levels/maze")
                IF DOESDIREXIST("Media/music")=0 THEN CREATEDIR("Media/music")
                IF DOESDIREXIST("Media/music/ogg")=0 THEN CREATEDIR("Media/music/ogg")
                IF DOESDIREXIST("Media/music/mp3")=0 THEN CREATEDIR("Media/music/mp3")
        ?ENDIF
 
Please note, showbox is VERY ineffective on Android and is not recommend to use them at all. This due shoebox will use DOUBLE amount of memory, so its might fail on Android. Mostly on devices with low internal memory, which is COMON on older devices. So im will recommend to NOT support Android 4 at all really. Many of those devices have crappy memory management.

The main reason above thigng file access is NOT supported inside APK and is require to extract that to the internal memory first.

DOESFILEEXISTS will copy the file from a APK to the internal, while DOESDIREXISTS will copy the whole folder from that one.

So bear in mind, you can end the game uses TWICE of memory required.

This is why im newer used them at all. Its not effective on Android, nor newer will.


Navigation

[0] Message Index

[#] Next page

Go to full version