私はアンドロイド2.33でアプリケーションを作成しました。私はapkv2キーを使用し、すべての手順を実行しましたが、それでもエラーが表示されます
**xml**
<?xml version="1.0" encoding="utf-8"?>
<fragment xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/map"
android:layout_width="match_parent"
android:layout_height="match_parent"
class="com.google.android.gms.maps.MapFragment" />
**Mainfest**
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.Maps.mappv2"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="15" />
<uses-feature
android:glEsVersion="0x00020000"
android:required="true"/>
<permission
android:name="com.Maps.mappv2.permission.MAPS_RECEIVE"
android:protectionLevel="signature"/>
<uses-permission android:name="com.Maps.mappv2.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:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name=".MainActivity"
android:label="@string/title_activity_main" >
<intent-filter >
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="mm" />
</activity>
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="AIzaSyA64MFhpngQBkXP5__fvHeLE0xAXWKwfgU"/>
</application>
</manifest>
**Activity**
public class MainActivity extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
google-play-services jarライブラリファイルを含めましたが、それでも予期せず停止したことが表示されます...
**The error are**
12-22 20:51:59.344: E/Trace(698): error opening trace file: No such file or directory (2)
12-22 20:52:00.165: E/AndroidRuntime(698): FATAL EXCEPTION: main
12-22 20:52:00.165: E/AndroidRuntime(698): java.lang.NoClassDefFoundError: com.google.android.gms.R$styleable
12-22 20:52:00.165: E/AndroidRuntime(698): at com.google.android.gms.maps.GoogleMapOptions.createFromAttributes(Unknown Source)
12-22 20:52:00.165: E/AndroidRuntime(698): at com.google.android.gms.maps.MapFragment.onInflate(Unknown Source)
12-22 20:52:00.165: E/AndroidRuntime(698): at android.app.Activity.onCreateView(Activity.java:4663)
12-22 20:52:00.165: E/AndroidRuntime(698): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:680)
12-22 20:52:00.165: E/AndroidRuntime(698): at android.view.LayoutInflater.inflate(LayoutInflater.java:466)
12-22 20:52:00.165: E/AndroidRuntime(698): at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
12-22 20:52:00.165: E/AndroidRuntime(698): at android.view.LayoutInflater.inflate(LayoutInflater.java:352)
12-22 20:52:00.165: E/AndroidRuntime(698): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:256)
12-22 20:52:00.165: E/AndroidRuntime(698): at android.app.Activity.setContentView(Activity.java:1867)
12-22 20:52:00.165: E/AndroidRuntime(698): at com.Maps.mappv2.MainActivity.onCreate(MainActivity.java:13)
12-22 20:52:00.165: E/AndroidRuntime(698): at android.app.Activity.performCreate(Activity.java:5008)
12-22 20:52:00.165: E/AndroidRuntime(698): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1079)
12-22 20:52:00.165: E/AndroidRuntime(698): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2023)
12-22 20:52:00.165: E/AndroidRuntime(698): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2084)
12-22 20:52:00.165: E/AndroidRuntime(698): at android.app.ActivityThread.access$600(ActivityThread.java:130)
12-22 20:52:00.165: E/AndroidRuntime(698): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1195)
12-22 20:52:00.165: E/AndroidRuntime(698): at android.os.Handler.dispatchMessage(Handler.java:99)
12-22 20:52:00.165: E/AndroidRuntime(698): at android.os.Looper.loop(Looper.java:137)
12-22 20:52:00.165: E/AndroidRuntime(698): at android.app.ActivityThread.main(ActivityThread.java:4745)
12-22 20:52:00.165: E/AndroidRuntime(698): at java.lang.reflect.Method.invokeNative(Native Method)
12-22 20:52:00.165: E/AndroidRuntime(698): at java.lang.reflect.Method.invoke(Method.java:511)
12-22 20:52:00.165: E/AndroidRuntime(698): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
12-22 20:52:00.165: E/AndroidRuntime(698): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
12-22 20:52:00.165: E/AndroidRuntime(698): at dalvik.system.NativeStart.main(Native Method)
12-22 20:52:39.734: E/Trace(724): error opening trace file: No such file or directory (2)
12-22 20:52:40.244: E/AndroidRuntime(724): FATAL EXCEPTION: main
12-22 20:52:40.244: E/AndroidRuntime(724): java.lang.NoClassDefFoundError: com.google.android.gms.R$styleable
12-22 20:52:40.244: E/AndroidRuntime(724): at com.google.android.gms.maps.GoogleMapOptions.createFromAttributes(Unknown Source)
12-22 20:52:40.244: E/AndroidRuntime(724): at com.google.android.gms.maps.MapFragment.onInflate(Unknown Source)
12-22 20:52:40.244: E/AndroidRuntime(724): at android.app.Activity.onCreateView(Activity.java:4663)
12-22 20:52:40.244: E/AndroidRuntime(724): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:680)
12-22 20:52:40.244: E/AndroidRuntime(724): at android.view.LayoutInflater.inflate(LayoutInflater.java:466)
12-22 20:52:40.244: E/AndroidRuntime(724): at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
12-22 20:52:40.244: E/AndroidRuntime(724): at android.view.LayoutInflater.inflate(LayoutInflater.java:352)
12-22 20:52:40.244: E/AndroidRuntime(724): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:256)
12-22 20:52:40.244: E/AndroidRuntime(724): at android.app.Activity.setContentView(Activity.java:1867)
12-22 20:52:40.244: E/AndroidRuntime(724): at com.Maps.mappv2.MainActivity.onCreate(MainActivity.java:13)
12-22 20:52:40.244: E/AndroidRuntime(724): at android.app.Activity.performCreate(Activity.java:5008)
12-22 20:52:40.244: E/AndroidRuntime(724): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1079)
12-22 20:52:40.244: E/AndroidRuntime(724): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2023)
12-22 20:52:40.244: E/AndroidRuntime(724): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2084)
12-22 20:52:40.244: E/AndroidRuntime(724): at android.app.ActivityThread.access$600(ActivityThread.java:130)
12-22 20:52:40.244: E/AndroidRuntime(724): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1195)
12-22 20:52:40.244: E/AndroidRuntime(724): at android.os.Handler.dispatchMessage(Handler.java:99)
12-22 20:52:40.244: E/AndroidRuntime(724): at android.os.Looper.loop(Looper.java:137)
12-22 20:52:40.244: E/AndroidRuntime(724): at android.app.ActivityThread.main(ActivityThread.java:4745)
12-22 20:52:40.244: E/AndroidRuntime(724): at java.lang.reflect.Method.invokeNative(Native Method)
12-22 20:52:40.244: E/AndroidRuntime(724): at java.lang.reflect.Method.invoke(Method.java:511)
12-22 20:52:40.244: E/AndroidRuntime(724): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
12-22 20:52:40.244: E/AndroidRuntime(724): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
12-22 20:52:40.244: E/AndroidRuntime(724): at dalvik.system.NativeStart.main(Native Method)
12-22 20:52:49.084: E/Trace(738): error opening trace file: No such file or directory (2)
12-22 20:52:49.624: E/AndroidRuntime(738): FATAL EXCEPTION: main
12-22 20:52:49.624: E/AndroidRuntime(738): java.lang.NoClassDefFoundError: com.google.android.gms.R$styleable
12-22 20:52:49.624: E/AndroidRuntime(738): at com.google.android.gms.maps.GoogleMapOptions.createFromAttributes(Unknown Source)
12-22 20:52:49.624: E/AndroidRuntime(738): at com.google.android.gms.maps.MapFragment.onInflate(Unknown Source)
12-22 20:52:49.624: E/AndroidRuntime(738): at android.app.Activity.onCreateView(Activity.java:4663)
12-22 20:52:49.624: E/AndroidRuntime(738): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:680)
12-22 20:52:49.624: E/AndroidRuntime(738): at android.view.LayoutInflater.inflate(LayoutInflater.java:466)
12-22 20:52:49.624: E/AndroidRuntime(738): at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
12-22 20:52:49.624: E/AndroidRuntime(738): at android.view.LayoutInflater.inflate(LayoutInflater.java:352)
12-22 20:52:49.624: E/AndroidRuntime(738): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:256)
12-22 20:52:49.624: E/AndroidRuntime(738): at android.app.Activity.setContentView(Activity.java:1867)
12-22 20:52:49.624: E/AndroidRuntime(738): at com.Maps.mappv2.MainActivity.onCreate(MainActivity.java:13)
12-22 20:52:49.624: E/AndroidRuntime(738): at android.app.Activity.performCreate(Activity.java:5008)
12-22 20:52:49.624: E/AndroidRuntime(738): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1079)
12-22 20:52:49.624: E/AndroidRuntime(738): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2023)
12-22 20:52:49.624: E/AndroidRuntime(738): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2084)
12-22 20:52:49.624: E/AndroidRuntime(738): at android.app.ActivityThread.access$600(ActivityThread.java:130)
12-22 20:52:49.624: E/AndroidRuntime(738): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1195)
12-22 20:52:49.624: E/AndroidRuntime(738): at android.os.Handler.dispatchMessage(Handler.java:99)
12-22 20:52:49.624: E/AndroidRuntime(738): at android.os.Looper.loop(Looper.java:137)
12-22 20:52:49.624: E/AndroidRuntime(738): at android.app.ActivityThread.main(ActivityThread.java:4745)
12-22 20:52:49.624: E/AndroidRuntime(738): at java.lang.reflect.Method.invokeNative(Native Method)
12-22 20:52:49.624: E/AndroidRuntime(738): at java.lang.reflect.Method.invoke(Method.java:511)
12-22 20:52:49.624: E/AndroidRuntime(738): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
12-22 20:52:49.624: E/AndroidRuntime(738): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
12-22 20:52:49.624: E/AndroidRuntime(738): at dalvik.system.NativeStart.main(Native Method)