40 个回复 | 最后更新于 2016-08-08
04-19 14:04:42.419 10770-10770/com.lincanbin.carbonforum E/AndroidRuntime: FATAL EXCEPTION: main Process: com.lincanbin.carbonforum, PID: 10770 java.lang.RuntimeException: Unable to start activity ComponentInfo{com.lincanbin.carbonforum/com.lincanbin.carbonforum.IndexActivity}: android.view.InflateException: Binary XML file line #26: Error inflating class android.support.design.widget.FloatingActionButton at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2279) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2329) at android.app.ActivityThread.access$1100(ActivityThread.java:141) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1242) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:136) at android.app.ActivityThread.main(ActivityThread.java:5290) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:515) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:859) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:675) at dalvik.system.NativeStart.main(Native Method) Caused by: android.view.InflateException: Binary XML file line #26: Error inflating class android.support.design.widget.FloatingActionButton at android.view.LayoutInflater.createView(LayoutInflater.java:640) at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:716) at android.view.LayoutInflater.rInflate(LayoutInflater.java:775) at android.view.LayoutInflater.rInflate(LayoutInflater.java:778) at android.view.LayoutInflater.inflate(LayoutInflater.java:512) at android.view.LayoutInflater.inflate(LayoutInflater.java:409) at android.view.LayoutInflater.inflate(LayoutInflater.java:358) at android.support.v7.app.AppCompatDelegateImplV7.setContentView(AppCompatDelegateImplV7.java:267) at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:129) at com.lincanbin.carbonforum.IndexActivity.onCreate(IndexActivity.java:71) at android.app.Activity.performCreate(Activity.java:5308) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1090) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2243) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2329) at android.app.ActivityThread.access$1100(ActivityThread.java:141) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1242) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:136) at android.app.ActivityThread.main(ActivityThread.java:5290) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:515) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:859) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:675) at dalvik.system.NativeStart.main(Native Method) Caused by: java.lang.reflect.InvocationTargetException at java.lang.reflect.Constructor.constructNative(Native Method) at java.lang.reflect.Constructor.newInstance(Constructor.java:423) at android.view.LayoutInflater.createView(LayoutInflater.java:614) at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:716) at android.view.LayoutInflater.rInflate(LayoutInflater.java:775) at android.view.LayoutInflater.rInflate(LayoutInflater.java:778) at android.view.LayoutInflater.inflate(LayoutInflater.java:512) at android.view.LayoutInflater.inflate(LayoutInflater.java:409) at android.view.LayoutInflater.inflate(LayoutInflater.java:358) at android.support.v7.app.AppCompatDelegateImplV7.setContentView(AppCompatDelegateImplV7.java:267) at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:129) at com.lincanbin.carbonforum.IndexActivity.onCreate(IndexActivity.java:71) at android.app.Activity.performCreate(Activity.java:5308) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1090) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2243) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2329) at android.app.ActivityThread.access$1100(ActivityThread.java:141) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1242) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:136) at android.app.ActivityThread.main(ActivityThread.java:5290) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:515) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:859) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:675) at dalvik.system.NativeStart.main(Native Method) Caused by: android.content.res.Resources$NotFoundException: File res/drawable/ic_add_24dp.xml from drawable resource ID #0x7f02004e at android.content.res.Resources.loadDrawable(Resources.java:2154) at android.content.res.TypedArray.getDrawable(TypedArray.java:650) at android.widget.ImageView.<init>(ImageView.java:129) at android.widget.ImageButton.<init>(ImageButton.java:87) at android.support.v7.widget.AppCompatImageButton.<init>(AppCompatImageButton.java:57) at android.support.design.widget.VisibilityAwareImageButton.<init>(VisibilityAwareImageButton.java:37) at android.support.design.widget.FloatingActionButton.<init>(FloatingActionButton.java:109) at android.support.design.widget.FloatingActionButton.<init>(FloatingActionButton.java:105) at java.lang.reflect.Constructor.constructNative(Native Method) at java.lang.reflect.Constructor.newInstance(Constructor.java:423) at android.view.LayoutInflater.createView(LayoutInflater.java:614) at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:716) at android.view.LayoutInflater.rInflate(LayoutInflater.java:775) at android.view.LayoutInflater.rInflate(LayoutInflater.java:778) at android.view.LayoutInflater.inflate(LayoutInflater.java:512) at android.view.LayoutInflater.inflate(LayoutInflater.java:409) at android.view.LayoutInflater.inflate(LayoutInflater.java:358) at android.support.v7.app.AppCompatDelegateImplV7.setContentView(AppCompatDelegateImplV7.java:267) at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:129) at com.lincanbin.carbonforum.IndexActivity.onCreate(IndexActivity.java:71) at android.app.Activity.performCreate(Activity.java:5308) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1090) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2243) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2329) at android.app.ActivityThread.access$1100(ActivityThread.java:141) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1242) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:136) at android.app.ActivityThread.main(ActivityThread.java:5290) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:515) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:859) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:675) at dalvik.system.NativeStart.main(Native Method) Caused by: org.xmlpull.v1.XmlPullParserException: Binary XML file line #1: invalid drawable tag vector at android.graphics.drawable.Drawable.createFromXmlInner(Drawable.java:933) at android.graphics.drawable.Drawable.createFromXml(Drawable.java:877) at android.content.res.Resources.loadDrawable(Resources.java:2150) at android.content.res.TypedArray.getDrawable(TypedArray.java:650) at android.widget.ImageView.<init>(ImageView.java:129) at android.widget.ImageButton.<init>(ImageButton.java:87) at android.support.v7.widget.AppCompatImageButton.<init>(AppCompatImageButton.java:57) at android.support.design.widget.VisibilityAwareImageButton.<init>(VisibilityAwareImageButton.java:37) at android.support.design.widget.FloatingActionButton.<init>(FloatingActionButton.java:109) at android.support.design.widget.FloatingActionButton.<init>(FloatingActionButton.java:105) at java.lang.reflect.Constructor.constructNative(Native Method) at java.lang.reflect.Constructor.newInstance(Constructor.java:423) at android.view.LayoutInflater.createView(LayoutInflater.java:614) at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:716) at android.view.LayoutInflater.rInflate(LayoutInflater.java:775) at android.view.LayoutInflater.rInflate(LayoutInflater.java:778) at android.view.LayoutInflater.inflate(LayoutInflater.java:512) at android.view.LayoutInflater.inflate(LayoutInflater.java:409) at android.view.LayoutInflater.inflate(LayoutInflater.java:358) at android.support.v7.app.AppCompatDelegateImplV7.setContentView(AppCompatDelegateImplV7.java:267) at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:129) at com.lincanbin.carbonforum.IndexActivity.onCreate(IndexActivity.java:71) at android.app.Activity.performCreate(Activity.java:5308) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1090) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2243) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2329) at android.app.ActivityThread.access$1100(ActivityThread.java:141) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1242) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:136) at android.app.ActivityThread.main(ActivityThread.java:5290) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:515) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:859) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:675) at dalvik.system.NativeStart.main(Native Method)
回复#29 @joye1230 :
https://github.com/lincanbin/Android-Carbon-Forum/blob/master/build.gradle#L8
开你自己的这个文件,看你的gradle版本,如果低于2的话。
用这个:
http://android-developers.blogspot.sg/2016/02/android-support-library-232.html
https://github.com/lincanbin/Android-Carbon-Forum/blob/master/app/build.gradle#L17
// Gradle Plugin 1.5 android { defaultConfig { generatedDensities = [] } // This is handled for you by the 2.0+ Gradle Plugin aaptOptions { additionalParameters "--no-version-vectors" } }
替换掉里面的:
// Gradle Plugin 2.0+ android { defaultConfig { vectorDrawables.useSupportLibrary = true } }
回复#31 @joye1230 :
这样换掉app/build.gradle:
apply plugin: 'com.android.application' android { signingConfigs { } compileSdkVersion 23 buildToolsVersion '23.0.3' defaultConfig { applicationId "com.lincanbin.carbonforum" minSdkVersion 15 multiDexEnabled true targetSdkVersion 23 versionCode 22 versionName '5.0.1' // To disable this functionality (and gain the true advantage and space savings of this Support Library) generatedDensities = [] } // This is handled for you by the 2.0+ Gradle Plugin aaptOptions { additionalParameters "--no-version-vectors" } buildTypes { release { minifyEnabled true proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } productFlavors { } lintOptions { abortOnError false } // http://tools.android.com/tech-docs/new-build-system } dependencies { compile fileTree(include: ['*.jar'], dir: 'libs') compile('com.mikepenz:materialdrawer:4.6.4@aar') { transitive = true } compile 'com.android.support:support-v4:23.2.0' compile 'com.android.support:appcompat-v7:23.2.0' compile 'com.android.support:recyclerview-v7:23.2.0' compile 'com.android.support:cardview-v7:23.2.0' compile 'com.android.support:design:23.2.0' compile 'com.github.bumptech.glide:glide:3.7.0' compile 'de.hdodenhof:circleimageview:2.0.0' compile 'com.mikepenz:google-material-typeface:2.2.0.1@aar' }
登录后方可回帖
回复#19 @joye1230 :
app 和 手机浏览器版,我打算重构了,太折腾了