RuntimeException-- Please configure your build for VectorDrawableCompat问题
2016-10-26 09:44
573 查看
问题描述:新建了一个android工程,生成的gradle中的内容是
问题:Caused by: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.
运行apk后的异常是:
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): at Android.support.v7.widget.AppCompatDrawableManager.checkVectorDrawableSetup(AppCompatDrawableManager.java:692)
产生的原因是:com.android.support:appcompat-v7与rasterized vectors不兼容,gradle2.0及其之上,library的资源没有栅格化,所以不会发生这个问题
解决方法:
(1)将build.gradle中的版本改为2.0.0,如下图红框所示。
(2)选择工具栏上的Tools->Android->Sync Project with Gradle Files,同步一下Gradle, 此时会在控制台出错如下错误:
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
(3)此刻我们需要修改你的项目下的 \gradle\wrapper\gradle-wrapper.properties文件,将Gradle的版本改为2.10,如下图所示:
(4)点击工具栏上的File->Settings...->Build,Execution,Deployment->Build Tools->Gradle,查看Gradle home的路径是否是gradle-2.10,如果是则就可以运行程序了。
如果不是gradle-2.10,但已经下载了gradle-2.10.zip,将路径指向它,然后就可以运行程序了。
如果没下载,则需要下载gradle-2.10.zip,点击android stdio下面的Terminal,输入gradlew回车,android stdio会自动下载gradle-2.10.zip,如下图所示:
下载的gradle-2.10.zip会被保存到C:\Users\name.xing\.gradle\wrapper\dists\gradle-2.10-all\a4w5fzrkeut1ox71xslb49gst\gradle-2.10
需要将gradle-2.10复制到android stdio安装路径的gradle目录下,最后点击工具栏上的File->Settings...->Build,Execution,Deployment->Build Tools->Gradle,将Gradle home的路径修改为gradle-2.10的路径。
(5)运行程序,大功告成。
问题:Caused by: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.
</pre><pre name="code" class="html">android { compileSdkVersion 24 buildToolsVersion "23.0.3" defaultConfig { applicationId "com.test.rx" minSdkVersion 7 targetSdkVersion 24 versionCode 1 versionName "1.0" } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } }
运行apk后的异常是:
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): at Android.support.v7.widget.AppCompatDrawableManager.checkVectorDrawableSetup(AppCompatDrawableManager.java:692)
产生的原因是:com.android.support:appcompat-v7与rasterized vectors不兼容,gradle2.0及其之上,library的资源没有栅格化,所以不会发生这个问题
解决方法:
(1)将build.gradle中的版本改为2.0.0,如下图红框所示。
(2)选择工具栏上的Tools->Android->Sync Project with Gradle Files,同步一下Gradle, 此时会在控制台出错如下错误:
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
(3)此刻我们需要修改你的项目下的 \gradle\wrapper\gradle-wrapper.properties文件,将Gradle的版本改为2.10,如下图所示:
(4)点击工具栏上的File->Settings...->Build,Execution,Deployment->Build Tools->Gradle,查看Gradle home的路径是否是gradle-2.10,如果是则就可以运行程序了。
如果不是gradle-2.10,但已经下载了gradle-2.10.zip,将路径指向它,然后就可以运行程序了。
如果没下载,则需要下载gradle-2.10.zip,点击android stdio下面的Terminal,输入gradlew回车,android stdio会自动下载gradle-2.10.zip,如下图所示:
下载的gradle-2.10.zip会被保存到C:\Users\name.xing\.gradle\wrapper\dists\gradle-2.10-all\a4w5fzrkeut1ox71xslb49gst\gradle-2.10
需要将gradle-2.10复制到android stdio安装路径的gradle目录下,最后点击工具栏上的File->Settings...->Build,Execution,Deployment->Build Tools->Gradle,将Gradle home的路径修改为gradle-2.10的路径。
(5)运行程序,大功告成。
相关文章推荐
- Please configure your build for VectorDrawableCompat问题
- Android gradle问题解决: This app has been built with an incorrect configuration. Please configure your build for VectorDrawableCompat
- 导入pullloadmorerecyclerview库出现错误:Please configure your build for VectorDrawableCompat
- 解决问题:IllegalStateException - configure your build for VectorDrawableCompat
- 使用环信开发项目遇到错误提示 configure your build for VectorDrawableCompat
- android真机测试报错:Please configure your build for VectorDrawa
- This app has been built with an incorrect configuration. Please configure your build for VectorDrawa
- This app has been built with an incorrect configuration. Please configure your build for VectorDra
- This app has been built with an incorrect configuration. Please configure your build for VectorDrawa
- This app has been built with an incorrect configuration. Please configure your build for VectorDrawa
- This app has been built with an incorrect configuration. Please configure your build for VectorDrawa
- This app has been built with an incorrect configuration. Please configure your build for VectorDrawa
- This app has been built with an incorrect configuration. Please configure your build for VectorDrawa
- 解决Genymotion模拟器无法使用问题“the file is currupt”,“uable to boot-please use a kernel appropriate for your c
- configure: error: GD build test failed. Please check the config.log for details.
- 不能启动:please use a kernel for your cpu问题解决
- 两台电脑ROS通信,出现Cannot load message class for [/].Are your message build问题解决方法
- linux64位编译php遇到configure: error: GD build test failed. Please check the config.log for details
- You asked for an OpenJDK 7 build but your----Android源码编译之JDK下载问题
- 问题:build test failed. Please check the config.log for details.