My activity code
package com.example.testmap; import android.os.Bundle; import android.support.v4.app.FragmentActivity; import android.view.Menu; import com.google.android.gms.maps.SupportMapFragment; public class MainActivity extends FragmentActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); } @Override public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.main, menu); return true; } }
xml file code
and manifest code
but I'm getting error
FATAL EXCEPTION: main java.lang.NoClassDefFoundError: com.google.android.gms.R$styleable at com.google.android.gms.maps.GoogleMapOptions.createFromAttributes(Unknown Source) at com.google.android.gms.maps.SupportMapFragment.onInflate(Unknown Source) at android.support.v4.app.FragmentActivity.onCreateView(FragmentActivity.java:279) at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:563) at android.view.LayoutInflater.rInflate(LayoutInflater.java:623) at android.view.LayoutInflater.inflate(LayoutInflater.java:408) at android.view.LayoutInflater.inflate(LayoutInflater.java:320) at android.view.LayoutInflater.inflate(LayoutInflater.java:276) at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:209) at android.app.Activity.setContentView(Activity.java:1657) at com.example.testmap.MainActivity.onCreate(MainActivity.java:13) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047) at android.app.ActivityThread.performLaunchActivity(ActivityThread.