我正在尝试在模拟器中执行 MAP-API 程序
- 我收到日志错误!
- r 有任何逻辑错误
如何解决这些错误
MainActivity.java
public class MainActivity extends FragmentActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
}
显现
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.learnmap"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="12"
android:targetSdkVersion="16" />
<uses-feature
android:glEsVersion="0x00020000"
android:required="true" />
<permission
android:name="net.learn2develop.googlemaps.permission.MAPS_RECEIVE"
android:protectionLevel="signature" />
<uses-permission android:name="net.learn2develop.googlemaps.permission.MAPS_RECEIVE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name="net.learn2develop.googlemaps.MainActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="---key---" />
</application>
</manifest>
日志
10-18 12:33:13.299: D/AndroidRuntime(5516): Shutting down VM
10-18 12:33:13.348: W/dalvikvm(5516): threadid=1: thread exiting with uncaught exception (group=0x40a71930)
10-18 12:33:13.389: E/AndroidRuntime(5516): FATAL EXCEPTION: main
10-18 12:33:13.389: E/AndroidRuntime(5516): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.example.learnmap/net.learn2develop.googlemaps.MainActivity}: