I have taken our existing app using Google map api, and swapped out all the calls to make use of Amazon map api. The app builds successfully, but crashes when I try to launch it on a Kindle HD device. I get the following stacktrace: 10-11 14:37:46.567: E/AndroidRuntime(8436): Caused by: java.lang.RuntimeException: Stub! 10-11 14:37:46.567: E/AndroidRuntime(8436): at com.amazon.geo.maps.MapActivity. (MapActivity.java:20) 10-11 14:37:46.567: E/AndroidRuntime(8436): at com.aws.android.Typhoon. (Typhoon.java:105) 10-11 14:37:46.567: E/AndroidRuntime(8436): at java.lang.Class.newInstanceImpl(Native Method) 10-11 14:37:46.567: E/AndroidRuntime(8436): at java.lang.Class.newInstance(Class.java:1319) 10-11 14:37:46.567: E/AndroidRuntime(8436): at android.app.Instrumentation.newActivity(Instrumentation.java:1023) 10-11 14:37:46.567: E/AndroidRuntime(8436): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1909) 10-11 14:37:46.567: E/AndroidRuntime(8436): ... 11 more I was able to run the sample capitol hill coffee apps successfully. Does anyone have any insight into this issue? Where can I get the source code to see what is happening on MapActivity.java line 20?
My manifest definition looks like this: In it has: I have Amazon Map API downloaded already, as I'm able to run the sample app without any problems. But our app is much more complicated, and I cannot tell what is causing this crash/exception.
Just want to make sure that you have also defined android permissions in the android manifest file. Your app must request android.permission.INTERNET to download map tiles. And if your app uses locations or uses the MyLocationOverlay class then it must also request android.permission.ACCESS_COARSE_LOCATION and android.permission.ACCESS_FINE_LOCATION. Please refer to the below link for step by step guidance.
https://developer.amazon.com/sdk/maps/migrating.html Thank you.
I do have all these permissions set. This is a port of an existing app from Google Play, so all the required permissions are there. How can I find out more information about what is causing this exception?
Hi Peter, Can you also please check that you have enabled Amazon map feature inside the application tag of your manifest file?, If it is enabled properly and still facing the issue, I would recommend you to raise a contact us(
https://developer.amazon.com/help/contactus.html) to Amazon support team, where one of our support engineer will assist you in this. Also, please make sure that you have followed the steps mentioned in the below link for migrating from google play to Amazon.
https://developer.amazon.com/sdk/maps/migrating.html Thanks for understanding.
Hi Peter, I believe the problem is that you have bundled the amazonmaps.jar from the Amazon Maps API add-on into your application. This jar file contains stub implementations of the maps api, which should not be included in your application. The stub classes throw a RuntimeException when invoked. That is what you are seeing in your stack trace: 10-11 14:37:46.567: E/AndroidRuntime(8436): Caused by: java.lang.RuntimeException: Stub! 10-11 14:37:46.567: E/AndroidRuntime(8436): at com.amazon.geo.maps.MapActivity. (MapActivity.java:20) You can verify this by unzipping your apk and then running the dexdump tool included in the Android SDK on the classes.dex. If you see an entry like this in the output Class descriptor : 'Lcom/amazon/geo/maps/MapActivity;' then your apk includes the stub classes. The easiest fix is to avoid referencing amazonmaps.jar directly from your project. Instead set your project build target to the Amazon Maps API. You can do this in Eclipse through the project's Android properties. See the "Building Against the Amazon Maps Add-on" section of
https://developer.amazon.com/sdk/maps/building.html for more information. Don't forget to remove any references your project has to amazonmaps.jar.