为什么在更新后AS要编译项目

时间:2019-05-14 19:10:12

标签: android-studio dart flutter android-gradle

失败:生成失败,发生异常。 刚刚将flutter更新为1.5.4-hotfix.2 现在我的项目无法编译,但是我的同事使用相同版本没有任何问题

控制台输出

Launching lib\main.dart on SM G955F in debug mode...
Initializing gradle...
Resolving dependencies...
Running Gradle task 'assembleDebug'...

FAILURE: Build failed with an exception.

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

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

  D:\Desktop\asdPrj\build\app\intermediates\incremental\mergeDebugResources\merged.dir\values-v28\values-v28.xml:11: AAPT: error: resource android:attr/dialogCornerRadius not found.

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

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

  error: failed linking references.
  Command: C:\Users\Janer\.gradle\caches\transforms-1\files-1.1\aapt2-3.2.1-4818971-windows.jar\78f68b33382372bc3dc84b96fd530582\aapt2-3.2.1-4818971-windows\aapt2.exe link -I\
          C:\Users\Janer\AppData\Local\Android\sdk\platforms\android-27\android.jar\
          --manifest\
          D:\Desktop\asdPrj\build\app\intermediates\merged_manifests\debug\processDebugManifest\merged\AndroidManifest.xml\
          -o\
          D:\Desktop\asdPrj\build\app\intermediates\processed_res\debug\processDebugResources\out\resources-debug.ap_\
          -R\
          @D:\Desktop\asdPrj\build\app\intermediates\incremental\processDebugResources\resources-list-for-resources-debug.ap_.txt\
          --auto-add-overlay\
          --java\
          D:\Desktop\asdPrj\build\app\generated\not_namespaced_r_class_sources\debug\processDebugResources\r\
          --custom-package\
          ga.aninet\
          -0\
          apk\
          --output-text-symbols\
          D:\Desktop\asdPrj\build\app\intermediates\symbols\debug\R.txt\
          --no-version-vectors
  Daemon:  AAPT2 aapt2-3.2.1-4818971-windows Daemon #0
  • 尝试: 使用--stacktrace选项运行以获取堆栈跟踪。使用--info或--debug选项运行以获取更多日志输出。使用--scan运行以获取完整的见解。

  • gradle url

  • 获得更多帮助

5秒内失败 错误完成:Gradle任务assembleDebug失败,退出代码为1


Gradle失败可能是由于此Flutter应用程序中的AndroidX不兼容所致。 有关该问题及其解决方法的更多信息,请参见[googleHref] [2]。


1 个答案:

答案 0 :(得分:0)

在您的项目中执行flutter clean命令,以清除先前编译的缓存中的所有内容