Android google-play compat status thread

Make games! Discuss those games here.

Moderators: Bob the Hamster, marionline, SDHawk

User avatar
Bob the Hamster
Lord of the Slimes
Posts: 7658
Joined: Tue Oct 16, 2007 2:34 pm
Location: Hamster Republic (Ontario Enclave)
Contact:

Post by Bob the Hamster »

Okay, as for the fails-to-resume after being backgrounded problem, I am also leaning towards this being a hardware problem with my phone.

This particular phone has trouble with audio, most of the time it doesn't work at all, and I have to hook up bluetooth headphones.

I captured the adb logcat output for a few seconds while backgrounding and then immediately returning to baconthulhu, triggering the black screen.

https://pastebin.com/raw/FPDsN6vG

As you can see, there are a ton of audio device errors in there. I think that resuming the music crashes because of the audio device problem, and so the video resume fails too.

So since this is a hardware problem, I say just forget about it. I can accept that my phone is broken.

The other bug, the one about libsdl-settings.cfg not being written and DeleteFilesOnUpgrade() not being called is still important of course
TMC
Metal King Slime
Posts: 4308
Joined: Sun Apr 10, 2011 9:19 am

Post by TMC »

I tried looking at the log and matching it up with the messages printed from inside Video.java, but I didn't really learn anything. The most that I can suggest is building some simple test game from the latest version commander-genius repo (preferable one that uses audio) and seeing whether it has the same problem or not. But that's just more work.

Would be nice to be able to catch up to the latest upstream version instead of having to cherry-pick stuff.
User avatar
Bob the Hamster
Lord of the Slimes
Posts: 7658
Joined: Tue Oct 16, 2007 2:34 pm
Location: Hamster Republic (Ontario Enclave)
Contact:

Post by Bob the Hamster »

Aha! So I simply installed the Commander Keen port from the play store. It works fine on my good phone, but it freezes after the downloading screen on the trouble phone.

This afternoon, my 4 year old was playing with the trouble phone and somehow got the sound working (possibly by dropping it on the floor)

I quickly tested Baconthulhu, and it worked! I could background and resume with no problem. I also tried Commander Keen again, and this time it worked, also allowing backgrounding and resuming.

That settles it for that bug.

Haven't had time this weekend to look at the other one.

Did make a snowman today though, so it has been a productive day. :)
TMC
Metal King Slime
Posts: 4308
Joined: Sun Apr 10, 2011 9:19 am

Post by TMC »

That is an intriguing method of fixing a phone/computer problem. I shall have to remember it the next time something doesn't behave!

I haven't seen snow in years (or do any work on the OHRRPGCE today), but I did plant tomatoes, so it was a good day too :)
Last edited by TMC on Mon Dec 09, 2019 12:10 pm, edited 1 time in total.
User avatar
Willy Elektrix
Liquid Metal Slime
Posts: 910
Joined: Sun Aug 15, 2010 11:30 pm

Post by Willy Elektrix »

I've been lurking this thread for a while. I have to say, observing this bug finding process is pretty interesting and dramatic. When James realized there might be a problem with hisphone, it was like learning a clue in a mystery of story. I was like, "Aha! Now what will happen?!"
User avatar
Bob the Hamster
Lord of the Slimes
Posts: 7658
Joined: Tue Oct 16, 2007 2:34 pm
Location: Hamster Republic (Ontario Enclave)
Contact:

Post by Bob the Hamster »

TMC wrote:...
A look at adb logcat shows why:

Code: Select all

libSDL: Settings.Load(): loading settings failed, running config dialog
(I only knew to look for that after looking at Settings.java)

This causes DeleteFilesOnUpgrade() to be totally skipped because it can't check whether it needs to or not.
I see that the libsdl-settings.cfg file is actually totally missing, so it's Save() that's broken. It writes libsdl-settings.cfg to the current directory, which seems dubious to me. I expect there are some commits in upstream sdl-android to fix Save(), but that's enough for me tonight.
I was looking at this today, and I was wondering, why don't I remember anything about libsdl-settings.cfg?

We don't have that file, we have never had that file, not anywhere in the history of our apk port. it does not exist in the commandergenius tree, and it does not exist in the unpacked /sdcard/Android/data/whatever/files/ folder on the device.

This includes old apk files build long before we ever had any problems with failing to delete libsdl-DownloadFinished-0.flag

I am totally baffled. The one line of code in the commandergenius repository that references this "libsdl-settings.cfg" filename is not new, it is 10 years old. Maybe something happened more recently that changed it from being an optional file to a mandatory file?
Last edited by Bob the Hamster on Sat Jan 18, 2020 8:08 pm, edited 1 time in total.
TMC
Metal King Slime
Posts: 4308
Joined: Sun Apr 10, 2011 9:19 am

Post by TMC »

I think you're looking in the wrong directory. And I'm pretty sure that file has always been used and required.

I just checked and see in the log:

Code: Select all

I/SDL     (15162): libSDL: loading lib /data/data/com.hamsterrepublic.ohrrpgce.game/files/../lib/libsdl-1.2.so
...
I/SDL     (15162): libSDL: Settings.Load(): loaded settings successfully
I/SDL     (15162): libSDL: old cfg version 16, our version 16
...
I/libSDL  (15162): Changing curdir to "/storage/sdcard0/Android/data/com.hamsterrepublic.ohrrpgce.game/files"
/storage/sdcard0/Android/data/com.hamsterrepublic.ohrrpgce.game/files is where libsdl-DownloadFinished-0.flag is stored. I can't access /data/data/com.hamsterrepublic.ohrrpgce.game/files/ with adb shell, where libsdl-settings.cfg must be.
Last edited by TMC on Sat Jan 18, 2020 10:43 pm, edited 2 times in total.
User avatar
Bob the Hamster
Lord of the Slimes
Posts: 7658
Joined: Tue Oct 16, 2007 2:34 pm
Location: Hamster Republic (Ontario Enclave)
Contact:

Post by Bob the Hamster »

I was going to try to start working on this, when I discovered that even though distrib-nightly-android.sh works fine for both 32 bit and 64 bit builds, misc/makeapk.sh is failing on both with this sort of error:

https://pastebin.com/raw/sRMMNtTC

Most of it seems related to gif/png/jpeg support but I havent yet figured out why it is no problem fir the nightly build, but fails for makeapk.sh
TMC
Metal King Slime
Posts: 4308
Joined: Sun Apr 10, 2011 9:19 am

Post by TMC »

I notice that the nightly-android.sh calls "./build.sh" while makeapk.sh calls "./build.sh release". However I just tried running "./build.sh release" (which I normally don't do), and it works fine for me (arm64 build). Your errors look the same as the errors you've posted previously (.c files in subdirectories aren't being compiled+linked). Could I see the full build log?
Last edited by TMC on Sat Jan 18, 2020 10:50 pm, edited 2 times in total.
User avatar
Bob the Hamster
Lord of the Slimes
Posts: 7658
Joined: Tue Oct 16, 2007 2:34 pm
Location: Hamster Republic (Ontario Enclave)
Contact:

Post by Bob the Hamster »

I double checked that the symlink from ~/src/ohrandroid/wandering-hamster/tmp correctly points to ~/src/ohr/wip/android/tmp so it *should* be trying to compile the same files

I gotta break this bad habit of partial build logs ;)

Here is the whole thing: http://hamsterrepublic.com/tmp/text/mak ... 1-18-A.log

EDIT: oh, you know? Last time I did this I was using baconthulhu, not wandering-hamster. Maybe there is something I need to update in my wandering-hamster folder... investigating...

EDIT2: Yep! My dumb mistake! I failed to set up gamespecific.cfg or to replace Wander's copy of AndroidAppSettings.cfg to a symlink to the main copy of it. That explains why it was failing. I better fix those things for ALL these games, so I don't keep forgetting over and over ;)

EDIT3: Fixed for all game project folders. I added the following snippit to my script that verifies the symlinks

Code: Select all

  AAS="${D}/AndroidAppSettings.cfg"
  if [ ! -L "${AAS}" ] ; then
    echo " ${AAS} exists but is not a symlink!"
    mv "${AAS}" "${AAS}.old"
    ln -s "${OHRR}/android/AndroidAppSettings.cfg" "${AAS}"
    
    GSPEC="${D}/gamespecific.cfg"
    if [ ! -f "${GSPEC}" ] ; then
      echo " ${GSPEC} does not exist yet, generating it"
      grep -e "^AppName=" "${AAS}.old" > "${GSPEC}"
      grep -e "^AppFullName=" "${AAS}.old" >> "${GSPEC}"
      grep -e "^AppDataDownloadUrl=" "${AAS}.old" >> "${GSPEC}"
      grep -e "^DeleteFilesOnUpgrade=" "${AAS}.old" >> "${GSPEC}"
      echo "# This is the user-visible version code, it is just a string" >> "${GSPEC}"
      grep -e "^AppVersionName=" "${AAS}.old" >> "${GSPEC}"
      echo "# The following is used by ohrrpgce's misc/makeapk.sh script to gengerate AppVersionCode" >> "${GSPEC}"
      grep -e "^AppVersionCode=" "${AAS}.old" | sed -e "s/AppVersionCode/BaseAppVersionCode/" >> "${GSPEC}"
      echo "# This should be zero unless you are building a single-arch patch fix" >> "${GSPEC}"
      echo "PatchVersionCode=0" >> "${GSPEC}"
      echo "# Include the generated version config" >> "${GSPEC}"
      echo ". src/versioninfo.cfg" >> "${GSPEC}"
    fi
  fi
Successfully rebuilt vocabmosaic after that.

Now that my build environment is all fixed, I am ready to... go to bed, actually ;P
Last edited by Bob the Hamster on Sun Jan 19, 2020 12:41 am, edited 3 times in total.
User avatar
Bob the Hamster
Lord of the Slimes
Posts: 7658
Joined: Tue Oct 16, 2007 2:34 pm
Location: Hamster Republic (Ontario Enclave)
Contact:

Post by Bob the Hamster »

So I just re-tested, and now libsdl-DownloadFinished-0.flag IS being correctly deleted on an upgrade now??

I am not sure what changed!

I was able to reproduce success twice.

Both times were on a 64 bit wandering hamster apk on an Android 8.0 phone.
Last edited by Bob the Hamster on Sun Jan 19, 2020 7:54 pm, edited 1 time in total.
TMC
Metal King Slime
Posts: 4308
Joined: Sun Apr 10, 2011 9:19 am

Post by TMC »

Huh. I was also able to reproduce this previously so I tested again with ohrrpgce-custom.apk (32 bit), and bumping AppVersionCode worked for me too!

Code: Select all

I/SDL     (19085): libSDL: Settings.Load(): loaded settings successfully
I/SDL     (19085): libSDL: old cfg version 20, our version 21
V/SDL     (19085): Deleting old file: /storage/sdcard0/Android/data/com.hamsterrepublic.ohrrpgce.custom/files/% exists false
V/SDL     (19085): Deleting old file: /data/data/com.hamsterrepublic.ohrrpgce.custom/files/% exists false
V/SDL     (19085): Deleting old file: /storage/sdcard0/app-data/com.hamsterrepublic.ohrrpgce.custom/% exists false
I/SDL     (19085): libSDL: old cfg version 20, our version 21 and we need to clean up config file
Usually I would want to try to figure out what was going on in order to expunge the root problem, but this Android stuff is a nightmare, so let's not.
Last edited by TMC on Sun Jan 19, 2020 10:52 pm, edited 2 times in total.
TMC
Metal King Slime
Posts: 4308
Joined: Sun Apr 10, 2011 9:19 am

Post by TMC »

And.... we have a report that bumping AppVersionCode (for the Walthros demo) no longer works. Who knows what changed.
TMC wrote:can reproduce that bumping AppVersionCode doesn't cause gamedata.zip to be re-extracted.

A look at adb logcat shows why:

Code: Select all

libSDL: Settings.Load(): loading settings failed, running config dialog
(I only knew to look for that after looking at Settings.java)

This causes DeleteFilesOnUpgrade() to be totally skipped because it can't check whether it needs to or not.
I suggested the problem was in Settings.Save() not working, but that's because I was looking in the directory for libsdl-settings.cfg. I don't know whether the problem is reading or writing that file.

We could avoid this problem if we simply read all our data files directly from the .apk instead of unzipping it on first run, which is something I really want to do anyway to fix all the problems with games breaking because there's not enough storage space. (Although now that I've abandoned my old phone and discovered that on a reasonable phone the unzipping is reasonably fast instead of taking a minute, I care less).

I see an easy workaround is to call DeleteFilesOnUpgrade() if the config file can't be found. That'll delete the config settings, which doesn't matter because we disabled the config menu anyway. Hopefully after doing that once Settings.Save/Load will start working again and it won't have to delete everything again. Otherwise there will be an unpleasant load every time the game is run (and probably noone will bother to complain about it, so we'll never know)
User avatar
Bob the Hamster
Lord of the Slimes
Posts: 7658
Joined: Tue Oct 16, 2007 2:34 pm
Location: Hamster Republic (Ontario Enclave)
Contact:

Post by Bob the Hamster »

My concern is that I don't see evidence that the libsdl-settings.cfg config file ever exists, even when things are working fine, even in older apk files long before this bug appeared.

I don't think that file gets written period

(EDIT: based on what I remember from a few months ago, which can be fallable!)
Last edited by Bob the Hamster on Mon Mar 16, 2020 1:05 am, edited 1 time in total.
TMC
Metal King Slime
Posts: 4308
Joined: Sun Apr 10, 2011 9:19 am

Post by TMC »

Did you check the private app files ("persistent storage"/getFilesDir()) directory for it, which AFAIK is unreadable unless you rooted you phone? That's not the same as the data directory where the .rpgdir is extracted to. Even when the app is installed on external storage, the files dir is apparently still on internal storage to keep it absolutely private. As I mentioned before I'm sure that the file exists, even though I can't access that directory, because I get messages in the log like "libSDL: old cfg version 20, our version 21" which prove that it was read.
Last edited by TMC on Tue Mar 17, 2020 3:46 am, edited 8 times in total.
Post Reply