Google マップ アクティビティを実行しようとしていますが、LogCat エラーが発生し、アプリがクラッシュします。APIキーを登録するときにAndroidが提供するコーディングを使用したので、なぜ機能しないのかわかりません。これを解決する助けが必要です。
LogCat
08-10 11:04:38.854: W/dalvikvm(702): Unable to resolve superclass of Lcom/maps/google/Main; (402)
08-10 11:04:38.854: W/dalvikvm(702): Link of class 'Lcom/maps/google/Main;' failed
08-10 11:04:38.854: D/AndroidRuntime(702): Shutting down VM
08-10 11:04:38.854: W/dalvikvm(702): threadid=1: thread exiting with uncaught exception (group=0x40a13300)
08-10 11:04:38.874: E/AndroidRuntime(702): FATAL EXCEPTION: main
08-10 11:04:38.874: E/AndroidRuntime(702): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.maps.google/com.maps.google.Main}: java.lang.ClassNotFoundException: com.maps.google.Main
08-10 11:04:38.874: E/AndroidRuntime(702): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1983)
08-10 11:04:38.874: E/AndroidRuntime(702): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2084)
08-10 11:04:38.874: E/AndroidRuntime(702): at android.app.ActivityThread.access$600(ActivityThread.java:130)
08-10 11:04:38.874: E/AndroidRuntime(702): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1195)
08-10 11:04:38.874: E/AndroidRuntime(702): at android.os.Handler.dispatchMessage(Handler.java:99)
08-10 11:04:38.874: E/AndroidRuntime(702): at android.os.Looper.loop(Looper.java:137)
08-10 11:04:38.874: E/AndroidRuntime(702): at android.app.ActivityThread.main(ActivityThread.java:4745)
08-10 11:04:38.874: E/AndroidRuntime(702): at java.lang.reflect.Method.invokeNative(Native Method)
08-10 11:04:38.874: E/AndroidRuntime(702): at java.lang.reflect.Method.invoke(Method.java:511)
08-10 11:04:38.874: E/AndroidRuntime(702): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
08-10 11:04:38.874: E/AndroidRuntime(702): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
08-10 11:04:38.874: E/AndroidRuntime(702): at dalvik.system.NativeStart.main(Native Method)
08-10 11:04:38.874: E/AndroidRuntime(702): Caused by: java.lang.ClassNotFoundException: com.maps.google.Main
08-10 11:04:38.874: E/AndroidRuntime(702): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:61)
08-10 11:04:38.874: E/AndroidRuntime(702): at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
08-10 11:04:38.874: E/AndroidRuntime(702): at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
08-10 11:04:38.874: E/AndroidRuntime(702): at android.app.Instrumentation.newActivity(Instrumentation.java:1053)
08-10 11:04:38.874: E/AndroidRuntime(702): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1974)
08-10 11:04:38.874: E/AndroidRuntime(702): ... 11 more
XML ファイル
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<com.google.android.maps.MapView
android:id="@+id/MView"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:apiKey="02ooeHTBsCB6ez4yyEGFEyiuNCz5hTHubgxBMfg" />
</RelativeLayout>
Java ファイル
package com.maps.google;
import com.google.android.maps.MapActivity;
import com.google.android.maps.MapView;
import android.os.Bundle;
public class Main extends MapActivity {
MapView map;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
map = (MapView)findViewById(R.id.MView);
}
@Override
protected boolean isRouteDisplayed() {
// TODO Auto-generated method stub
return false;
}
}