在低版本里为了引入android material 只要将gradle作以下修改java
targetSdkVersion 21
改为你目前的版本就能够,此时编译通常都没问题,app运行若是有异常并报:android
07-26 14:23:27.882: E/AndroidRuntime(8517): Java.lang.RuntimeException: Unable to start activity ComponentInfo{com.test.rx/com.test.rx.MainActivity}: java.lang.IllegalStateException: This app has been built with an incorrect configuration. Please configure your build for VectorDrawableCompat.
07-26 14:23:27.882: E/AndroidRuntime(8517): Caused by: java.lang.IllegalStateException: This app has been built with an incorrect configuration. Please configure your build for VectorDrawableCompat.
07-26 14:23:27.882: E/AndroidRuntime(8517): atAndroid.support.v7.widget.AppCompatDrawableManager.checkVectorDrawableSetup(AppCompatDrawableManager.javapp
产生的缘由是:com.android.support:appcompat-v7与rasterized vectors不兼容,gradle2.0及其之上,library的资源没有栅格化,因此不会发生这个问题gradle
解决方法:ui
1.在projectgradle中将gradle版本改成2.0或者之上spa
2.此时控制台输出异常:Warning:Gradle version 2.10 is required. Current version is 2.8. If using the gradle wrapper, try editing the distributionUrl in E:\RX\gradle\wrapper\gradle-wrapper.properties to gradle-2.10-all.zip.net
按照路径所指出的地址,找到文件gradle-wrapper.properties,编辑最后一句版本号为日志中所输出的版本日志
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.10-all.zipip
从新运行并安装就能够了ci