question

Greg Coulombe avatar image
Greg Coulombe asked

Non-stub version of Maps API available for emulator?

Hello, my account was recently enabled for the Maps API and I'm trying to run the sample application (step4_final). When I attempt to run the app in the emulator, I get the following error. Is there a version of the Maps API that will run in the emulator or will this require a hardware device to run? Thanks! 09-14 13:15:25.646: ERROR/AndroidRuntime(1107): FATAL EXCEPTION: main java.lang.ExceptionInInitializerError at java.lang.Class.newInstanceImpl(Native Method) at java.lang.Class.newInstance(Class.java:1319) at android.app.Instrumentation.newActivity(Instrumentation.java:1023) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1909) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2019) at android.app.ActivityThread.access$600(ActivityThread.java:126) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1158) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:137) at android.app.ActivityThread.main(ActivityThread.java:4491) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:511) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551) at dalvik.system.NativeStart.main(Native Method) [b]Caused by: java.lang.RuntimeException: Stub![/b] at com.amazon.geo.maps.GeoPoint. (GeoPoint.java:20) at com.example.amazon.capitolhillcoffee.CoffeeActivity. (CoffeeActivity.java:28) ... 15 more
amazon maps
10 |3000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Greg Coulombe avatar image
Greg Coulombe answered
Fixed. The problem was that I was mistakenly including the maps jar file in the classes.dex that was being deployed to the emulator. Once I removed it, the emulator worked fine.
10 |3000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Samuel@Amazon avatar image
Samuel@Amazon answered
Thats great! I believe this will help other developers in the forum if they find similar issue.
10 |3000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Aadil Farooq avatar image
Aadil Farooq answered
I m having a similar problem. I m getting a runtime exception in both Kindle Fire device and emulator. Here is my log cat:- 09-20 10:53:25.021: D/AndroidRuntime(1198): Shutting down VM 09-20 10:53:25.021: W/dalvikvm(1198): threadid=1: thread exiting with uncaught exception (group=0xb4139180) 09-20 10:53:25.060: E/AndroidRuntime(1198): FATAL EXCEPTION: main 09-20 10:53:25.060: E/AndroidRuntime(1198): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.example.amazon.capitolhillcoffee/com.example.amazon.capitolhillcoffee.CoffeeActivity}: java.lang.RuntimeException: Stub! 09-20 10:53:25.060: E/AndroidRuntime(1198): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1880) 09-20 10:53:25.060: E/AndroidRuntime(1198): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1981) 09-20 10:53:25.060: E/AndroidRuntime(1198): at android.app.ActivityThread.access$600(ActivityThread.java:123) 09-20 10:53:25.060: E/AndroidRuntime(1198): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1147) 09-20 10:53:25.060: E/AndroidRuntime(1198): at android.os.Handler.dispatchMessage(Handler.java:99) 09-20 10:53:25.060: E/AndroidRuntime(1198): at android.os.Looper.loop(Looper.java:137) 09-20 10:53:25.060: E/AndroidRuntime(1198): at android.app.ActivityThread.main(ActivityThread.java:4424) 09-20 10:53:25.060: E/AndroidRuntime(1198): at java.lang.reflect.Method.invokeNative(Native Method) 09-20 10:53:25.060: E/AndroidRuntime(1198): at java.lang.reflect.Method.invoke(Method.java:511) 09-20 10:53:25.060: E/AndroidRuntime(1198): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784) 09-20 10:53:25.060: E/AndroidRuntime(1198): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551) 09-20 10:53:25.060: E/AndroidRuntime(1198): at dalvik.system.NativeStart.main(Native Method) 09-20 10:53:25.060: E/AndroidRuntime(1198): Caused by: java.lang.RuntimeException: Stub! 09-20 10:53:25.060: E/AndroidRuntime(1198): at com.amazon.geo.maps.MapActivity. (MapActivity.java:20) 09-20 10:53:25.060: E/AndroidRuntime(1198): at com.example.amazon.capitolhillcoffee.CoffeeActivity. (CoffeeActivity.java:13) 09-20 10:53:25.060: E/AndroidRuntime(1198): at java.lang.Class.newInstanceImpl(Native Method) 09-20 10:53:25.060: E/AndroidRuntime(1198): at java.lang.Class.newInstance(Class.java:1319) 09-20 10:53:25.060: E/AndroidRuntime(1198): at android.app.Instrumentation.newActivity(Instrumentation.java:1023) 09-20 10:53:25.060: E/AndroidRuntime(1198): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1871) 09-20 10:53:25.060: E/AndroidRuntime(1198): ... 11 more 09-20 10:54:32.160: D/AndroidRuntime(1493): Shutting down VM 09-20 10:54:32.171: W/dalvikvm(1493): threadid=1: thread exiting with uncaught exception (group=0xb4139180) 09-20 10:54:32.190: E/AndroidRuntime(1493): FATAL EXCEPTION: main 09-20 10:54:32.190: E/AndroidRuntime(1493): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.example.amazon.capitolhillcoffee/com.example.amazon.capitolhillcoffee.CoffeeActivity}: java.lang.RuntimeException: Stub! 09-20 10:54:32.190: E/AndroidRuntime(1493): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1880) 09-20 10:54:32.190: E/AndroidRuntime(1493): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1981) 09-20 10:54:32.190: E/AndroidRuntime(1493): at android.app.ActivityThread.access$600(ActivityThread.java:123) 09-20 10:54:32.190: E/AndroidRuntime(1493): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1147) 09-20 10:54:32.190: E/AndroidRuntime(1493): at android.os.Handler.dispatchMessage(Handler.java:99) 09-20 10:54:32.190: E/AndroidRuntime(1493): at android.os.Looper.loop(Looper.java:137) 09-20 10:54:32.190: E/AndroidRuntime(1493): at android.app.ActivityThread.main(ActivityThread.java:4424) 09-20 10:54:32.190: E/AndroidRuntime(1493): at java.lang.reflect.Method.invokeNative(Native Method) 09-20 10:54:32.190: E/AndroidRuntime(1493): at java.lang.reflect.Method.invoke(Method.java:511) 09-20 10:54:32.190: E/AndroidRuntime(1493): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784) 09-20 10:54:32.190: E/AndroidRuntime(1493): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551) 09-20 10:54:32.190: E/AndroidRuntime(1493): at dalvik.system.NativeStart.main(Native Method) 09-20 10:54:32.190: E/AndroidRuntime(1493): Caused by: java.lang.RuntimeException: Stub! 09-20 10:54:32.190: E/AndroidRuntime(1493): at com.amazon.geo.maps.MapActivity. (MapActivity.java:20) 09-20 10:54:32.190: E/AndroidRuntime(1493): at com.example.amazon.capitolhillcoffee.CoffeeActivity. (CoffeeActivity.java:13) 09-20 10:54:32.190: E/AndroidRuntime(1493): at java.lang.Class.newInstanceImpl(Native Method) 09-20 10:54:32.190: E/AndroidRuntime(1493): at java.lang.Class.newInstance(Class.java:1319) 09-20 10:54:32.190: E/AndroidRuntime(1493): at android.app.Instrumentation.newActivity(Instrumentation.java:1023) 09-20 10:54:32.190: E/AndroidRuntime(1493): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1871) 09-20 10:54:32.190: E/AndroidRuntime(1493): ... 11 more 09-20 10:54:32.520: I/dalvikvm(1493): threadid=3: reacting to signal 3 09-20 10:54:32.530: I/dalvikvm(1493): Wrote stack traces to '/data/anr/ traces.txt' 09-20 10:54:32.831: I/dalvikvm(1493): threadid=3: reacting to signal 3 09-20 10:54:32.841: I/dalvikvm(1493): Wrote stack traces to '/data/anr/ traces.txt' Anyone know how to solve this issue? Can i get the basic "Android project" from Amazon which has all the jars linked? Message was edited by: Aadil Farooq
10 |3000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Samuel@Amazon avatar image
Samuel@Amazon answered
Aadil, Just want to make sure that you are not trying this on Kindle Fire 1st Generation right, because those devices won't support Maps feature.
10 |3000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Aadil Farooq avatar image
Aadil Farooq answered
@Samuel, Oh i was trying that first generation KindleFire device. Google Maps api also don't work on it. But I can use google maps inside a webView control and can receive latitude and longitude and other information from javascript api from there. Can i use that as an alternative for 1st Gen devices? Thanks
10 |3000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Samuel@Amazon avatar image
Samuel@Amazon answered
Yeah, you can use maps inside web view and can use it in your program
10 |3000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.