3

私は初心者のAndroidアプリ開発者で、本当に初心者です。Eclipse IDE の xml レイアウトにチェックボックスを作成しようとしましたが、何らかの理由でアプリを実行するとクラッシュします。

リソースが見つかりませんと表示されます。以下はlogcatです:

     03-11 20:39:47.167: E/AndroidRuntime(24934): FATAL EXCEPTION: main
03-11 20:39:47.167: E/AndroidRuntime(24934): Process: com.example.checking, PID: 24934
03-11 20:39:47.167: E/AndroidRuntime(24934): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.checking/com.example.checking.MainActivity}: android.view.InflateException: Binary XML file line #13: Error inflating class android.widget.CheckBox
03-11 20:39:47.167: E/AndroidRuntime(24934):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2200)
03-11 20:39:47.167: E/AndroidRuntime(24934):    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2249)
03-11 20:39:47.167: E/AndroidRuntime(24934):    at android.app.ActivityThread.access$800(ActivityThread.java:141)
03-11 20:39:47.167: E/AndroidRuntime(24934):    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1212)
03-11 20:39:47.167: E/AndroidRuntime(24934):    at android.os.Handler.dispatchMessage(Handler.java:102)
03-11 20:39:47.167: E/AndroidRuntime(24934):    at android.os.Looper.loop(Looper.java:136)
03-11 20:39:47.167: E/AndroidRuntime(24934):    at android.app.ActivityThread.main(ActivityThread.java:5052)
03-11 20:39:47.167: E/AndroidRuntime(24934):    at java.lang.reflect.Method.invokeNative(Native Method)
03-11 20:39:47.167: E/AndroidRuntime(24934):    at java.lang.reflect.Method.invoke(Method.java:515)
03-11 20:39:47.167: E/AndroidRuntime(24934):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
03-11 20:39:47.167: E/AndroidRuntime(24934):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:609)
03-11 20:39:47.167: E/AndroidRuntime(24934):    at dalvik.system.NativeStart.main(Native Method)
03-11 20:39:47.167: E/AndroidRuntime(24934): Caused by: android.view.InflateException: Binary XML file line #13: Error inflating class android.widget.CheckBox
03-11 20:39:47.167: E/AndroidRuntime(24934):    at android.view.LayoutInflater.createView(LayoutInflater.java:623)
03-11 20:39:47.167: E/AndroidRuntime(24934):    at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
03-11 20:39:47.167: E/AndroidRuntime(24934):    at android.view.LayoutInflater.onCreateView(LayoutInflater.java:672)
03-11 20:39:47.167: E/AndroidRuntime(24934):    at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:697)
03-11 20:39:47.167: E/AndroidRuntime(24934):    at android.view.LayoutInflater.rInflate(LayoutInflater.java:758)
03-11 20:39:47.167: E/AndroidRuntime(24934):    at android.view.LayoutInflater.inflate(LayoutInflater.java:495)
03-11 20:39:47.167: E/AndroidRuntime(24934):    at android.view.LayoutInflater.inflate(LayoutInflater.java:400)
03-11 20:39:47.167: E/AndroidRuntime(24934):    at android.view.LayoutInflater.inflate(LayoutInflater.java:353)
03-11 20:39:47.167: E/AndroidRuntime(24934):    at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:290)
03-11 20:39:47.167: E/AndroidRuntime(24934):    at android.app.Activity.setContentView(Activity.java:1946)
03-11 20:39:47.167: E/AndroidRuntime(24934):    at com.example.checking.MainActivity.onCreate(MainActivity.java:13)
03-11 20:39:47.167: E/AndroidRuntime(24934):    at android.app.Activity.performCreate(Activity.java:5248)
03-11 20:39:47.167: E/AndroidRuntime(24934):    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
03-11 20:39:47.167: E/AndroidRuntime(24934):    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2164)
03-11 20:39:47.167: E/AndroidRuntime(24934):    ... 11 more
03-11 20:39:47.167: E/AndroidRuntime(24934): Caused by: java.lang.reflect.InvocationTargetException
03-11 20:39:47.167: E/AndroidRuntime(24934):    at java.lang.reflect.Constructor.constructNative(Native Method)
03-11 20:39:47.167: E/AndroidRuntime(24934):    at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
03-11 20:39:47.167: E/AndroidRuntime(24934):    at android.view.LayoutInflater.createView(LayoutInflater.java:597)
03-11 20:39:47.167: E/AndroidRuntime(24934):    ... 24 more
03-11 20:39:47.167: E/AndroidRuntime(24934): Caused by: android.content.res.Resources$NotFoundException: File res/drawable/abc_btn_check_material.xml from drawable resource ID #0x7f020003
03-11 20:39:47.167: E/AndroidRuntime(24934):    at android.content.res.Resources.loadDrawable(Resources.java:2149)
03-11 20:39:47.167: E/AndroidRuntime(24934):    at android.content.res.MiuiResources.loadDrawable(MiuiResources.java:387)
03-11 20:39:47.167: E/AndroidRuntime(24934):    at android.content.res.Resources.loadDrawable(Resources.java:2072)
03-11 20:39:47.167: E/AndroidRuntime(24934):    at android.content.res.TypedArray.getDrawable(TypedArray.java:602)
03-11 20:39:47.167: E/AndroidRuntime(24934):    at android.widget.CompoundButton.<init>(CompoundButton.java:74)
03-11 20:39:47.167: E/AndroidRuntime(24934):    at android.widget.CheckBox.<init>(CheckBox.java:68)
03-11 20:39:47.167: E/AndroidRuntime(24934):    at android.widget.CheckBox.<init>(CheckBox.java:64)
03-11 20:39:47.167: E/AndroidRuntime(24934):    ... 27 more
03-11 20:39:47.167: E/AndroidRuntime(24934): Caused by: android.content.res.Resources$NotFoundException: File res/drawable-v11/abc_btn_checkbox_checked_mtrl.xml from drawable resource ID #0x7f020004
03-11 20:39:47.167: E/AndroidRuntime(24934):    at android.content.res.Resources.loadDrawable(Resources.java:2149)
03-11 20:39:47.167: E/AndroidRuntime(24934):    at android.content.res.MiuiResources.loadDrawable(MiuiResources.java:387)
03-11 20:39:47.167: E/AndroidRuntime(24934):    at android.content.res.Resources.loadDrawable(Resources.java:2072)
03-11 20:39:47.167: E/AndroidRuntime(24934):    at android.content.res.Resources.getDrawable(Resources.java:710)
03-11 20:39:47.167: E/AndroidRuntime(24934):    at android.graphics.drawable.StateListDrawable.inflate(StateListDrawable.java:176)
03-11 20:39:47.167: E/AndroidRuntime(24934):    at android.graphics.drawable.Drawable.createFromXmlInner(Drawable.java:939)
03-11 20:39:47.167: E/AndroidRuntime(24934):    at android.graphics.drawable.Drawable.createFromXml(Drawable.java:879)
03-11 20:39:47.167: E/AndroidRuntime(24934):    at android.content.res.Resources.createFromXml(Resources.java:2525)
03-11 20:39:47.167: E/AndroidRuntime(24934):    at android.content.res.Resources.loadDrawable(Resources.java:2145)
03-11 20:39:47.167: E/AndroidRuntime(24934):    ... 33 more
03-11 20:39:47.167: E/AndroidRuntime(24934): Caused by: org.xmlpull.v1.XmlPullParserException: Binary XML file line #17: invalid drawable tag vector
03-11 20:39:47.167: E/AndroidRuntime(24934):    at android.graphics.drawable.Drawable.createFromXmlInner(Drawable.java:9

誰かがこれを修正するのを手伝ってくれますか?

4

3 に答える 3

1

Android Design Support Library (com.android.support:design) を 23.2.0 から 23.2.1 にアップグレードすると、問題が解決する場合があります。

于 2016-03-29T16:07:28.977 に答える
0

Upgrade support library to last version (23).

This exception it cause by android.content.res.Resources$NotFoundException: File res/drawable/abc_btn_check_material.xml, this is an element from last version of support library

I think you must migrate to AndroidStudio if you are beginner on Android, Eclipse stopped having support google in December 2015

PD: sorry for my english

于 2016-03-11T15:31:36.847 に答える