andrew
andrew

Reputation: 2077

The application has Stopped Unexpectedly, Google Maps

Am trying to display Map on My device (Android). I think I have done everything right as well added permissions to the Manifest, but When executing it says that the Application has Stopped Unexpectedly. Please try again.

Manifest file details

<uses-permission android:name="android.permission.INTERNET"/> 
<uses-permission  android:name="com.google.android.providers.gsf.permission.READ_GSERVICES"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/> 
<uses-feature android:glEsVersion="0x00020000" android:required="true"/> 
<permission android:name="com.maps.permission.MAPS_RECEIVE" android:protectionLevel="signature"/> 
<uses-permission android:name="com.maps.permission.MAPS_RECEIVE"/>
<meta-data android:name="com.google.android.maps.v2.API_KEY" android:value="AIzaSyD5oEA4Ct8_q_Ic-YBVjSv0_ANMfatvysY"/>

Logcat

05-16 20:19:43.433: W/dalvikvm(303): VFY: unable to resolve static field 872 (MapAttrs) in Lcom/google/android/gms/R$styleable;
05-16 20:19:43.433: D/dalvikvm(303): VFY: replacing opcode 0x62 at 0x000e
05-16 20:19:43.442: D/dalvikvm(303): VFY: dead code 0x0010-00ae in Lcom/google/android/gms/maps/GoogleMapOptions;.createFromAttributes (Landroid/content/Context;Landroid/util/AttributeSet;)Lcom/google/android/gms/maps/GoogleMapOptions;
05-16 20:19:43.452: D/AndroidRuntime(303): Shutting down VM
05-16 20:19:43.452: W/dalvikvm(303): threadid=1: thread exiting with uncaught exception (group=0x4001d800)
05-16 20:19:43.482: E/AndroidRuntime(303): FATAL EXCEPTION: main
05-16 20:19:43.482: E/AndroidRuntime(303): java.lang.NoClassDefFoundError: com.google.android.gms.R$styleable
05-16 20:19:43.482: E/AndroidRuntime(303):  at com.google.android.gms.maps.GoogleMapOptions.createFromAttributes(Unknown Source)
05-16 20:19:43.482: E/AndroidRuntime(303):  at com.google.android.gms.maps.SupportMapFragment.onInflate(Unknown Source)
05-16 20:19:43.482: E/AndroidRuntime(303):  at android.support.v4.app.FragmentActivity.onCreateView(FragmentActivity.java:279)
05-16 20:19:43.482: E/AndroidRuntime(303):  at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:558)
05-16 20:19:43.482: E/AndroidRuntime(303):  at android.view.LayoutInflater.rInflate(LayoutInflater.java:618)
05-16 20:19:43.482: E/AndroidRuntime(303):  at android.view.LayoutInflater.inflate(LayoutInflater.java:407)
05-16 20:19:43.482: E/AndroidRuntime(303):  at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
05-16 20:19:43.482: E/AndroidRuntime(303):  at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
05-16 20:19:43.482: E/AndroidRuntime(303):  at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:198)
05-16 20:19:43.482: E/AndroidRuntime(303):  at android.app.Activity.setContentView(Activity.java:1647)
05-16 20:19:43.482: E/AndroidRuntime(303):  at com.example.mymap.Map.onCreate(Map.java:21)
05-16 20:19:43.482: E/AndroidRuntime(303):  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
05-16 20:19:43.482: E/AndroidRuntime(303):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
05-16 20:19:43.482: E/AndroidRuntime(303):  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
05-16 20:19:43.482: E/AndroidRuntime(303):  at android.app.ActivityThread.access$2300(ActivityThread.java:125)
05-16 20:19:43.482: E/AndroidRuntime(303):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
05-16 20:19:43.482: E/AndroidRuntime(303):  at android.os.Handler.dispatchMessage(Handler.java:99)
05-16 20:19:43.482: E/AndroidRuntime(303):  at android.os.Looper.loop(Looper.java:123)
05-16 20:19:43.482: E/AndroidRuntime(303):  at android.app.ActivityThread.main(ActivityThread.java:4627)
05-16 20:19:43.482: E/AndroidRuntime(303):  at java.lang.reflect.Method.invokeNative(Native Method)
05-16 20:19:43.482: E/AndroidRuntime(303):  at java.lang.reflect.Method.invoke(Method.java:521)
05-16 20:19:43.482: E/AndroidRuntime(303):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
05-16 20:19:43.482: E/AndroidRuntime(303):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
05-16 20:19:43.482: E/AndroidRuntime(303):  at dalvik.system.NativeStart.main(Native Method)
05-16 20:24:43.612: I/Process(303): Sending signal. PID: 303 SIG: 9

Upvotes: 0

Views: 2143

Answers (1)

Raghunandan
Raghunandan

Reputation: 133570

You should refer the google play services library project in your map project.

My guess you have not referred to the google play services library in your android map project

Import your library project to your worksace. import the same to eclipse.

When you import the library to eclipse. you can if its a library project

Right click on your library project. goto properties. choose android. you should see a similar window as below

enter image description here

Right click on your project. goto properties. Choose android. click add. browse and add the library project.

enter image description here

Upvotes: 1

Related Questions