I am developing a Android Google map app using Google 2.3 API. I googled around and tried this But while testing the application i got exception. Here's is the full stack-trace
FATAL EXCEPTION: main
09-05 16:16:05.914: ERROR/AndroidRuntime(405): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.som.routing/com.som.routing.GmaproutingtryActivity}: java.lang.ClassNotFoundException: com.som.routing.G开发者_如何学编程maproutingtryActivity in loader dalvik.system.PathClassLoader[/data/app/com.som.routing-2.apk]
09-05 16:16:05.914: ERROR/AndroidRuntime(405): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1569)
09-05 16:16:05.914: ERROR/AndroidRuntime(405): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663)
09-05 16:16:05.914: ERROR/AndroidRuntime(405): at android.app.ActivityThread.access$1500(ActivityThread.java:117)
09-05 16:16:05.914: ERROR/AndroidRuntime(405): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
09-05 16:16:05.914: ERROR/AndroidRuntime(405): at android.os.Handler.dispatchMessage(Handler.java:99)
09-05 16:16:05.914: ERROR/AndroidRuntime(405): at android.os.Looper.loop(Looper.java:130)
09-05 16:16:05.914: ERROR/AndroidRuntime(405): at android.app.ActivityThread.main(ActivityThread.java:3683)
09-05 16:16:05.914: ERROR/AndroidRuntime(405): at java.lang.reflect.Method.invokeNative(Native Method)
09-05 16:16:05.914: ERROR/AndroidRuntime(405): at java.lang.reflect.Method.invoke(Method.java:507)
09-05 16:16:05.914: ERROR/AndroidRuntime(405): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
09-05 16:16:05.914: ERROR/AndroidRuntime(405): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
09-05 16:16:05.914: ERROR/AndroidRuntime(405): at dalvik.system.NativeStart.main(Native Method)
09-05 16:16:05.914: ERROR/AndroidRuntime(405): Caused by: java.lang.ClassNotFoundException: com.som.routing.GmaproutingtryActivity in loader dalvik.system.PathClassLoader[/data/app/com.som.routing-2.apk]
09-05 16:16:05.914: ERROR/AndroidRuntime(405): at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:240)
09-05 16:16:05.914: ERROR/AndroidRuntime(405): at java.lang.ClassLoader.loadClass(ClassLoader.java:551)
09-05 16:16:05.914: ERROR/AndroidRuntime(405): at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
09-05 16:16:05.914: ERROR/AndroidRuntime(405): at android.app.Instrumentation.newActivity(Instrumentation.java:1021)
09-05 16:16:05.914: ERROR/AndroidRuntime(405): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1561)
09-05 16:16:05.914: ERROR/AndroidRuntime(405): ... 11 more
Anyone gone this example please help me out.
Android could not find class com.som.routing.GmaproutingtryActivity
. Did you include it (or the lib) in your project?
give the permission in the manifest file like this
<uses-library android:name="com.google.android.maps" />
. In the manifest tag of the manifest file declare and define the package attribute .If the problem still continues uninstall the apk and reinstall you application.
精彩评论