简体   繁体   中英

App doesn't start on Internal / Alpha Testing

I've just finished recreating my iOS App for Android and have just started Internal / Alpha Testing for the first time. I have passed the review (although I don't know why they need this for 'internal' testing) and have waited for a long time to get it ready for the testing via Google Play Store. Now, finally I can, downloaded it to my device but as soon as I pressed Open, the app won't start. It just flashes the screen and that's it.

I tested in Debug Mode in Android Studio before and after this without changing anything. It just worked fine.

I contacted Google, have talked over chats as well as emails, but nothing is helping. They gave me this link: https://support.google.com/googleplay/?p=agent_troubleshooter , not helping.

So, is there any way I can know the cause of this?? Any way to get some logs out of it? Is there any settings I might have done wrong to create .aab? (although I think Google Play console won't accept it if anything is wrong...)

Any help or clue to solve this issue will be greatly appreciated.

I found the cause of this and solved the issue by myself. The cause was, as I thought originally, a matter of the 'release' build setting which is different from 'debug' specifically 'minifyEnabled' and 'shrinkResources' in build.gradle file.

I doubt if this post will help that many people in the future, but I'll post how I could solve this so they won't be suffering for days like me without finding a clue.

(1) You can still get Logs from Internal testing device.
I was totally upset when I found my app crashed as soon as I open it for Internal Testing because I thought I'd have no way to debug it... Well, I found if you connect the device to computer with Android Studio, Logcat still works to show logs of what the device is doing as you test. You can't set break points nor have option to limited the log to just about your app (unless set search word wisely), but it'll surely help.

By the way, starting Testing via PlayConsole was really painful, but once you started, it's no longer hard as you can just upload a new version and download + install it to your device via 'Internal App Sharing'

(2) App Optimization
When you build 'release' you'll most likely find 'minifyEnabled' and 'shrinkResources' in build.gradle file are both 'true' as it is recommended. In my case, this was the cause of crash because it removed bunch of methods that were actually necessary. My app heavily use JNI calls, both from Java and C/C++ native. When those 'optimization' params were set true, it didn't understand how those methods were used and removed them as Dead Code, which, of course, made my app no way to work properly any more. Here are links in case you want to know more about Optimization:
https://developer.android.com/studio/build/shrink-code#keep-code https://developer.android.com/reference/androidx/annotation/Keep

You may obfuscate code that shouldn't be obfuscated. Check the logcat output for the error message. If the message is something alike ClassNotFoundException , you'd need to add ProGuard/R8 rules, which would keep some of the class- and member-names. When building a release build (no matter what you do with that build afterwards), it tells what the issues are in the console output.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM