Hi! I have a problem, when i build my application in .apk and install it on my and other android devices it’s not working. There is a Splash screen and after that just empty screen (it has color of splash screen background)
But when I’m using build & run my project with connected device all things are working perfectly
I’ve tryed to enable Development build but it’s also not working
There are no any errors in logcat
Also I have guess that it’s somehow related to user permissions in application
Previosly app doesn’t ask for any permissions, but now it asks for device files acces (maybe because of AppsFlyer integration?). When I run it with Build & Run it also doesn’t ask for user permissions. Actually it does not need any files acces to work
Are you always making a clean install?
If you use Build & Run, it replaces the app, but all permissions remain, so app does not ask for them. If you uninstall the app, then you should have a clean install.
Also, when app does not work, have you tried killing it and starting again?
There is a known bug with permissions asked on startup, you may be hit by it.
Used adb both to reinstall and to clean install. Installed successfully both times. I also killed the processes and reopened the game but it still has empty screen after splash screen
Updated Unity version from 2022.3.5f1 to 2022.3.10f1 - nothing changed
Tried to use another Android API (level 32 insted of level 33) and it also didn’t help
Ok, so it’s not actually an install error. From your earlier text it sounded like you were unable to install. Anyways, moving on to the next.
There is a known issue with “Optimized Frame Pacing” option on android where it shows up black screen post splash. Can you check if it’s enabled or not and give a try?
It is under Player Settings → Android Platform → Resolution and Presentation-> Optimized Frame Pacing".
Logcat
No errors for both .apk build (black screen) and build & run (successful)
There is an important detail I forgot to mention. Installed with Build & run app is always opening with no problems. Is there any difference between simple build and build&run app configuration?
I thought that if AppsFlyer was installed incorrectly and that’s why the application works fine only in build&run (maybe of some “debug mode”). After removing AppsFlyer from the project nothing has changed.
I solved the problem. Just unchecked “Split Application Binary”. Now .apk file installs correctly and application doesn’t ask for file access permission
Can please someone explain why that was happening?
When you split, there si .apk file and there is .obb file you also need to push onto device, as that’s where most of your game data is (apk only should have the first scene).
When encountering a scenario where the Android Build & Run process works correctly, but the installed APK fails to run, it often indicates a discrepancy between the development and production environments. This issue can stem from various factors, including misconfigured build settings, missing dependencies, or compatibility issues with the target device. To diagnose, first ensure that the APK is being installed on a compatible device and that all required permissions are correctly declared in the manifest file. Additionally, check for any ProGuard or R8 configurations that might be minifying or obfuscating essential code. Reviewing the logcat output during the APK installation and execution can also provide specific error messages or stack traces that pinpoint the root cause. Ensuring that the APK is signed correctly and not corrupted during the build process is equally crucial. Addressing these aspects systematically should help identify and resolve the issue.
However Google Play wouldn’t accept my submission because the API level was too low. So I raised the API level in Unity settings, but then my app was no longer available in Play to all my devices because the API level was too high. So I lowered the level back down.
It turns out that Unity settings needed to install the minimum Android SDK library version required by Play. I assume the higher version SDK package is backward compatible or needed inclusion. I vaguely remember going thru this exact same crap before.
That can be tricky! If your Android Build & Run works but the installed APK doesn’t, it might be due to missing permissions, incorrect signing, or a dependency that’s not included in the final build. Check your logs with adb logcat after installing the APK to pinpoint the issue.
-Luke | Owner of a Game