首页 > 解决方案 > 构建失败可能是由于插件中的 AndroidX 不兼容

问题描述

Flutter 应用程序在调试模式下运行良好。发布应用程序时出错。

Running Gradle task 'assembleRelease'...                         1434.8s (!)
The built failed likely due to AndroidX incompatibilities in a plugin. The tool is about to try using Jetfier to solve the incompatibility.
Building plugin android_intent...
Running Gradle task 'assembleAarRelease'...                        93.5s


FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'android_intent'.

我试过的:

  1. 删除了“android_intent”插件。删除后,cloud_firestore 仍然存在相同的问题。
                                                                                                                   
* What went wrong:                                                                                                 
Execution failed for task ':flutter_appavailability:verifyReleaseResources'.                                       
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade                  
   > Android resource linking failed                                                                               
     /home/mkmalik/.gradle/caches/transforms-2/files-2.1/fa16a5b23fa3b0f70fd87fe1ad317210/core-1.1.0/res/values/values.xml:142:5-173:25: AAPT: error: resource android:attr/fontVariationSettings not found.
                                                                                                                   
     /home/mkmalik/.gradle/caches/transforms-2/files-2.1/fa16a5b23fa3b0f70fd87fe1ad317210/core-1.1.0/res/values/values.xml:142:5-173:25: AAPT: error: resource android:attr/ttcIndex not found.
                                                                                                                   
                                                                                                                   
* 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 6m 38s                                                                                             
Running Gradle task 'assembleRelease'...                                                                           
Running Gradle task 'assembleRelease'... Done                     407.1s (!)
The built failed likely due to AndroidX incompatibilities in a plugin. The tool is about to try using Jetfier to solve the
incompatibility.
Building plugin cloud_firestore...
The plugin cloud_firestore could not be built due to the issue above.
  1. 将 Gradle 更新到 4.0.1 并将 compileSdkVersion 更新到 30。并成功发布了应用程序(来自本机代码的 7 个警告)。但在设备上,它会在一秒钟后立即停止(仅白屏)。

颤振 1.22.5

标签: androidfluttergradlegoogle-cloud-firestorerelease

解决方案


问题在于flutter_appavailability。刚刚删除并解决了问题。


推荐阅读