2017-10-26 20 views
29
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 /media/nikhilesh/App/src/main/res/drawable/ic_add_black_24dp.xml : Can't process attribute android:fillColor="@color/green": 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. 

どうすればこの問題を解決できますか?Android Studioを3.0にアップデートしてこの問題を解決しました

defaultConfig{ 
    vectorDrawables.useSupportLibrary = true 
} 

編集:

+0

プロジェクトとrebuilditをクリーニングしてみてください –

答えて

56

あなたはアプリのbuild.gradleのデフォルトの設定内の次の行を追加することができますが、すでに

dependencies { 
    compile 'com.android.support:appcompat-v7:26.1.0' 
} 
8

をしなかった場合にも、この依存関係を追加する必要があります問題は、新しいグラデーションが@ color/green値を取得するために使用するカラーライブラリを参照できないためです。

vectorDrawables.useSupportLibrary = true 

と同じbuild.gradle

compile 'com.android.support:appcompat-v7:23.1.0' 
の依存関係: rotemitzは はちょうどあなたのbuild.gradleのdefaultConfig(アプリモジュール)に次の行を追加したよう

ソリューションは同じです

注:アプリケーション互換バージョンを変更することができます。コンパイルSDKのバージョンを参照してください。

5

あなただけのアプリ build.gradleのあなたのデフォルトの設定内の次の行を追加する必要があります。

defaultConfig{ 
     vectorDrawables.useSupportLibrary = true 
    } 
関連する問題