1. 程式人生 > >Android Rxjava配合Retrofit的簡單案例使用

Android Rxjava配合Retrofit的簡單案例使用

從GitHub上下載一個專案,匯入Android studio之後報錯。報錯內容如下:

Error:There were multiple failures while executing work items

Error:Execution failed for task ':app:mergeDebugResources'.
> There were multiple failures while executing work items
   > A failure occurred while executing com.android.build.gradle.tasks.MergeResources$FileGenerationWorkAction
      > Error while processing D:\androidProject\KuaiChuan-master\app\src\main\res\drawable\ic_storage_24dp.xml : Can't process attribute android:fillColor="@color/color_storage": references to other resources are not supported by build-time PNG generation. See http://developer.android.com/tools/help/vector-asset-studio.html for details.
   > A failure occurred while executing com.android.build.gradle.tasks.MergeResources$FileGenerationWorkAction
      > Error while processing D:\androidProject\KuaiChuan-master\app\src\main\res\drawable\ic_device_24dp.xml : Can't process attribute android:fillColor="@color/color_device": references to other resources are not supported by build-time PNG generation. See http://developer.android.com/tools/help/vector-asset-studio.html for details.
   > A failure occurred while executing com.android.build.gradle.tasks.MergeResources$FileGenerationWorkAction

   

報錯的截圖如下:

這個bug解決起來也比較簡單,在你的app的build.gradle的defaultConfig中新增如下的程式碼就可以了:

defaultConfig{
   vectorDrawables.useSupportLibrary = true
}
新增完 vectorDrawables.useSupportLibrary = true這行程式碼之後,gradle一下就可以了。

  
如果本文對您有所幫助,麻煩點選一下左側的點贊按鈕,謝謝。
--------------------- 
作者:qq風輕雲淡 
來源:CSDN 
原文:https://blog.csdn.net/qq_36317441/article/details/79320263 
版權宣告:本文為博主原創文章,轉載請附上博文連結!