I've been beating me head against a wall with this for a few days now. I've read just about every post I can on the topic and nothing seems to get me across the finish line.
Trying to build an app using the Google Play Services Map v2 API.
I've got the API key, no problem.
Here are my bits: MainActivity.java
public class MainActivity extends FragmentActivity
{
GoogleMap googleMap;
@Override
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
int status = GooglePlayServicesUtil.isGooglePlayServicesAvailable(getBaseContext());
if ( status==ConnectionResult.SUCCESS)
{
SupportMapFragment supportMapFragment = (SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map);
googleMap = supportMapFragment.getMap();
}
else
{
int requestCode = 10;
Dialog dialog = GooglePlayServicesUtil.getErrorDialog(status, this, requestCode);
dialog.show();
}
}
@Override
public boolean onCreateOptionsMenu(Menu menu)
{
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.main, menu);
return true;
}
}
activity_main.xml:
<fragment xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/map"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:name="com.google.android.gms.maps.MapFragment"/>
Relevant manifest:
<uses-sdk
android:minSdkVersion="11"
android:targetSdkVersion="17" />
<permission
android:name="com.mcdaniel.mmm4.permission.MAPS_RECEIVE"
android:protectionLevel="signature" />
<uses-permission android:name="com.mcdaniel.mmm4.MAPS_RECEIVE" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.persmission.INTERNET" />
<uses-permission android:name="android.persmission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.persmission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="MY API KEY" />
<uses-feature
android:glEsVersion="0x00020000"
android:required="true" />
I've got past the NoClassDefFound error involving R$styleable, and ClassNotFound of the maps class, but I cannot get past this one.
Regarding the class, I've tried a couple different implementations without luck. This one seems the most explicit. No compile warnings.
My target is android-17 with min of android-11. I've got the library imported (with copy files option), and referenced by my project, and exported too.
Obviously there's something I'm missing. Please help!
Thanks, David