1

I have created an app which runs perfectly when I run it from Android Studio. It works on an emulator and on a connected physical device as well.

However, when I create a signed apk, all I get is an empty gray screen.

Here is my app in github:

https://github.com/handriss/kinizsi

And here is my app in the app store:

https://play.google.com/store/apps/details?id=com.kinizsi.hinkel.kinizsisample

It is my first app, and consquently the first app I wish to publish.

What am I doing wrong?

handris
  • 1,999
  • 8
  • 27
  • 41
  • Download the release version of your app from Google Play, connect your phone to your computer and observe the logcat while starting your app on the phone. This way you should be able to see some exceptions. My guess is that you have some problems regarding implementation of the Google Map. – jaolstad May 12 '17 at 13:32

1 Answers1

1

You need to fill in your google maps API key

<string name="google_maps_key" templateMergeStrategy="preserve" translatable="false">
    YOUR_KEY_HERE
</string>

in release/res/values/google_maps_api.xml

When you build a production release it (potentially) uses a different set of resources and configurations so you can for example have lots of logs in debug mode but not in release more or use different API keys for testing.

In your case in release mode you have not provided an api key for Google to use so it is loading a blank screen.

Ken Wolf
  • 23,133
  • 6
  • 63
  • 84
  • I have added my key, but I didn't want to upload that file to a public repository. – handris May 12 '17 at 13:35
  • I can see your debug key... can you confirm you've added it to the release directory? In the project you posted it's only in the debug directory. – Ken Wolf May 12 '17 at 13:36
  • You were right. I have overlooked the fact that I have added an API key only for the debug mode. – handris May 12 '17 at 13:41
  • Great! Glad I could help. Good luck with your project. – Ken Wolf May 12 '17 at 13:42
  • @handris: Switch from using a string resource to using [manifest placeholders](https://developer.android.com/studio/build/manifest-build-variables.html). Remove `gradle.properties` from the public repository (add it to `.gitignore`), define the API keys there, and then reference them in `build.gradle` to define the placeholder values. – CommonsWare May 12 '17 at 13:42