-1

I'm trying to run maps and I'm getting the following error. It looks like I am not declaring something properly. Can anyone help? As indicated in the comment below, I have GooglePlayServices and Support v13 listed as project libraries in Project Properties, so I think it may be a duplicate or broken reference. I have tried Project Clean with no effect.

08-17 10:50:03.363: E/AndroidRuntime(23422): FATAL EXCEPTION: main
08-17 10:50:03.363: E/AndroidRuntime(23422): java.lang.NoClassDefFoundError: com.google.android.gms.R$styleable
08-17 10:50:03.363: E/AndroidRuntime(23422):    at com.google.android.gms.maps.GoogleMapOptions.createFromAttributes(Unknown Source)
08-17 10:50:03.363: E/AndroidRuntime(23422):    at com.google.android.gms.maps.SupportMapFragment.onInflate(Unknown Source)
08-17 10:50:03.363: E/AndroidRuntime(23422):    at android.support.v4.app.FragmentActivity.onCreateView(FragmentActivity.java:271)
08-17 10:50:03.363: E/AndroidRuntime(23422):    at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:669)

I thought that crossed references may be the issue, so I changed the pointer to GooglePlayServices from an external to a workspace jar, as I had added the library to the workspace. I then got the following error:

08-17 14:20:07.028: E/AndroidRuntime(25258): FATAL EXCEPTION: main
08-17 14:20:07.028: E/AndroidRuntime(25258): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.mediloc8.leeds/com.mediloc8.leeds.MyMapView}: java.lang.ClassNotFoundException: com.mediloc8.leeds.MyMapView
08-17 14:20:07.028: E/AndroidRuntime(25258):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1892)
08-17 14:20:07.028: E/AndroidRuntime(25258):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1993)

My Manifest has the following declaration for MyMapView:

<activity android:name="com.mediloc8.leeds.MyMapView"
     android:screenOrientation="portrait"
     android:label="@string/map">
     <intent-filter>
    <action android:name="com.mediloc8.leeds.MyMapView" />
         <category android:name="android.intent.category.DEFAULT" />

  </intent-filter>
         </activity>
Neil MCCABE
  • 67
  • 1
  • 10
  • You have to add GooglePlayServices library project and support lib v4(if use support mapfragment for older version) to project dependences. – Ketan Ahir Aug 17 '13 at 10:00
  • I'm not sure it's a duplicate as I have GooglePlayServices as a jar in the project along with support lib v13. I think it may be that somewhere in the workspace and the project I may have duplicate references. – Neil MCCABE Aug 17 '13 at 13:06
  • I've fixed it by adding the GooglePlayServices library project as a Referenced Project - even though the jar is external. Weird! – Neil MCCABE Aug 17 '13 at 15:33

2 Answers2

0

check whether google play services library added to your project or not. right click on project ->properties -> java buildpath -order and export select google play services.

SHASHIDHAR MANCHUKONDA
  • 3,302
  • 2
  • 19
  • 40
0

It is due to GooglePlayServices not added as a library in the project

Check this for setting up the GooglePlayServices library in your project.

bakriOnFire
  • 2,685
  • 1
  • 15
  • 27