2012-04-26 74 views
1

我想讓谷歌地圖爲我的項目工作,但我一直在獲取下面的錯誤。Android谷歌地圖發展錯誤

-04-26 18:18:13.088: E/AndroidRuntime(430): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.googlemaps/com.googlemaps.HelloGoogleMaps}: java.lang.ClassNotFoundException: com.googlemaps.HelloGoogleMaps in loader dalvik.system.PathClassLoader[/system/framework/com.google.android.maps.jar:/data/app/com.googlemaps-2.apk] 
-04-26 18:18:13.088: E/AndroidRuntime(430):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1569) 
-04-26 18:18:13.088: E/AndroidRuntime(430):  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663) 
-04-26 18:18:13.088: E/AndroidRuntime(430):  at android.app.ActivityThread.access$1500(ActivityThread.java:117) 
-04-26 18:18:13.088: E/AndroidRuntime(430):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931) 
-04-26 18:18:13.088: E/AndroidRuntime(430):  at android.os.Handler.dispatchMessage(Handler.java:99) 
-04-26 18:18:13.088: E/AndroidRuntime(430):  at android.os.Looper.loop(Looper.java:130) 
-04-26 18:18:13.088: E/AndroidRuntime(430):  at android.app.ActivityThread.main(ActivityThread.java:3683) 
-04-26 18:18:13.088: E/AndroidRuntime(430):  at java.lang.reflect.Method.invokeNative(Native Method) 
-04-26 18:18:13.088: E/AndroidRuntime(430):  at java.lang.reflect.Method.invoke(Method.java:507) 
-04-26 18:18:13.088: E/AndroidRuntime(430):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839) 
-04-26 18:18:13.088: E/AndroidRuntime(430):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597) 
-04-26 18:18:13.088: E/AndroidRuntime(430):  at dalvik.system.NativeStart.main(Native Method) 
-04-26 18:18:13.088: E/AndroidRuntime(430): Caused by: java.lang.ClassNotFoundException: com.googlemaps.HelloGoogleMaps in loader dalvik.system.PathClassLoader[/system/framework/com.google.android.maps.jar:/data/app/com.googlemaps-2.apk] 
-04-26 18:18:13.088: E/AndroidRuntime(430):  at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:240) 
-04-26 18:18:13.088: E/AndroidRuntime(430):  at java.lang.ClassLoader.loadClass(ClassLoader.java:551) 
-04-26 18:18:13.088: E/AndroidRuntime(430):  at java.lang.ClassLoader.loadClass(ClassLoader.java:511) 
-04-26 18:18:13.088: E/AndroidRuntime(430):  at android.app.Instrumentation.newActivity(Instrumentation.java:1021) 
-04-26 18:18:13.088: E/AndroidRuntime(430):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1561) 

manifest.xml文件。哎呀!您的編輯無法提交,因爲:

您的帖子沒有太多的上下文來解釋代碼段;請更清楚地解釋你的情況。

<?xml version="1.0" encoding="utf-8"?><manifest xmlns:android="http://schemas.android.com/apk/res/android" 
package="com.googlemaps" 
android:versionCode="1" 
android:versionName="1.0" > 

<uses-sdk android:minSdkVersion="10" /> 

<uses-permission android:name="android.permission.INTERNET" /> 

<application> 
    <uses-library android:required="true" android:name="com.google.android.maps" /> 

    <activity 
     android:name=".HelloGoogleMaps" 
     android:label="@string/app_name" 
     android:theme="@android:style/Theme.NoTitleBar" > 
     <intent-filter> 
      <action android:name="android.intent.action.MAIN" /> 

      <category android:name="android.intent.category.LAUNCHER" /> 
     </intent-filter> 
    </activity> 
</application> 

+1

您是否已將「MainActivity」從「MapActivity」擴展爲「Activity」? – MKJParekh 2012-04-26 07:37:12

回答

-1

請mainfest.xml在應用程序中添加此。

<uses-library android:name="com.google.android.maps" /> 
+1

嗨,我已經添加了我的mainfest.xml – 2012-04-26 06:37:48

+0

對不起,格式不正確。這是我第一次使用它。 – 2012-04-26 06:40:23

+0

裏面標籤? – 2012-04-26 06:43:23