0

Hi I have Developed my app includes Google Map.I have included Google play service lib file Also but getting this error in log cat

09-30 16:08:33.175: W/System.err(12349): java.lang.NoClassDefFoundError: com.google.android.gms.R$styleable
09-30 16:08:33.176: W/System.err(12349):    at com.google.android.gms.maps.GoogleMapOptions.createFromAttributes(Unknown Source)
09-30 16:08:33.176: W/System.err(12349):    at com.google.android.gms.maps.MapFragment.onInflate(Unknown Source)

my xml file:

<RelativeLayout xmlns:android="schemas.android.com/apk/res/android";     
     android:layout_width="fill_parent" 
     android:layout_height="fill_parent" > 

     <fragment 
       android:id="@+id/MapView" 
       android:layout_width="match_parent" 
       android:layout_height="match_parent"          
       android:name="com.google.android.gms.maps.MapFragment"/>
</RelativeLayout> 

Mainactivity class:

import android.app.Activity; 
import android.os.Bundle; 
import com.google.android.gms.maps.GoogleMap; 
import com.google.android.gms.maps.MapFragment; 

public class ShowMap extends Activity 
{ 
   GoogleMap Map; 
   @Override 
   protected void onCreate(Bundle savedInstanceState) 
   {    
       super.onCreate(savedInstanceState);
       setContentView(R.layout.mapview); 
       Map = ((MapFragment)getFragmentManager().findFragmentById(R.id.MapView)).getMap();     
 } }
prakash
  • 1,413
  • 1
  • 21
  • 33
maha m
  • 29
  • 3
  • paste your xml and java class – George Thomas Sep 30 '14 at 11:02
  • check this link:http://stackoverflow.com/questions/15894143/java-lang-noclassdeffounderror-com-google-android-gms-rstyleable-in-android – prakash Sep 30 '14 at 11:04
  • import android.app.Activity; import android.os.Bundle; import com.google.android.gms.maps.GoogleMap; import com.google.android.gms.maps.MapFragment; public class ShowMap extends Activity { GoogleMap Map; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.mapview); Map = ((MapFragment) getFragmentManager().findFragmentById(R.id.MapView)).getMap(); } } – maha m Sep 30 '14 at 11:04
  • Try to post your code in Question instead comment. – Haresh Chhelana Sep 30 '14 at 11:07
  • Check : https://developers.google.com/maps/documentation/android/start#getting_the_google_maps_android_api_v2 – Haresh Chhelana Sep 30 '14 at 11:08
  • import android.app.Activity; import android.os.Bundle; import com.google.android.gms.maps.GoogleMap; import com.google.android.gms.maps.MapFragment; public class ShowMap extends Activity { GoogleMap Map; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.mapview); Map = ((MapFragment) getFragmentManager().findFragmentById(R.id.MapView)).getMap(); } } – maha m Sep 30 '14 at 11:09
  • Hi @HareshChhelana i have done all steps mentioned in that link but getting same error – maha m Sep 30 '14 at 11:14
  • can you please say what error is possible? – maha m Sep 30 '14 at 11:27
  • Hi @prakash i tried that link also but not solved my error – maha m Sep 30 '14 at 11:45
  • update your manifest code here.have you add the google play library in project,please check it.through alt+enter,then go to Android tag.check it. – prakash Sep 30 '14 at 12:26
  • right click on your project->properties->java build path ->order and export select all the libraries – Revathi Sep 30 '14 at 14:17

0 Answers0