0

我是安卓新手。我修改了这个链接中描述的activity_main.xml。http://developer.android.com/training/basics/firstapp/building-ui.html

当我尝试运行时,AVD 说,不幸的是你的应用程序已经停止工作。

我试图在清单文件中更改 minimumsdk 和 targetsdk 版本,但这没有帮助。

02-01 12:01:25.964: W/Trace(771): Unexpected value from nativeGetEnabledTags: 0
02-01 12:01:25.993: W/Trace(771): Unexpected value from nativeGetEnabledTags: 0
02-01 12:01:26.513: D/AndroidRuntime(771): Shutting down VM
02-01 12:01:26.513: W/dalvikvm(771): threadid=1: thread exiting with uncaught exception (group=0x40a70930)
02-01 12:01:26.523: E/AndroidRuntime(771): FATAL EXCEPTION: main
02-01 12:01:26.523: E/AndroidRuntime(771): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.firstdevapp/com.example.firstdevapp.MainActivity}: android.view.InflateException: Binary XML file line #8: Error inflating class editText
02-01 12:01:26.523: E/AndroidRuntime(771):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2180)
02-01 12:01:26.523: E/AndroidRuntime(771):  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230)
02-01 12:01:26.523: E/AndroidRuntime(771):  at android.app.ActivityThread.access$600(ActivityThread.java:141)
02-01 12:01:26.523: E/AndroidRuntime(771):  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234)
02-01 12:01:26.523: E/AndroidRuntime(771):  at android.os.Handler.dispatchMessage(Handler.java:99)
02-01 12:01:26.523: E/AndroidRuntime(771):  at android.os.Looper.loop(Looper.java:137)
02-01 12:01:26.523: E/AndroidRuntime(771):  at android.app.ActivityThread.main(ActivityThread.java:5039)
02-01 12:01:26.523: E/AndroidRuntime(771):  at java.lang.reflect.Method.invokeNative(Native Method)
02-01 12:01:26.523: E/AndroidRuntime(771):  at java.lang.reflect.Method.invoke(Method.java:511)
02-01 12:01:26.523: E/AndroidRuntime(771):  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
02-01 12:01:26.523: E/AndroidRuntime(771):  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
02-01 12:01:26.523: E/AndroidRuntime(771):  at dalvik.system.NativeStart.main(Native Method)
02-01 12:01:26.523: E/AndroidRuntime(771): Caused by: android.view.InflateException: Binary XML file line #8: Error inflating class editText
02-01 12:01:26.523: E/AndroidRuntime(771):  at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:698)
02-01 12:01:26.523: E/AndroidRuntime(771):  at android.view.LayoutInflater.rInflate(LayoutInflater.java:746)
02-01 12:01:26.523: E/AndroidRuntime(771):  at android.view.LayoutInflater.inflate(LayoutInflater.java:489)
02-01 12:01:26.523: E/AndroidRuntime(771):  at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
02-01 12:01:26.523: E/AndroidRuntime(771):  at android.view.LayoutInflater.inflate(LayoutInflater.java:352)
02-01 12:01:26.523: E/AndroidRuntime(771):  at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:270)
02-01 12:01:26.523: E/AndroidRuntime(771):  at android.app.Activity.setContentView(Activity.java:1881)
02-01 12:01:26.523: E/AndroidRuntime(771):  at com.example.firstdevapp.MainActivity.onCreate(MainActivity.java:12)
02-01 12:01:26.523: E/AndroidRuntime(771):  at android.app.Activity.performCreate(Activity.java:5104)
02-01 12:01:26.523: E/AndroidRuntime(771):  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1080)
02-01 12:01:26.523: E/AndroidRuntime(771):  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2144)
02-01 12:01:26.523: E/AndroidRuntime(771):  ... 11 more
02-01 12:01:26.523: E/AndroidRuntime(771): Caused by: java.lang.ClassNotFoundException: Didn't find class "android.view.editText" on path: /data/app/com.example.firstdevapp-2.apk
02-01 12:01:26.523: E/AndroidRuntime(771):  at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:65)
02-01 12:01:26.523: E/AndroidRuntime(771):  at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
02-01 12:01:26.523: E/AndroidRuntime(771):  at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
02-01 12:01:26.523: E/AndroidRuntime(771):  at android.view.LayoutInflater.createView(LayoutInflater.java:552)
02-01 12:01:26.523: E/AndroidRuntime(771):  at android.view.LayoutInflater.onCreateView(LayoutInflater.java:643)
02-01 12:01:26.523: E/AndroidRuntime(771):  at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:66)
02-01 12:01:26.523: E/AndroidRuntime(771):  at android.view.LayoutInflater.onCreateView(LayoutInflater.java:660)
02-01 12:01:26.523: E/AndroidRuntime(771):  at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:685)
02-01 12:01:26.523: E/AndroidRuntime(771):  ... 21 more
02-01 12:01:29.062: I/Process(771): Sending signal. PID: 771 SIG: 9

谁能帮我找出问题所在?

4

2 回答 2

4

与根本原因相关的行是这一行:

02-01 12:01:26.523: E/AndroidRuntime(771): Caused by: java.lang.ClassNotFoundException: Didn't find class "android.view.editText" on path: /data/app/com.example.firstdevapp-2.apk

我希望在您的布局中,您未能将“e”大写,editText而不是EditText.

于 2013-02-01T23:07:19.970 回答
1

没有你的代码很难说,但从这一行error inflating class editText我猜你忘了<EditText在你的 XML 布局中大写 E

于 2013-02-01T23:06:08.070 回答