Reputation: 10148
I have one application for showing the map but it is not working does not show the map. I created the application with target name Google Apps platform is 2.3 and my emulator is Google apps(API level 9)
this is my android manifest.xml
I get the following error in the logcat file
04-06 12:32:27.486: ERROR/AndroidRuntime(476): java.lang.RuntimeException: Unable to instantiate activity
ComponentInfo{net.learn2develop.GoogleMaps/net.learn2develop.GoogleMaps.MapsActivity}: java.lang.ClassNotFoundException: net.learn2develop.GoogleMaps.MapsActivity in loader dalvik.system.PathClassLoader[/data/app/net.learn2develop.GoogleMaps-1.apk]
04-06 12:32:27.486: ERROR/AndroidRuntime(476): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1544)
04-06 12:32:27.486: ERROR/AndroidRuntime(476): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1638)
04-06 12:32:27.486: ERROR/AndroidRuntime(476): at android.app.ActivityThread.access$1500(ActivityThread.java:117)
04-06 12:32:27.486: ERROR/AndroidRuntime(476): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:928)
04-06 12:32:27.486: ERROR/AndroidRuntime(476): at android.os.Handler.dispatchMessage(Handler.java:99)
04-06 12:32:27.486: ERROR/AndroidRuntime(476): at android.os.Looper.loop(Looper.java:123)
04-06 12:32:27.486: ERROR/AndroidRuntime(476): at android.app.ActivityThread.main(ActivityThread.java:3647)
04-06 12:32:27.486: ERROR/AndroidRuntime(476): at java.lang.reflect.Method.invokeNative(Native Method)
04-06 12:32:27.486: ERROR/AndroidRuntime(476): at java.lang.reflect.Method.invoke(Method.java:507)
04-06 12:32:27.486: ERROR/AndroidRuntime(476): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
04-06 12:32:27.486: ERROR/AndroidRuntime(476): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
04-06 12:32:27.486: ERROR/AndroidRuntime(476): at dalvik.system.NativeStart.main(Native Method)
04-06 12:32:27.486: ERROR/AndroidRuntime(476): Caused by: java.lang.ClassNotFoundException: net.learn2develop.GoogleMaps.MapsActivity in loader dalvik.system.PathClassLoader[/data/app/net.learn2develop.GoogleMaps-1.apk]
04-06 12:32:27.486: ERROR/AndroidRuntime(476): at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:240)
04-06 12:32:27.486: ERROR/AndroidRuntime(476): at java.lang.ClassLoader.loadClass(ClassLoader.java:551)
04-06 12:32:27.486: ERROR/AndroidRuntime(476): at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
04-06 12:32:27.486: ERROR/AndroidRuntime(476): at android.app.Instrumentation.newActivity(Instrumentation.java:1021)
04-06 12:32:27.486: ERROR/AndroidRuntime(476): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1536)
04-06 12:32:27.486: ERROR/AndroidRuntime(476): ... 11 more
please tell me how to correct my problem
Upvotes: 0
Views: 1426
Reputation: 3404
make sure in ur manifest as u added the google map library within the application tag instead of giving it outside.
<application android:icon="@drawable/icon" android:label="@string/app_name">
<activity android:name=".GoogleMapView"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<uses-library android:name="com.google.android.maps" />
</application>
<uses-permission android:name="android.permission.INTERNET"></uses-permission>
Upvotes: 3
Reputation: 3318
permission should exist in following way:
This link may also help you http://www.androidpeople.com/android-google-map-application-example
Upvotes: 1
Reputation: 11571
check if you have used the use-library for google map and permission for Internet in your manifest file and also have you used the debug key in xml .
Upvotes: 0
Reputation: 11227
Did you created the api key? and keep in mind that you need one key for debug certificate and a second key for the release android:apiKey="xxx" generate api key
Upvotes: 1
Reputation: 11251
Are you sure you have obtained a maps key from Google by generating a MD5 hash of your debug/release keys?
What's the output that you see , if you see any ?
Have you given InternetPermission
to your app?
Upvotes: 0