【问题标题】:Flutter Android resource linking failed and Failed to apply plugin [id 'kotlin-android']Flutter Android 资源链接失败,无法应用插件 [id 'kotlin-android']
【发布时间】:2021-06-25 16:22:07
【问题描述】:

2个月后打开一个项目,出现null-safety错误更改了一些插件,并升级了其他插件,一件事导致了另一件事,现在我被这个错误卡住了!

尝试 Flutter clean 并删除 build 和 .gradle 文件夹,但没有任何效果。

    Launching lib\main.dart on RMX1801 in debug mode...
    lib\main.dart:1
    3
    registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)
    
    FAILURE: Build failed with an exception.
    
    * What went wrong:
    Execution failed for task ':app:processDebugResources'.
    > A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
       > Android resource linking failed
         C:\Users\Dell\.gradle\caches\transforms-2\files-2.1\b94a6b46912fba96397655c3d1ce5de0\play-services-ads-lite-19.6.0\AndroidManifest.xml:27:5-38:15: AAPT: error: unexpected element <queries> found in <manifest>.
    
    
    * 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 8m 59s
    The build failed likely due to AndroidX incompatibilities in a plugin. The tool is about to try using Jetifier to solve the incompatibility.
    Building plugin audioplayers...
    Project evaluation failed including an error in afterEvaluate {}. Run with --stacktrace for details of the afterEvaluate {} error.
    
    FAILURE: Build failed with an exception.
* Where:
Build file 'C:\Users\Dell\flutter\.pub-cache\hosted\pub.dartlang.org\audioplayers-0.18.2\android\build.gradle' line: 25

* What went wrong:
A problem occurred evaluating root project 'audioplayers'.
> Failed to apply plugin [id 'kotlin-android']
   > The current Gradle version 4.10.2 is not compatible with the Kotlin Gradle plugin. Please use Gradle 5.3 or newer, or the previous version of the Kotlin plugin.

* 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 54s
2

Exception: The plugin audioplayers could not be built due to the issue above.
Exited (sigterm)

【问题讨论】:

    标签: android flutter kotlin dart gradle


    【解决方案1】:

    您收到了AAPT: error: unexpected element &lt;queries&gt; found in &lt;manifest&gt;.,看来您必须将您的 gradle 版本更新为此处列出的版本之一

    https://github.com/miguelpruivo/flutter_file_picker/wiki/Troubleshooting

    3.3.3

    3.4.3

    3.5.4

    3.6.4

    4.0.1

    由于您使用的是 4.10.2,因此您似乎需要降级您的 gradle 版本

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-02-01
      • 1970-01-01
      • 1970-01-01
      • 2019-03-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多