我正在使用 android 提供的 ADT Bundle,以前我使用带有 ADT 插件的普通 Eclipse,我的应用程序运行良好,但现在使用新的 ADT Bundle 后,我的应用程序在显示启动画面后崩溃。
这是堆栈跟踪:
06-21 19:10:37.913: E/AndroidRuntime(4493): FATAL EXCEPTION: main
06-21 19:10:37.913: E/AndroidRuntime(4493): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.webrich.grealgebra/com.aaa.bbb.activity.MainActivity}: android.view.InflateException: Binary XML file line #2: Error inflating class <unknown>
06-21 19:10:37.913: E/AndroidRuntime(4493): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2063)
06-21 19:10:37.913: E/AndroidRuntime(4493): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2088)
06-21 19:10:37.913: E/AndroidRuntime(4493): at android.app.ActivityThread.access$600(ActivityThread.java:126)
06-21 19:10:37.913: E/AndroidRuntime(4493): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1168)
06-21 19:10:37.913: E/AndroidRuntime(4493): at android.os.Handler.dispatchMessage(Handler.java:99)
06-21 19:10:37.913: E/AndroidRuntime(4493): at android.os.Looper.loop(Looper.java:137)
06-21 19:10:37.913: E/AndroidRuntime(4493): at android.app.ActivityThread.main(ActivityThread.java:4561)
06-21 19:10:37.913: E/AndroidRuntime(4493): at java.lang.reflect.Method.invokeNative(Native Method)
06-21 19:10:37.913: E/AndroidRuntime(4493): at java.lang.reflect.Method.invoke(Method.java:511)
06-21 19:10:37.913: E/AndroidRuntime(4493): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
06-21 19:10:37.913: E/AndroidRuntime(4493): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
06-21 19:10:37.913: E/AndroidRuntime(4493): at dalvik.system.NativeStart.main(Native Method)
06-21 19:10:37.913: E/AndroidRuntime(4493): Caused by: android.view.InflateException: Binary XML file line #2: Error inflating class <unknown>
06-21 19:10:37.913: E/AndroidRuntime(4493): at android.view.LayoutInflater.createView(LayoutInflater.java:606)
06-21 19:10:37.913: E/AndroidRuntime(4493): at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
06-21 19:10:37.913: E/AndroidRuntime(4493): at android.view.LayoutInflater.onCreateView(LayoutInflater.java:653)
06-21 19:10:37.913: E/AndroidRuntime(4493): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:678)
06-21 19:10:37.913: E/AndroidRuntime(4493): at android.view.LayoutInflater.parseInclude(LayoutInflater.java:800)
06-21 19:10:37.913: E/AndroidRuntime(4493): at android.view.LayoutInflater.rInflate(LayoutInflater.java:729)
06-21 19:10:37.913: E/AndroidRuntime(4493): at android.view.LayoutInflater.inflate(LayoutInflater.java:489)
06-21 19:10:37.913: E/AndroidRuntime(4493): at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
06-21 19:10:37.913: E/AndroidRuntime(4493): at android.view.LayoutInflater.inflate(LayoutInflater.java:352)
06-21 19:10:37.913: E/AndroidRuntime(4493): at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:266)
06-21 19:10:37.913: E/AndroidRuntime(4493): at android.app.Activity.setContentView(Activity.java:1881)
06-21 19:10:37.913: E/AndroidRuntime(4493): at com.webrich.base.activity.MainActivity.onCreation(MainActivity.java:50)
06-21 19:10:37.913: E/AndroidRuntime(4493): at com.webrich.base.activity.BaseActivity.onCreate(BaseActivity.java:79)
06-21 19:10:37.913: E/AndroidRuntime(4493): at android.app.Activity.performCreate(Activity.java:4637)
06-21 19:10:37.913: E/AndroidRuntime(4493): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)
06-21 19:10:37.913: E/AndroidRuntime(4493): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2027)
06-21 19:10:37.913: E/AndroidRuntime(4493): ... 11 more
06-21 19:10:37.913: E/AndroidRuntime(4493): Caused by: java.lang.reflect.InvocationTargetException
06-21 19:10:37.913: E/AndroidRuntime(4493): at java.lang.reflect.Constructor.constructNative(Native Method)
06-21 19:10:37.913: E/AndroidRuntime(4493): at java.lang.reflect.Constructor.newInstance(Constructor.java:417)
06-21 19:10:37.913: E/AndroidRuntime(4493): at android.view.LayoutInflater.createView(LayoutInflater.java:586)
06-21 19:10:37.913: E/AndroidRuntime(4493): ... 26 more
06-21 19:10:37.913: E/AndroidRuntime(4493): Caused by: android.content.res.Resources$NotFoundException: File res/drawable-mdpi/navigation_tile_back.xml from drawable resource ID #0x7f020039
06-21 19:10:37.913: E/AndroidRuntime(4493): at android.content.res.Resources.loadDrawable(Resources.java:1923)
06-21 19:10:37.913: E/AndroidRuntime(4493): at android.content.res.TypedArray.getDrawable(TypedArray.java:601)
06-21 19:10:37.913: E/AndroidRuntime(4493): at android.view.View.<init>(View.java:2812)
06-21 19:10:37.913: E/AndroidRuntime(4493): at android.view.ViewGroup.<init>(ViewGroup.java:385)
06-21 19:10:37.913: E/AndroidRuntime(4493): at android.widget.LinearLayout.<init>(LinearLayout.java:174)
06-21 19:10:37.913: E/AndroidRuntime(4493): at android.widget.LinearLayout.<init>(LinearLayout.java:170)
06-21 19:10:37.913: E/AndroidRuntime(4493): ... 29 more
06-21 19:10:37.913: E/AndroidRuntime(4493): Caused by: org.xmlpull.v1.XmlPullParserException: Binary XML file line #2: <bitmap> requires a valid src attribute
06-21 19:10:37.913: E/AndroidRuntime(4493): at android.graphics.drawable.BitmapDrawable.inflate(BitmapDrawable.java:448)
06-21 19:10:37.913: E/AndroidRuntime(4493): at android.graphics.drawable.Drawable.createFromXmlInner(Drawable.java:867)
06-21 19:10:37.913: E/AndroidRuntime(4493): at android.graphics.drawable.Drawable.createFromXml(Drawable.java:804)
06-21 19:10:37.913: E/AndroidRuntime(4493): at android.content.res.Resources.loadDrawable(Resources.java:1920)
06-21 19:10:37.913: E/AndroidRuntime(4493): ... 34 more
但是同一个应用程序在正常的日食中运行良好,请帮助我,我无法弄清楚为什么会这样。
编辑 这里是它找不到的.xml。
<?xml version="1.0" encoding="utf-8"?>
<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
android:adjustViewBounds="true"
android:scaleType="centerInside"
android:src="@drawable/bar"
android:tileMode="repeat" >
</bitmap>