title: Google maps Android in eclipse project
body: <p>I have created a maps activity in android studio and now for some reasons i want to implement it in eclipse. So i copied the below code:</p>
  
  <p>Activity:</p>
  
  <pre><code>package my1.app;
  
  import com.google.android.gms.maps.CameraUpdateFactory;
  import com.google.android.gms.maps.GoogleMap;
  import com.google.android.gms.maps.MapFragment;
  import com.google.android.gms.maps.OnMapReadyCallback;
  import com.google.android.gms.maps.model.BitmapDescriptorFactory;
  import com.google.android.gms.maps.model.LatLng;
  import com.google.android.gms.maps.model.MarkerOptions;
  
  import android.app.ActionBar;
  import android.app.Activity;
  import android.app.NotificationManager;
  import android.content.Context;
  import android.location.Location;
  import android.location.LocationListener;
  import android.location.LocationManager;
  import android.os.Bundle;
  import android.util.Log;
  import android.view.Menu;
  import android.view.MenuItem;
  
  public class MainActivity extends Activity implements OnMapReadyCallback {
  
      private GoogleMap mMap;
  
      private static double latitude;
      private static double longtitude;
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
          ActionBar ab = getActionBar();
  
          ab.setDisplayHomeAsUpEnabled(true);
  
          // Obtain the SupportMapFragment and get notified when the map is ready to be used.
          MapFragment mapFragment = (MapFragment) getFragmentManager().findFragmentById(R.id.map);
          mapFragment.getMapAsync(this);
  
          NotificationManager manager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
          manager.cancel(12);
  
      }
  
  
  
      /**
       * Manipulates the map once available.
       * This callback is triggered when the map is ready to be used.
       * This is where we can add markers or lines, add listeners or move the camera. In this case,
       * we just add a marker near Sydney, Australia.
       * If Google Play services is not installed on the device, the user will be prompted to install
       * it inside the SupportMapFragment. This method will only be triggered once the user has
       * installed Google Play services and returned to the app.
       */
      @Override
      public void onMapReady(GoogleMap googleMap) {
          mMap = googleMap;
  
          LocationManager locationManager = (LocationManager) this.getSystemService(Context.LOCATION_SERVICE);
          Log.i("mike",Double.toString(latitude));
          Log.i("mike",Double.toString(longtitude));
          // Define a listener that responds to location updates
          LocationListener locationListener = new LocationListener() {
              public void onLocationChanged(Location location) {
                  // Called when a new location is found by the network location provider.
                  latitude = location.getLatitude();
                  longtitude = location.getLongitude();
                  Log.i("mike",Double.toString(latitude));
                  Log.i("mike",Double.toString(longtitude));
                  LatLng here = new LatLng(latitude, longtitude);
                  LatLng sydney = new LatLng(-34, 151);
                  mMap.addMarker(new MarkerOptions().position(sydney).title("Marker in Sydney"));
                  mMap.addMarker(new MarkerOptions().position(here).title("My Current Position")
                          .snippet("Population: 4,137,400")
                          .icon(BitmapDescriptorFactory.fromResource(R.drawable.ic_launcher)) );
                  // Add a marker in Sydney and move the camera
  
                  mMap.moveCamera(CameraUpdateFactory.newLatLng(sydney));
              }
  
              public void onStatusChanged(String provider, int status, Bundle extras) {}
  
              public void onProviderEnabled(String provider) {}
  
              public void onProviderDisabled(String provider) {}
          };
  
          /*try {
              // Register the listener with the Location Manager to receive location updates
              if (android.os.Build.VERSION.SDK_INT &gt;= Build.VERSION_CODES.M) {
                  ActivityCompat.requestPermissions(MapsActivity.this,new String[]{android.Manifest.permission.ACCESS_COARSE_LOCATION, android.Manifest.permission.ACCESS_FINE_LOCATION},1337);
              }
  
              locationManager.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, 0, 0, locationListener);
          }catch(SecurityException se){
              Log.e("Mike1", se.getMessage());
              se.printStackTrace();
          }*/
  
  
      }
  }
  </code></pre>
  
  <p>layout file:</p>
  
  <pre><code>&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:tools="http://schemas.android.com/tools"
      android:layout_width="match_parent"
      android:layout_height="match_parent"
      tools:context="${relativePackage}.${activityClass}" &gt;
  
      &lt;fragment
          android:id="@+id/map"
          android:name="com.google.android.gms.maps.MapFragment"
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          tools:context="my1.app.MainActivity" /&gt;
  
  
  &lt;/RelativeLayout&gt;
  </code></pre>
  
  <p>Manifest.xml:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="my1.app"
      android:versionCode="1"
      android:versionName="1.0" &gt;
  
      &lt;uses-sdk
          android:minSdkVersion="18"
          android:targetSdkVersion="18" /&gt;
  
      &lt;uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /&gt;
      &lt;uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /&gt;
  
      &lt;meta-data
              android:name="com.google.android.geo.API_KEY"
              android:value="thekey" /&gt;
  
      &lt;application
          android:allowBackup="true"
          android:icon="@drawable/ic_launcher"
          android:label="@string/app_name"
          android:theme="@style/AppTheme" &gt;
          &lt;activity
              android:name=".MainActivity"
              android:label="@string/app_name" &gt;
              &lt;intent-filter&gt;
                  &lt;action android:name="android.intent.action.MAIN" /&gt;
  
                  &lt;category android:name="android.intent.category.LAUNCHER" /&gt;
              &lt;/intent-filter&gt;
          &lt;/activity&gt;
      &lt;/application&gt;
  
  &lt;/manifest&gt;
  </code></pre>
  
  <p>i created a lib folder in the project and copied google play services classed.jar that i extracted from google-play-services-maps.aar and i added it to the build path.</p>
  
  <p>Also i changed references to Support and Compat (like SupportMapFragment to MapFragment, AppCompatActivity to Activity etc)</p>
  
  <p>the error i get:</p>
  
  <pre><code>07-22 12:07:46.631: E/AndroidRuntime(14441): FATAL EXCEPTION: main
  07-22 12:07:46.631: E/AndroidRuntime(14441): Process: my1.app, PID: 14441
  07-22 12:07:46.631: E/AndroidRuntime(14441): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{my1.app/my1.app.MainActivity}: java.lang.ClassNotFoundException: Didn't find class "my1.app.MainActivity" on path: DexPathList[[zip file "/data/app/my1.app-1/base.apk"],nativeLibraryDirectories=[/data/app/my1.app-1/lib/arm, /vendor/lib, /system/lib]]
  07-22 12:07:46.631: E/AndroidRuntime(14441):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2327)
  07-22 12:07:46.631: E/AndroidRuntime(14441):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476)
  07-22 12:07:46.631: E/AndroidRuntime(14441):    at android.app.ActivityThread.-wrap11(ActivityThread.java)
  07-22 12:07:46.631: E/AndroidRuntime(14441):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)
  07-22 12:07:46.631: E/AndroidRuntime(14441):    at android.os.Handler.dispatchMessage(Handler.java:102)
  07-22 12:07:46.631: E/AndroidRuntime(14441):    at android.os.Looper.loop(Looper.java:148)
  07-22 12:07:46.631: E/AndroidRuntime(14441):    at android.app.ActivityThread.main(ActivityThread.java:5417)
  07-22 12:07:46.631: E/AndroidRuntime(14441):    at java.lang.reflect.Method.invoke(Native Method)
  07-22 12:07:46.631: E/AndroidRuntime(14441):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
  07-22 12:07:46.631: E/AndroidRuntime(14441):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
  07-22 12:07:46.631: E/AndroidRuntime(14441): Caused by: java.lang.ClassNotFoundException: Didn't find class "my1.app.MainActivity" on path: DexPathList[[zip file "/data/app/my1.app-1/base.apk"],nativeLibraryDirectories=[/data/app/my1.app-1/lib/arm, /vendor/lib, /system/lib]]
  07-22 12:07:46.631: E/AndroidRuntime(14441):    at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
  07-22 12:07:46.631: E/AndroidRuntime(14441):    at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
  07-22 12:07:46.631: E/AndroidRuntime(14441):    at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
  07-22 12:07:46.631: E/AndroidRuntime(14441):    at android.app.Instrumentation.newActivity(Instrumentation.java:1067)
  07-22 12:07:46.631: E/AndroidRuntime(14441):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2317)
  07-22 12:07:46.631: E/AndroidRuntime(14441):    ... 9 more
  07-22 12:07:46.631: E/AndroidRuntime(14441):    Suppressed: java.lang.NoClassDefFoundError: my1.app.MainActivity
  07-22 12:07:46.631: E/AndroidRuntime(14441):        at dalvik.system.DexFile.defineClassNative(Native Method)
  07-22 12:07:46.631: E/AndroidRuntime(14441):        at dalvik.system.DexFile.defineClass(DexFile.java:226)
  07-22 12:07:46.631: E/AndroidRuntime(14441):        at dalvik.system.DexFile.loadClassBinaryName(DexFile.java:219)
  07-22 12:07:46.631: E/AndroidRuntime(14441):        at dalvik.system.DexPathList.findClass(DexPathList.java:338)
  07-22 12:07:46.631: E/AndroidRuntime(14441):        at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:54)
  07-22 12:07:46.631: E/AndroidRuntime(14441):        ... 13 more
  07-22 12:07:46.631: E/AndroidRuntime(14441):    Suppressed: java.lang.ClassNotFoundException: my1.app.MainActivity
  07-22 12:07:46.631: E/AndroidRuntime(14441):        at java.lang.Class.classForName(Native Method)
  07-22 12:07:46.631: E/AndroidRuntime(14441):        at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
  07-22 12:07:46.631: E/AndroidRuntime(14441):        at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
  07-22 12:07:46.631: E/AndroidRuntime(14441):        at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
  07-22 12:07:46.631: E/AndroidRuntime(14441):        ... 12 more
  07-22 12:07:46.631: E/AndroidRuntime(14441):    Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack trace available
  </code></pre>
  
  <p>What should i do to make it work?</p>