Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The Android app gets stuck on startup. #5491

Open
RobertoZaffa opened this issue Apr 29, 2024 · 14 comments
Open

The Android app gets stuck on startup. #5491

RobertoZaffa opened this issue Apr 29, 2024 · 14 comments

Comments

@RobertoZaffa
Copy link

I built an android app with Renpy and uploaded it to Google Play (.aab file).
Google play console gives me this error:
""This item may not have a label readable by screen readers".
Same error if I load the build of a new VN without modifying it.
I tried downloading the app from Google Play on my phone. When start it remains stuck displaying the presplash file.
The apk file generated by Renpy however works well on my phone.
I extracted the apk from the .aab file with Bundletool and tried to run it with the Android Studio emulator and it crashes like on the phone.
I think at this point there is a problem with how Renpy creates the .aab file.
Amazon instead asks for the APK file and therefore there are no problems: https://www.amazon.com/gp/product/B0D2Y77WP1

I am using:
Renpy 8.2.1.24030407
jdk-21.0.2+13

I attach some screenshots and ask what other information can be used to understand what the problem is.
Thank you
Screenshot 2024-04-29 232507
Screenshot 2024-04-29 231311

@renpytom
Copy link
Member

Can you add renpytom@gmail.com to the testers for your app, and sent me your apps name? I'd like to see what errors I get.

@RobertoZaffa
Copy link
Author

RobertoZaffa commented May 1, 2024

Hi Tom,
first of all, thanks for your help.
I added you as a tester and this is the link: https://play.google.com/apps/internaltest/4701227960855637705
I also attach the logcat generated by Android Studio.
Pixel-3a-API-34-extension-level-7-x86-64-Android-14_2024-05-01_225046.logcat.txt
The applicatin name is: master mind (org.altervista.mastermind (unreviewed))

@RobertoZaffa
Copy link
Author

I did another test.
From Renpy I generated an APK and AAB for "The Question".
I opened the APK with Android Studio and it works.
I extracted the APK from the AAB file with Google Bundle Tool and opened it with Android Studio and when started it crashes like my App (I attach the screenshot).
Consider that this is the first time I've tried to create an App and publish it, I'm not an expert, so I don't rule out the possibility that I'm doing something wrong.
image

@renpytom
Copy link
Member

renpytom commented May 1, 2024

Extracting the APK won't work - it needs the additonal files that are included in the .aab to work. You need to use bundletool to install it. Ren'Py does that for you.

@RobertoZaffa
Copy link
Author

Aside from the tests done with Android Studio, have you tried downloading the App from Google Play and running it on an Android device?
The link is: https://play.google.com/apps/internaltest/4701227960855637705 ?

@RobertoZaffa
Copy link
Author

Just for information, bundletool with the mode=universal option generates a .APKS file which is renamed with a .ZIP extension and once uncompressed two files emerge:

  • universal.apk
  • toc.pb

toc.pb file is not directly needed to run the APK extracted from the .aab file using bundletool with the --mode=universal option.

Here's why:

Universal APK: The --mode=universal option in bundletool creates a single APK that includes all the resources and code needed for the app to run on any device configuration supported by the app. This eliminates the need for the app store to split the app based on device specifics.

toc.pb for Splitting: The toc.pb file is primarily used when dealing with app bundles containing multiple split APKs. These splits target specific device configurations (like screen size or architecture) to reduce app size.

Universal APK is Self-Contained: Since the universal APK already contains everything, it doesn't need the toc.pb file to understand its own structure. It has all the necessary resources and code within itself to function.
In essence, the toc.pb file becomes irrelevant when using the --mode=universal option. The resulting universal APK is a standalone file with everything it needs to run.

In conclusion, I believe that running universal.apk from Android Studio is the same as downloading the APK from Google Play and running it on an Android device and in fact the behavior is the same, the app crashes as soon as it starts.
I believe there is a problem with how Renpy creates the .AAB file

@renpytom
Copy link
Member

renpytom commented May 2, 2024

Does it fail when you use Ren'Py to install the game on a device?

@RobertoZaffa
Copy link
Author

No, I don't use Ren'Py for installation.
After downloading the APK onto my phone I start the installation from the phone itself

@RobertoZaffa
Copy link
Author

Hi Tom,
Do you have any suggestions of what I could try?
Could the Android Studio logcat help you understand what the problem could be?
Have you tried generating an AAB from The Question and then extracting the APK and running it? Or upload the AAB to Google Play and then download the APK and run it? Since the problem is not related to my app but also happens with simple Renpy apps, I think it is a general problem of how AAB files are generated by Renpy.

@RobertoZaffa
Copy link
Author

Hi Tom,
do you have the opportunity to try an AAB produced with Renpy in Google Play?
Just to understand if it's my problem or a generic Renpy one.
Thank you

@renpytom
Copy link
Member

renpytom commented May 7, 2024

You need to use Ren'Py to install the AAB, downloading it yourself won't work.

People have gotten it working in Google Play, but Google Play has had bugs as well.

@RobertoZaffa
Copy link
Author

I produce the AAB with Renpy and upload it to Google Play.
How else can I proceed?
Am I doing something wrong?
Is there a procedure/sequence to follow?

@renpytom
Copy link
Member

renpytom commented May 7, 2024

That should work. You do need to uninstall the game from your device and reinstall it from google play to have it work.

@RobertoZaffa
Copy link
Author

I tried but nothing changes.
Even from Android Studio I have the same behavior as the phone.

  1. If I open a project using the APK generated by Renpy it works.
  2. If I open the APK downloaded from Google Play or extracted from the AAB file generated by Renpy it doesn't work.
    A I attach the logcat for both the first and second situations.
    NOT_OK_Pixel-3a-API-34-extension-level-7-x86-64-Android-14_2024-05-09_163700.logcat.txt
    OK_Pixel-3a-API-34-extension-level-7-x86-64-Android-14_2024-05-09_165311.logcat.txt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants