最近在编译Flutter
项目的时候,报错如下:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 |
FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':app:processDebugResources'. > Android resource linking failed Output: /Users/xxxx/Source/developer_quest/build/app/intermediates/incremental/mergeDebugResources/merged.dir/values/values.xml:86: error: resource android:attr/fontVariationSettings not found. /Users/xxxx/Source/developer_quest/build/app/intermediates/incremental/mergeDebugResources/merged.dir/values/values.xml:87: error: resource android:attr/ttcIndex not found. error: failed linking references. Command: /Users/xxxx/.gradle/caches/transforms-1/files-1.1/aapt2-3.2.1-4818971-osx.jar/ace5a2b7765511437e6add51febae423/aapt2-3.2.1-4818971-osx/aapt2 link -I\ /Users/xxxx/Library/Android/sdk/platforms/android-27/android.jar\ --manifest\ /Users/xxxx/Source/developer_quest/build/app/intermediates/merged_manifests/debug/processDebugManifest/merged/AndroidManifest.xml\ -o\ /Users/xxxx/Source/developer_quest/build/app/intermediates/processed_res/debug/processDebugResources/out/resources-debug.ap_\ -R\ @/Users/xxxx/Source/developer_quest/build/app/intermediates/incremental/processDebugResources/resources-list-for-resources-debug.ap_.txt\ --auto-add-overlay\ --java\ /Users/xxxx/Source/developer_quest/build/app/generated/not_namespaced_r_class_sources/debug/processDebugResources/r\ --custom-package\ dev.flutter.devrpg\ -0\ apk\ --output-text-symbols\ /Users/xxxx/Source/developer_quest/build/app/intermediates/symbols/debug/R.txt\ --no-version-vectors Daemon: AAPT2 aapt2-3.2.1-4818971-osx Daemon #0 Output: /Users/xxxx/.gradle/caches/transforms-1/files-1.1/core-1.1.0.aar/becc1f5b1538f3fe61f1f959fb2bd672/res/values/values.xml:174:5-210:25: AAPT: error: resource android:attr/fontVariationSettings not found. /Users/xxxx/.gradle/caches/transforms-1/files-1.1/core-1.1.0.aar/becc1f5b1538f3fe61f1f959fb2bd672/res/values/values.xml:174:5-210:25: AAPT: error: resource android:attr/ttcIndex not found. error: failed linking references. Command: /Users/xxxx/.gradle/caches/transforms-1/files-1.1/aapt2-3.2.1-4818971-osx.jar/ace5a2b7765511437e6add51febae423/aapt2-3.2.1-4818971-osx/aapt2 link -I\ /Users/xxxx/Library/Android/sdk/platforms/android-27/android.jar\ --manifest\ /Users/xxxx/Source/developer_quest/build/app/intermediates/merged_manifests/debug/processDebugManifest/merged/AndroidManifest.xml\ -o\ /Users/xxxx/Source/developer_quest/build/app/intermediates/processed_res/debug/processDebugResources/out/resources-debug.ap_\ -R\ @/Users/xxxx/Source/developer_quest/build/app/intermediates/incremental/processDebugResources/resources-list-for-resources-debug.ap_.txt\ --auto-add-overlay\ --java\ /Users/xxxx/Source/developer_quest/build/app/generated/not_namespaced_r_class_sources/debug/processDebugResources/r\ --custom-package\ dev.flutter.devrpg\ -0\ apk\ --output-text-symbols\ /Users/xxxx/Source/developer_quest/build/app/intermediates/symbols/debug/R.txt\ --no-version-vectors Daemon: AAPT2 aapt2-3.2.1-4818971-osx Daemon #0 * Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights. * Get more help at https://help.gradle.org BUILD FAILED in 13s Exception: Gradle task assembleDebug failed with exit code 1 |
解决方案:
try to change the compileSdkVersion above 27:
compileSdkVersion 28