Flutter构建在AssemblyDebug期间失败

时间:2019-01-03 04:44:51

标签: android gradle flutter

我该如何解决?这是堆栈:

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:processDebugResources'.
> Android resource linking failed
  Output:  C:\Users\Ali\AndroidStudioProjects\tfh\build\app\intermediates\incremental\mergeDebugResources\merged.dir\values-v28\values-v28.xml:7: error: resource android:attr/dialogCornerRadius not found.
  C:\Users\Ali\AndroidStudioProjects\tfh\build\app\intermediates\incremental\mergeDebugResources\merged.dir\values-v28\values-v28.xml:11: error: resource android:attr/dialogCornerRadius not found.
  C:\Users\Ali\AndroidStudioProjects\tfh\build\app\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:905: error: resource android:attr/fontVariationSettings not found.
  C:\Users\Ali\AndroidStudioProjects\tfh\build\app\intermediates\incremental\mergeDebugResources\merged.dir\values\values.xml:905: error: resource android:attr/ttcIndex not found.
  error: failed linking references.

>Command: C:\Users\Ali\.gradle\caches\transforms-1\files-1.1\aapt2-3.2.1-4818971-windows.jar\8bbb7e03ab759bd8ca76cc69e4ba7bdb\aapt2-3.2.1-4818971-windows\aapt2.exe link -I\
          C:\Users\Ali\AppData\Local\Android\sdk\platforms\android-27\android.jar\
          --manifest\
          C:\Users\Ali\AndroidStudioProjects\tfh\build\app\intermediates\merged_manifests\debug\processDebugManifest\merged\AndroidManifest.xml\
          -o\
          C:\Users\Ali\AndroidStudioProjects\tfh\build\app\intermediates\processed_res\debug\processDebugResources\out\resources-debug.ap_\
          -R\
          @C:\Users\Ali\AndroidStudioProjects\tfh\build\app\intermediates\incremental\processDebugResources\resources-list-for-resources-debug.ap_.txt\
          --auto-add-overlay\
          --java\
          C:\Users\Ali\AndroidStudioProjects\tfh\build\app\generated\not_namespaced_r_class_sources\debug\processDebugResources\r\
          --custom-package\
          com.rookieplays.tfh\
          -0\
          apk\
          --output-text-symbols\
          >C:\Users\Ali\AndroidStudioProjects\tfh\build\app\intermediates\symbols\debug\R.txt\
          --no-version-vectors
  Daemon:  AAPT2 aapt2-3.2.1-4818971-windows Daemon #0
  Output:  C:\Users\Ali\.gradle\caches\transforms-1\files-1.1\appcompat-1.0.0.aar\66e5e056aef50152b37ccffb9f02cd12\res\values-v28\values-v28.xml:9:5-12:13: AAPT: error: resource android:attr/dialogCornerRadius not found.

  >C:\Users\Ali\AndroidStudioProjects\tfh\build\app\intermediates\incremental\mergeDebugResources\merged.dir\values-v28\values-v28.xml:11: AAPT: error: resource android:attr/dialogCornerRadius not found.

>C:\Users\Ali\.gradle\caches\transforms-1\files-1.1\core-1.0.0.aar\874efade1fcfdf5a978404c98345b82f\res\values\values.xml:89:5-125:25: AAPT: error: resource android:attr/fontVariationSettings not found.

>C:\Users\Ali\.gradle\caches\transforms-1\files-1.1\core-1.0.0.aar\874efade1fcfdf5a978404c98345b82f\res\values\values.xml:89:5-125:25: AAPT: error: resource android:attr/ttcIndex not found.

>error: failed linking references.
>Command: C:\Users\Ali\.gradle\caches\transforms-1\files-1.1\aapt2-3.2.1-4818971-windows.jar\8bbb7e03ab759bd8ca76cc69e4ba7bdb\aapt2-3.2.1-4818971-windows\aapt2.exe link -I\
          C:\Users\Ali\AppData\Local\Android\sdk\platforms\android-27\android.jar\
          --manifest\
          >C:\Users\Ali\AndroidStudioProjects\tfh\build\app\intermediates\merged_manifests\debug\processDebugManifest\merged\AndroidManifest.xml\
          -o\
          >C:\Users\Ali\AndroidStudioProjects\tfh\build\app\intermediates\processed_res\debug\processDebugResources\out\resources-debug.ap_\
          -R\
          >@C:\Users\Ali\AndroidStudioProjects\tfh\build\app\intermediates\incremental\processDebugResources\resources-list-for-resources-debug.ap_.txt\
          --auto-add-overlay\
          --java\
          >C:\Users\Ali\AndroidStudioProjects\tfh\build\app\generated\not_namespaced_r_class_sources\debug\processDebugResources\r\
          --custom-package\
          com.rookieplays.tfh\
          -0\
          apk\
          --output-text-symbols\
          >C:\Users\Ali\AndroidStudioProjects\tfh\build\app\intermediates\symbols\debug\R.txt\
          --no-version-vectors
  Daemon:  AAPT2 aapt2-3.2.1-4818971-windows 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 1m 5s
Finished with error: Gradle task assembleDebug failed with exit code 1

1 个答案:

答案 0 :(得分:2)

看起来您使用的是支持库版本28(或依赖于该库的其他库),但是编译SDK为27。

从支持库版本28(仅在SDK 28中添加)中的values-v28引用的这些属性。将编译SDK级别升级到28,它应该可以编译。