Instant-Crash on Android: GooglePlayAppID.xml Empty When Using Source-Control

We have a Perforce-Controlled project that uses Google Play for Android Devices.

If we ever regenerate the project files or ‘delete’ the ‘Build’ folder from our project directory (for refreshing / cleaning up a project for instance), the GooglePlayAppID.xml file does not fill out the App ID from the Config Files. The file is found in:

Build → Android → Res → Values

If you deploy to a device without manually fixing this, your game will instantly crash as soon as you launch it with no logs or any information on how to debug or fix it. This literally tripped us up for about 4 months before we finally (by fluke) tracked it down. The only way to fix it currently is to open the file and enter your App ID manually.

I’m not sure if Source-Control has any effect (since the file would be read-only if you don’t manually check it out), but even if you check-out the relevant files in Project Settings → Android and re-enter your Google Play credentials, the .XML file still doesn’t populate - so you have to do it manually.

Even if a fix cannot be implemented, a simple warning dialog to tell you that the .xml file is empty when packaging the project would be great, as it would have saved us months of hair-pulling work!

4.11 checks the Google Play App ID is valid (not empty and doesn’t contain non-numeric values) if Google Play is enabled during packaging and outputs a warning along with replacing the xml file with a stand-in.

This file currently isn’t generated like the AndroidManifest.xml. The editor directly tries to update the xml file in the project’s Build/Android/res/values folder when the App ID is changed in the Project Settings. It needs to be writable for this. In 4.12 I’ll likely change it to be generated using the value stored in config/defaultengine.ini to avoid this.