求高手帮忙看看是什么错误啊 一运行就报错
05-08 15:42:00.529: E/AndroidRuntime(574): FATAL EXCEPTION: main05-08 15:42:00.529: E/AndroidRuntime(574): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{org.example.mymap/org.example.mymap.MyMap}: java.lang.ClassNotFoundException: org.example.mymap.MyMap in loader dalvik.system.PathClassLoader[/data/app/org.example.mymap-1.apk]
05-08 15:42:00.529: E/AndroidRuntime(574): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2585)
05-08 15:42:00.529: E/AndroidRuntime(574): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
05-08 15:42:00.529: E/AndroidRuntime(574): at android.app.ActivityThread.access$2300(ActivityThread.java:125)
05-08 15:42:00.529: E/AndroidRuntime(574): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
05-08 15:42:00.529: E/AndroidRuntime(574): at android.os.Handler.dispatchMessage(Handler.java:99)
05-08 15:42:00.529: E/AndroidRuntime(574): at android.os.Looper.loop(Looper.java:123)
05-08 15:42:00.529: E/AndroidRuntime(574): at android.app.ActivityThread.main(ActivityThread.java:4627)
05-08 15:42:00.529: E/AndroidRuntime(574): at java.lang.reflect.Method.invokeNative(Native Method)
05-08 15:42:00.529: E/AndroidRuntime(574): at java.lang.reflect.Method.invoke(Method.java:521)
05-08 15:42:00.529: E/AndroidRuntime(574): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
05-08 15:42:00.529: E/AndroidRuntime(574): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
05-08 15:42:00.529: E/AndroidRuntime(574): at dalvik.system.NativeStart.main(Native Method)
05-08 15:42:00.529: E/AndroidRuntime(574): Caused by: java.lang.ClassNotFoundException: org.example.mymap.MyMap in loader dalvik.system.PathClassLoader[/data/app/org.example.mymap-1.apk]
05-08 15:42:00.529: E/AndroidRuntime(574): at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:243)
05-08 15:42:00.529: E/AndroidRuntime(574): at java.lang.ClassLoader.loadClass(ClassLoader.java:573)
05-08 15:42:00.529: E/AndroidRuntime(574): at java.lang.ClassLoader.loadClass(ClassLoader.java:532)
05-08 15:42:00.529: E/AndroidRuntime(574): at android.app.Instrumentation.newActivity(Instrumentation.java:1021)
05-08 15:42:00.529: E/AndroidRuntime(574): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2577)
05-08 15:42:00.529: E/AndroidRuntime(574): ... 11 more
--------------------编程问答-------------------- 没有找到这个类:org.example.mymap.MyMap
--------------------编程问答-------------------- 是不是在AndroidManifest.xml 文件中,没有声明 MyMap 这个Activity。 --------------------编程问答-------------------- ++ --------------------编程问答-------------------- 你的类org.example.mymap.MyMap没有在AndroidManifest.xml中进行注册~~~ --------------------编程问答-------------------- Caused by: java.lang.ClassNotFoundException: org.example.mymap.MyMap in loader dalvik.system.PathClassLoader[/data/app/org.example.mymap-1.apk]
主要看这句 --------------------编程问答-------------------- 需要在AndroidManifest.xml中,对Activity进行注册。 --------------------编程问答-------------------- <?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.example.mymap"
android:versionCode="1"
android:versionName="1.0" >
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.INTERNET"/>
<application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name" >
<uses-liberary android:name="com.google.android.maps"/>
<activity android:name=".MyMap"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
我注册了啊,大家看看有什么问题吗? --------------------编程问答--------------------
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.example.mymap"
android:versionCode="1"
android:versionName="1.0" >
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.INTERNET"/>
<application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name" >
<uses-liberary android:name="com.google.android.maps"/>
<activity android:name=".MyMap"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
我注册了啊,大家看看有什么问题吗? --------------------编程问答--------------------
我注册了啊
--------------------编程问答-------------------- 不会是activity的packagename不对吧? --------------------编程问答-------------------- 错误找到了 原来是manifest.xml中有一行代码敲错了 <uses-liberary android:name="com.google.android.maps"/> 应该是library 多谢大家
--------------------编程问答-------------------- 楼主,既然解决了,就结贴散分吧。
补充:移动开发 , Android