Bug如下:07-15 10:02:15.801: E/AndroidRuntime(11690): FATAL EXCEPTION: main
07-15 10:02:15.801: E/AndroidRuntime(11690): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.autohome.club/com.autohome.club.ui.NearbyRidersActivity}: android.view.InflateException: Binary XML file line #30: Error inflating class <unknown>
07-15 10:02:15.801: E/AndroidRuntime(11690): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1664)
07-15 10:02:15.801: E/AndroidRuntime(11690): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1680)
07-15 10:02:15.801: E/AndroidRuntime(11690): at android.app.ActivityThread.access$1500(ActivityThread.java:117)
07-15 10:02:15.801: E/AndroidRuntime(11690): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
07-15 10:02:15.801: E/AndroidRuntime(11690): at android.os.Handler.dispatchMessage(Handler.java:99)
07-15 10:02:15.801: E/AndroidRuntime(11690): at android.os.Looper.loop(Looper.java:130)
07-15 10:02:15.801: E/AndroidRuntime(11690): at android.app.ActivityThread.main(ActivityThread.java:3703)
07-15 10:02:15.801: E/AndroidRuntime(11690): at java.lang.reflect.Method.invokeNative(Native Method)
07-15 10:02:15.801: E/AndroidRuntime(11690): at java.lang.reflect.Method.invoke(Method.java:507)
07-15 10:02:15.801: E/AndroidRuntime(11690): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:866)
07-15 10:02:15.801: E/AndroidRuntime(11690): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:624)
07-15 10:02:15.801: E/AndroidRuntime(11690): at dalvik.system.NativeStart.main(Native Method)
07-15 10:02:15.801: E/AndroidRuntime(11690): Caused by: android.view.InflateException: Binary XML file line #30: Error inflating class <unknown>
07-15 10:02:15.801: E/AndroidRuntime(11690): at android.view.LayoutInflater.createView(LayoutInflater.java:518)
07-15 10:02:15.801: E/AndroidRuntime(11690): at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
07-15 10:02:15.801: E/AndroidRuntime(11690): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:568)
07-15 10:02:15.801: E/AndroidRuntime(11690): at android.view.LayoutInflater.rInflate(LayoutInflater.java:623)
07-15 10:02:15.801: E/AndroidRuntime(11690): at android.view.LayoutInflater.rInflate(LayoutInflater.java:626)
07-15 10:02:15.801: E/AndroidRuntime(11690): at android.view.LayoutInflater.rInflate(LayoutInflater.java:626)
07-15 10:02:15.801: E/AndroidRuntime(11690): at android.view.LayoutInflater.parseInclude(LayoutInflater.java:707)
07-15 10:02:15.801: E/AndroidRuntime(11690): at android.view.LayoutInflater.rInflate(LayoutInflater.java:619)
07-15 10:02:15.801: E/AndroidRuntime(11690): at android.view.LayoutInflater.inflate(LayoutInflater.java:408)
07-15 10:02:15.801: E/AndroidRuntime(11690): at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
07-15 10:02:15.801: E/AndroidRuntime(11690): at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
07-15 10:02:15.801: E/AndroidRuntime(11690): at com.autohome.club.ui.ClubBaseActivity.onCreate(ClubBaseActivity.java:41)
07-15 10:02:15.801: E/AndroidRuntime(11690): at com.autohome.club.ui.NearbyRidersActivity.onCreate(NearbyRidersActivity.java:128)
07-15 10:02:15.801: E/AndroidRuntime(11690): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
07-15 10:02:15.801: E/AndroidRuntime(11690): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1628)
07-15 10:02:15.801: E/AndroidRuntime(11690): ... 11 more
07-15 10:02:15.801: E/AndroidRuntime(11690): Caused by: java.lang.reflect.InvocationTargetException
07-15 10:02:15.801: E/AndroidRuntime(11690): at java.lang.reflect.Constructor.constructNative(Native Method)
07-15 10:02:15.801: E/AndroidRuntime(11690): at java.lang.reflect.Constructor.newInstance(Constructor.java:415)
07-15 10:02:15.801: E/AndroidRuntime(11690): at android.view.LayoutInflater.createView(LayoutInflater.java:505)
07-15 10:02:15.801: E/AndroidRuntime(11690): ... 25 more
07-15 10:02:15.801: E/AndroidRuntime(11690): Caused by: android.content.res.Resources$NotFoundException: File res/drawable-hdpi/scrollbar_handle_vertical.9.png from drawable resource ID #0x7f09007b
07-15 10:02:15.801: E/AndroidRuntime(11690): at android.content.res.Resources.loadDrawable(Resources.java:1744)
07-15 10:02:15.801: E/AndroidRuntime(11690): at android.content.res.TypedArray.getDrawable(TypedArray.java:601)
07-15 10:02:15.801: E/AndroidRuntime(11690): at android.view.View.<init>(View.java:1952)
07-15 10:02:15.801: E/AndroidRuntime(11690): at android.widget.ImageView.<init>(ImageView.java:112)
07-15 10:02:15.801: E/AndroidRuntime(11690): at android.widget.ImageView.<init>(ImageView.java:108)
07-15 10:02:15.801: E/AndroidRuntime(11690): ... 28 more
07-15 10:02:15.801: E/AndroidRuntime(11690): Caused by: java.io.FileNotFoundException: res/drawable-hdpi/scrollbar_handle_vertical.9.png
07-15 10:02:15.801: E/AndroidRuntime(11690): at android.content.res.AssetManager.openNonAssetNative(Native Method)
07-15 10:02:15.801: E/AndroidRuntime(11690): at android.content.res.AssetManager.openNonAsset(AssetManager.java:429)
07-15 10:02:15.801: E/AndroidRuntime(11690): at android.content.res.Resources.loadDrawable(Resources.java:1737)
07-15 10:02:15.801: E/AndroidRuntime(11690): ... 32 more
07-15 10:02:15.801: E/AndroidRuntime(11690): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.autohome.club/com.autohome.club.ui.NearbyRidersActivity}: android.view.InflateException: Binary XML file line #30: Error inflating class <unknown>
07-15 10:02:15.801: E/AndroidRuntime(11690): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1664)
07-15 10:02:15.801: E/AndroidRuntime(11690): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1680)
07-15 10:02:15.801: E/AndroidRuntime(11690): at android.app.ActivityThread.access$1500(ActivityThread.java:117)
07-15 10:02:15.801: E/AndroidRuntime(11690): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
07-15 10:02:15.801: E/AndroidRuntime(11690): at android.os.Handler.dispatchMessage(Handler.java:99)
07-15 10:02:15.801: E/AndroidRuntime(11690): at android.os.Looper.loop(Looper.java:130)
07-15 10:02:15.801: E/AndroidRuntime(11690): at android.app.ActivityThread.main(ActivityThread.java:3703)
07-15 10:02:15.801: E/AndroidRuntime(11690): at java.lang.reflect.Method.invokeNative(Native Method)
07-15 10:02:15.801: E/AndroidRuntime(11690): at java.lang.reflect.Method.invoke(Method.java:507)
07-15 10:02:15.801: E/AndroidRuntime(11690): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:866)
07-15 10:02:15.801: E/AndroidRuntime(11690): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:624)
07-15 10:02:15.801: E/AndroidRuntime(11690): at dalvik.system.NativeStart.main(Native Method)
07-15 10:02:15.801: E/AndroidRuntime(11690): Caused by: android.view.InflateException: Binary XML file line #30: Error inflating class <unknown>
07-15 10:02:15.801: E/AndroidRuntime(11690): at android.view.LayoutInflater.createView(LayoutInflater.java:518)
07-15 10:02:15.801: E/AndroidRuntime(11690): at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
07-15 10:02:15.801: E/AndroidRuntime(11690): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:568)
07-15 10:02:15.801: E/AndroidRuntime(11690): at android.view.LayoutInflater.rInflate(LayoutInflater.java:623)
07-15 10:02:15.801: E/AndroidRuntime(11690): at android.view.LayoutInflater.rInflate(LayoutInflater.java:626)
07-15 10:02:15.801: E/AndroidRuntime(11690): at android.view.LayoutInflater.rInflate(LayoutInflater.java:626)
07-15 10:02:15.801: E/AndroidRuntime(11690): at android.view.LayoutInflater.parseInclude(LayoutInflater.java:707)
07-15 10:02:15.801: E/AndroidRuntime(11690): at android.view.LayoutInflater.rInflate(LayoutInflater.java:619)
07-15 10:02:15.801: E/AndroidRuntime(11690): at android.view.LayoutInflater.inflate(LayoutInflater.java:408)
07-15 10:02:15.801: E/AndroidRuntime(11690): at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
07-15 10:02:15.801: E/AndroidRuntime(11690): at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
07-15 10:02:15.801: E/AndroidRuntime(11690): at com.autohome.club.ui.ClubBaseActivity.onCreate(ClubBaseActivity.java:41)
07-15 10:02:15.801: E/AndroidRuntime(11690): at com.autohome.club.ui.NearbyRidersActivity.onCreate(NearbyRidersActivity.java:128)
07-15 10:02:15.801: E/AndroidRuntime(11690): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
07-15 10:02:15.801: E/AndroidRuntime(11690): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1628)
07-15 10:02:15.801: E/AndroidRuntime(11690): ... 11 more
07-15 10:02:15.801: E/AndroidRuntime(11690): Caused by: java.lang.reflect.InvocationTargetException
07-15 10:02:15.801: E/AndroidRuntime(11690): at java.lang.reflect.Constructor.constructNative(Native Method)
07-15 10:02:15.801: E/AndroidRuntime(11690): at java.lang.reflect.Constructor.newInstance(Constructor.java:415)
07-15 10:02:15.801: E/AndroidRuntime(11690): at android.view.LayoutInflater.createView(LayoutInflater.java:505)
07-15 10:02:15.801: E/AndroidRuntime(11690): ... 25 more
07-15 10:02:15.801: E/AndroidRuntime(11690): Caused by: android.content.res.Resources$NotFoundException: File res/drawable-hdpi/scrollbar_handle_vertical.9.png from drawable resource ID #0x7f09007b
07-15 10:02:15.801: E/AndroidRuntime(11690): at android.content.res.Resources.loadDrawable(Resources.java:1744)
07-15 10:02:15.801: E/AndroidRuntime(11690): at android.content.res.TypedArray.getDrawable(TypedArray.java:601)
07-15 10:02:15.801: E/AndroidRuntime(11690): at android.view.View.<init>(View.java:1952)
07-15 10:02:15.801: E/AndroidRuntime(11690): at android.widget.ImageView.<init>(ImageView.java:112)
07-15 10:02:15.801: E/AndroidRuntime(11690): at android.widget.ImageView.<init>(ImageView.java:108)
07-15 10:02:15.801: E/AndroidRuntime(11690): ... 28 more
07-15 10:02:15.801: E/AndroidRuntime(11690): Caused by: java.io.FileNotFoundException: res/drawable-hdpi/scrollbar_handle_vertical.9.png
07-15 10:02:15.801: E/AndroidRuntime(11690): at android.content.res.AssetManager.openNonAssetNative(Native Method)
07-15 10:02:15.801: E/AndroidRuntime(11690): at android.content.res.AssetManager.openNonAsset(AssetManager.java:429)
07-15 10:02:15.801: E/AndroidRuntime(11690): at android.content.res.Resources.loadDrawable(Resources.java:1737)
07-15 10:02:15.801: E/AndroidRuntime(11690): ... 32 more
07-15 10:02:40.461: E/GexinMainService(11781): clientid is 2fb62a40f5e3f46114530cf788c53dfa
我被这个bug折磨了好一阵,搜索引擎的方法是让你注意 setText() 不要传成int 等等,还有的是Manifest.xml里面的版本号改成8.这些对我来讲全部没用。
File res/drawable-hdpi/scrollbar_handle_vertical.9.png 这个图片工程内根本没有, 清理工程,重新生成.R 都不行。
我教你们个方法吧,就是找到报错时给的资源id,“from drawable resource ID #0x7f09007b“
注意路径是 gen/packagename/ R 这个文件! 从这个里面你肯定能找到 #0x7f09007b 这个值,这样问题就很容易定位了,我这儿是因为在工程的res下有一个valus-800x480,里面有colors.xml 这个里面有一个color在values包下没有这个color值导致的。只要把这个color值直接拷贝到values里面的color.xml即可!