1. 程式人生 > >error: resource android:attr/fontVariationSettings resource android:attr/ttcIndex not found.

error: resource android:attr/fontVariationSettings resource android:attr/ttcIndex not found.

當我執行ionic build android時,出現以下問題。
這裡寫圖片描述

解決這個問題如下:

  • 查詢和替換 com.android.support:support-v4: com.android.support:support-v4:27.1.0 在platform/android目錄裡。
  • 將下面程式碼新增到platforms/android/app/build.gradleplatforms/android/build.gradle 檔案裡。

    configurations.all {
    resolutionStrategy {
        force 'com.android.support:support-v4:27.1.0'
    }}

    Edited to answer “Where is this com.android.support:support-v4:+ setting ?” …

The setting will probably(in this case) be in one of your plugin’s .gradle file in the platform/android/ directory, for example in my case it was the starter-barcodescanner plugin so just go through all your plugins .gradle files :
這裡寫圖片描述