尽可能多的我得到以下错误:java.lang.noclassdeffounderror: com.google.android.gms.R$styleable尝试实现Android版地图时.
不知怎的,我一定错过了我做错了什么,因为它不起作用.我首先尝试将google-play-services.lib复制到lib文件夹中,但我看到某处我不应该这样做.
然后我尝试将addon-google_apis-google-8导入为项目,但该项目给出了错误 The import com.google cannot be resolved.
我正在关注Vogella教程:
活动:
SupportMapFragment fm = (SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map);
map = fm.getMap();
//map = ((MapFragment) getFragmentManager().findFragmentById(R.id.map)).getMap();
Marker hamburg = map.addMarker(new MarkerOptions().position(HAMBURG)
.title("Hamburg"));
Marker kiel = map.addMarker(new MarkerOptions()
.position(KIEL)
.title("Kiel")
.snippet("Kiel is cool")
.icon(BitmapDescriptorFactory
.fromResource(R.drawable.btn_logo)));
// Move the camera instantly to hamburg with a zoom of 15.
map.moveCamera(CameraUpdateFactory.newLatLngZoom(HAMBURG, 15));
// Zoom in, animating the camera.
map.animateCamera(CameraUpdateFactory.zoomTo(10), 2000, null);
Run Code Online (Sandbox Code Playgroud)
表现:
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="17" />
<permission
android:name="com.testmap.test.permission.MAPS_RECEIVE"
android:protectionLevel="signature" />
<uses-permission android:name="com.testmap.test.permission.MAPS_RECEIVE" …Run Code Online (Sandbox Code Playgroud) maps android noclassdeffounderror mapfragment supportmapfragment