Learning Android Google Maps
上QQ阅读APP看书,第一时间看更新

Common problems and solutions

Common problems and their solutions are as follows:

  • java.lang.RuntimeException: The API key is not found—Logcat.

    Your application will crash before opening. This is caused because the API key is not found in manifest.

    To fix this, add the API key to AndroidManifest.xml

  • Authorization failure—Logcat: Your application will display an empty map on opening. This is caused because you have entered an invalid API key. You may have missed some strings in the key.

    To fix this, enter the API key without missing anything

  • This application will not run unless you update Google Play services: This error is caused because you are using a lower version of Google play services than the version you used in your application.

    If you are using a physical device, you can fix this error by updating the Google Play services version. If you are using an emulator with the Google API, the only way to update is from the SDK Manager.