Flutter Assemble debug linkng error app will not compile, tried everything

时间:2019-01-31 11:15:02

标签: gradle dart flutter

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:processDebugResources'.
> Android resource linking failed
  Output:  /home/ollie2224/StudioProjects/24Hrs/build/app/intermediates/incremental/mergeDebugResources/merged.dir/values-v28/values-v28.xml:7: error: resource android:attr/dialogCornerRadius not found.
  /home/ollie2224/StudioProjects/24Hrs/build/app/intermediates/incremental/mergeDebugResources/merged.dir/values-v28/values-v28.xml:11: error: resource android:attr/dialogCornerRadius not found.
  /home/ollie2224/StudioProjects/24Hrs/build/app/intermediates/incremental/mergeDebugResources/merged.dir/values/values.xml:905: error: resource android:attr/fontVariationSettings not found.
  /home/ollie2224/StudioProjects/24Hrs/build/app/intermediates/incremental/mergeDebugResources/merged.dir/values/values.xml:905: error: resource android:attr/ttcIndex not found.
  error: failed linking references.

  Command: /home/ollie2224/.gradle/caches/transforms-1/files-1.1/aapt2-3.2.1-4818971-linux.jar/5495ad1b91b297bb4c274b380506e4f6/aapt2-3.2.1-4818971-linux/aapt2 link -I\
          /home/ollie2224/Android/Sdk/platforms/android-26/android.jar\
          --manifest\
          /home/ollie2224/StudioProjects/24Hrs/build/app/intermediates/merged_manifests/debug/processDebugManifest/merged/AndroidManifest.xml\
          -o\
          /home/ollie2224/StudioProjects/24Hrs/build/app/intermediates/processed_res/debug/processDebugResources/out/resources-debug.ap_\
          -R\
          @/home/ollie2224/StudioProjects/24Hrs/build/app/intermediates/incremental/processDebugResources/resources-list-for-resources-debug.ap_.txt\
          --auto-add-overlay\
          --java\
          /home/ollie2224/StudioProjects/24Hrs/build/app/generated/not_namespaced_r_class_sources/debug/processDebugResources/r\
          --custom-package\
          com.rookieplays.tf\
          -0\
          apk\
          --output-text-symbols\
          /home/ollie2224/StudioProjects/24Hrs/build/app/intermediates/symbols/debug/R.txt\
          --no-version-vectors
  Daemon:  AAPT2 aapt2-3.2.1-4818971-linux Daemon #0
  Output:  /home/ollie2224/.gradle/caches/transforms-1/files-1.1/appcompat-1.0.0.aar/7ffba96d1618b0c08b4da202d0eddb85/res/values-v28/values-v28.xml:9:5-12:13: AAPT: error: resource android:attr/dialogCornerRadius not found.

  /home/ollie2224/StudioProjects/24Hrs/build/app/intermediates/incremental/mergeDebugResources/merged.dir/values-v28/values-v28.xml:11: AAPT: error: resource android:attr/dialogCornerRadius not found.

  /home/ollie2224/.gradle/caches/transforms-1/files-1.1/core-1.0.0.aar/21a52465ad0e625487952f3012c37e7c/res/values/values.xml:89:5-125:25: AAPT: error: resource android:attr/fontVariationSettings not found.

  /home/ollie2224/.gradle/caches/transforms-1/files-1.1/core-1.0.0.aar/21a52465ad0e625487952f3012c37e7c/res/values/values.xml:89:5-125:25: AAPT: error: resource android:attr/ttcIndex not found.

  error: failed linking references.
  Command: /home/ollie2224/.gradle/caches/transforms-1/files-1.1/aapt2-3.2.1-4818971-linux.jar/5495ad1b91b297bb4c274b380506e4f6/aapt2-3.2.1-4818971-linux/aapt2 link -I\
          /home/ollie2224/Android/Sdk/platforms/android-26/android.jar\
          --manifest\
          /home/ollie2224/StudioProjects/24Hrs/build/app/intermediates/merged_manifests/debug/processDebugManifest/merged/AndroidManifest.xml\
          -o\
          /home/ollie2224/StudioProjects/24Hrs/build/app/intermediates/processed_res/debug/processDebugResources/out/resources-debug.ap_\
          -R\
          @/home/ollie2224/StudioProjects/24Hrs/build/app/intermediates/incremental/processDebugResources/resources-list-for-resources-debug.ap_.txt\
          --auto-add-overlay\
          --java\
          /home/ollie2224/StudioProjects/24Hrs/build/app/generated/not_namespaced_r_class_sources/debug/processDebugResources/r\
          --custom-package\
          com.rookieplays.tf\
          -0\
          apk\
          --output-text-symbols\
          /home/ollie2224/StudioProjects/24Hrs/build/app/intermediates/symbols/debug/R.txt\
          --no-version-vectors
  Daemon:  AAPT2 aapt2-3.2.1-4818971-linux 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 31s
Finished with error: Gradle task assembleDebug failed with exit code 1

1 个答案:

答案 0 :(得分:0)

这看起来像https://github.com/flutter/flutter/issues/27106

您可能更新到最新的插件,但没有迁移到AndroidX然而,这是需要最新的插件版本。

有关更多详细信息,请参见https://github.com/flutter/flutter/issues/27128#issuecomment-458274311

https://developer.android.com/jetpack/androidx/migrate

  

使用Android Studio中3.2和更高的,可以迅速迁移现有项目通过从菜单栏中选择重构>迁移到AndroidX使用AndroidX。

为此,您需要直接https://flutter.io/docs/development/tools/android-studio#android-ide打开项目的-vf目录