title: Android Maps API: Failed resolving interface
body: <p>I implemented a map method using the Google Maps API. Yesterday, it was working fine. Since then, I've made absolutely no changes whatsoever to eclipse, any map related method (including views and the MapActivity class) or anything in the its corresponding entry in the manifest - the only thing I changed was to add a splash screen, thereby changing the launcher activity from MyLITactivity to SplashActivity.</p>
  
  <p>My API key is in the manifest, and I've included the uses-library entry in the manifest. </p>
  
  <p>When I run the app, logcat shows this:</p>
  
  <pre><code>05-06 16:12:04.855: I/dalvikvm(753): Failed resolving Lcom/mad/mylit/MapActivity; interface 486 'Lcom/google/android/gms/maps/GoogleMap$OnMapClickListener;'
  05-06 16:12:04.855: W/dalvikvm(753): Link of class 'Lcom/mad/mylit/MapActivity;' failed
  05-06 16:12:04.855: E/dalvikvm(753): Could not find class 'com.mad.mylit.MapActivity', referenced from method com.mad.mylit.MyLITactivity.startMaps
  05-06 16:12:04.855: W/dalvikvm(753): VFY: unable to resolve const-class 495 (Lcom/mad/mylit/MapActivity;) in Lcom/mad/mylit/MyLITactivity;
  05-06 16:12:04.855: D/dalvikvm(753): VFY: replacing opcode 0x1c at 0x0002
  </code></pre>
  
  <p>My manifest:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="com.mad.mylit"
      android:installLocation="auto"
      android:versionCode="1"
      android:versionName="1.0" &gt;
  
      &lt;uses-sdk
          android:minSdkVersion="10"
          android:targetSdkVersion="17" /&gt;
  
      &lt;uses-permission android:name="android.permission.INTERNET" /&gt;
      &lt;uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /&gt;
      &lt;uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /&gt;
      &lt;uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" /&gt;
      &lt;uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /&gt;
      &lt;uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /&gt;
  
      &lt;uses-feature
          android:glEsVersion="0x00020000"
          android:required="true" /&gt;
  
      &lt;application
          android:allowBackup="true"
          android:icon="@drawable/lit_logo"
          android:label="@string/app_name"
          android:theme="@style/Theme.litac" &gt;
          &lt;activity
              android:name="com.mad.mylit.MyLITactivity"
              android:label="@string/app_name"
              android:theme="@style/Theme.litac" &gt;
          &lt;/activity&gt;
          &lt;activity
              android:name="com.mad.mylit.ItemListActivity"
              android:label="@string/title_item_list" &gt;
          &lt;/activity&gt;
          &lt;activity
              android:name="com.mad.mylit.ItemDetailActivity"
              android:label="@string/title_item_detail"
              android:parentActivityName=".ItemListActivity" &gt;
              &lt;meta-data
                  android:name="android.support.PARENT_ACTIVITY"
                  android:value=".ItemListActivity" /&gt;
          &lt;/activity&gt;
          &lt;activity
              android:name="com.mad.mylit.NewsDetailFragment"
              android:label="@string/title_activity_news_detail_fragment" &gt;
          &lt;/activity&gt;
          &lt;activity
              android:name="com.mad.mylit.NewsListFragment"
              android:label="@string/title_activity_news_list_fragment" &gt;
          &lt;/activity&gt;
          &lt;activity
              android:name="com.mad.mylit.NewsActivity"
              android:label="@string/title_activity_news" &gt;
          &lt;/activity&gt;
          &lt;activity
              android:name="com.mad.mylit.DetailActivity"
              android:label="SU News" &gt;
          &lt;/activity&gt;
          &lt;activity
              android:name="com.mad.mylit.TimetableActivity"
              android:label="@string/title_activity_timetable" &gt;
          &lt;/activity&gt;
          &lt;activity
              android:name="com.mad.mylit.MoodleActivity"
              android:label="@string/title_activity_moodle" &gt;
          &lt;/activity&gt;
          &lt;activity
              android:name="com.mad.mylit.SplashActivity"
              android:configChanges="orientation|keyboardHidden|screenSize"
              android:label="@string/app_name"
              android:theme="@style/FullscreenTheme" &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;uses-library android:name="com.google.android.maps" /&gt;
  
          &lt;meta-data
              android:name="com.google.android.maps.v2.API_KEY"
              android:value="xxxxxxxxxxxxxxxxxxxxx" /&gt;
  
          &lt;activity
              android:name="com.mad.mylit.MapActivity"
              android:label="@string/title_activity_map"
              android:parentActivityName="com.mad.mylit.MyLITactivity" &gt;
              android:theme="@style/Theme.litac"
              android:uiOptions="splitActionBarWhenNarrow" &gt;
              &lt;meta-data
                  android:name="android.support.PARENT_ACTIVITY"
                  android:value="com.mad.mylit.MyLITactivity" /&gt;
          &lt;/activity&gt;
  
  
      &lt;/application&gt;
  
  &lt;/manifest&gt;
  </code></pre>
  
  <p>MapActivity:</p>
  
  <pre><code>public class MapActivity extends FragmentActivity implements OnMapClickListener, OnMapLongClickListener{
  
      final int RQS_GooglePlayServices = 1;
      private GoogleMap myMap;
  
      Location myLocation;
      LocationManager locationManager;
      String provider;
  
      OnLocationChangedListener myLocationListener = null;
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_maps);
          setupActionBar();
  
          android.support.v4.app.FragmentManager myFragmentManager = getSupportFragmentManager();
          SupportMapFragment mySupportMapFragment = (SupportMapFragment)myFragmentManager.findFragmentById(R.id.map);
          myMap = mySupportMapFragment.getMap();
  
          myMap.setMyLocationEnabled(true);
  
          myMap.setMapType(GoogleMap.MAP_TYPE_HYBRID);
          myMap.setOnMapClickListener(this);
          myMap.setOnMapLongClickListener(this);
  
          LocationManager service = (LocationManager) getSystemService(LOCATION_SERVICE);
          boolean enabled = service.isProviderEnabled(LocationManager.GPS_PROVIDER);
          if (!enabled) {
              startActivity(new Intent(android.provider.Settings.ACTION_LOCATION_SOURCE_SETTINGS));
          }
      }
  
      public void activate(OnLocationChangedListener listener) {
          myLocationListener = listener;  
      }
  
      public void deactivate() {
          myLocationListener = null;
      }
  
  
      private void setupActionBar() {
          getActionBar().setDisplayHomeAsUpEnabled(true);
      }
  
      @Override
      public boolean onCreateOptionsMenu(Menu menu) {
          // Inflate the menu; this adds items to the action bar if it is present.
          getMenuInflater().inflate(R.menu.maps, menu);
          return true;
      }
  
      @Override
      public boolean onOptionsItemSelected(MenuItem item) {
          switch (item.getItemId()) {
          case android.R.id.home:
              NavUtils.navigateUpFromSameTask(this);
              return true;
          case R.id.menu_legalnotices:
              String LicenseInfo = GooglePlayServicesUtil.getOpenSourceSoftwareLicenseInfo(
                      getApplicationContext());
              AlertDialog.Builder LicenseDialog = new AlertDialog.Builder(MapActivity.this);
              LicenseDialog.setTitle("Legal Notices");
              LicenseDialog.setMessage(LicenseInfo);
              LicenseDialog.show();
              return true;
          case R.id.itemid_1:
              Intent i = new Intent(Intent.ACTION_VIEW, Uri.parse("google.navigation:q=Limerick Institute of Technology, Limerick")); 
              startActivity(i);
              return true;
          case R.id.itemid_2:
              //TODO change to local map of LIT
          }
          return super.onOptionsItemSelected(item);
      }
  
      @Override
      protected void onResume() {
          // TODO Auto-generated method stub
          super.onResume();
  
      }
  
  
      public void onLocationChanged(Location location) {
          myLocationListener.onLocationChanged(location);
          LatLng latlng = new LatLng(location.getLatitude(),location.getLongitude());
          myMap.animateCamera(CameraUpdateFactory.newLatLng(latlng));
      }
  
  
      public void onProviderDisabled(String provider) {
          // TODO Auto-generated method stub
  
      }
  
  
      public void onProviderEnabled(String provider) {
          // TODO Auto-generated method stub
  
      }
  
  
      public void onStatusChanged(String provider, int status, Bundle extras) {
          // TODO Auto-generated method stub
  
      }
  
      @Override
      public void onMapLongClick(LatLng point) {
           //myMap.addMarker(new MarkerOptions().position(point).title(point.toString()));
      }
  
  
      @Override
      public void onMapClick(LatLng point) {
          //myMap.animateCamera(CameraUpdateFactory.newLatLng(point));        
      }
  
  }
  </code></pre>
  
  <p>If I comment out the OnMapClickListener and OnMapLongClickListener implements (and their corresponding methods) the error disappears.</p>