Android gradle問題解決: This app has been built with an incorrect configuration. Please configure your b

1. 問題描述:java

Android Studio在運行模擬器某些機型或者真機某些機型的時候發生閃退。android

錯誤以下:app

Java.lang.RuntimeException: Unable to start activity ComponentInfo{com.xxx.MainActivity}: java.lang.IllegalStateException: This app has been built with an incorrect configuration. Please configure your build for VectorDrawableCompat.gradle

產生的緣由是:com.android.support:appcompat-v7與rasterized vectors不兼容,gradle2.0及其之上,library的資源沒有柵格化,因此不會發生這個問題ui

 

2. 解決方案:spa

1.在projectgradle中將gradle版本改成2.0或者之上.net

 

 

2. 再次運行,此時控制檯輸出異常:Warning:Gradle version 2.10 is required. Current version is 2.8. If using the gradle wrapper, try editing the distributionUrl in xxx\bbb\gradle-wrapper.properties to gradle-2.10-all.zip日誌

 

按照路徑所指出的地址,找到文件gradle-wrapper.properties,編輯最後一句版本號爲日誌中所輸出的版本blog

 

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

 

3. 再次運行,仍是錯誤,緣由是你尚未下載gradle-2.10

這時能夠從網上下載一個gradle-2.10.zip並解壓,而後放到AndroidStudiodd的默認gradle配置目錄

而後再在AndroidStudio中作一下設置,以下圖

 

 

最後再運行IDE, Ok一切搞定!!

相關文章
相關標籤/搜索