AppCenter生成错误:Project firebaseauth_web at:没有Android应用程序项目或生成版本未设置为覆盖

AppCenter生成错误:Project firebaseauth_web at:没有Android应用程序项目或生成版本未设置为覆盖,firebase,flutter,gradle,visual-studio-app-center,Firebase,Flutter,Gradle,Visual Studio App Center,我在Flatter中有一个移动项目,我正在尝试在AppCenter上构建它,但我遇到了以下错误: Project firebaseauth_web at : is either no Android app project or build version has not been set to override. Skipping... FAILURE: Build failed with an exception. * Where: Build file '/Users/runner/

我在Flatter中有一个移动项目,我正在尝试在
AppCenter
上构建它,但我遇到了以下错误:

Project firebaseauth_web at : is either no Android app project or build version has not been set to override. Skipping...


FAILURE: Build failed with an exception.

* Where:
Build file '/Users/runner/.pub-cache/hosted/pub.dartlang.org/firebase_auth_web-0.1.3+1/android/build.gradle' line: 22

* What went wrong:
A problem occurred evaluating root project 'firebaseauth_web'.
> Failed to apply plugin [id 'com.android.library']
   > Minimum supported Gradle version is 5.4.1. Current version is 4.10.2. If using the gradle wrapper, try editing the distributionUrl in /Users/runner/.pub-cache/hosted/pub.dartlang.org/firebase_auth_web-0.1.3+1/android/gradle/wrapper/gradle-wrapper.properties to gradle-5.4.1-all.zip

* 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 4s

The plugin firebase_auth_web could not be built due to the issue above.

##[error]The process '/bin/bash' failed with exit code 1
##[error]Bash failed with error: The process '/bin/bash' failed with exit code 1
##[section]Finishing: Post Clone Script
##[section]Starting: Checkout Chofu@master to s
==============================================================================
Task         : Get sources
Description  : Get sources from a repository. Supports Git, TfsVC, and SVN repositories.
Version      : 1.0.0
Author       : Microsoft
Help         : [More Information](https://go.microsoft.com/fwlink/?LinkId=798199)
==============================================================================
Cleaning any cached credential from repository: Chofu (ExternalGit)
##[section]Finishing: Checkout Chofu@master to s
##[section]Starting: Finalize Job
Cleaning up task ***
Start cleaning up orphan processes.
Terminate orphan process: pid (1490) (java)
Terminate orphan process: pid (1470) (java)
Terminate orphan process: pid (1462) (java)
Terminate orphan process: pid (1404) (java)
Terminate orphan process: pid (1289) (adb)
##[section]Finishing: Finalize Job
##[section]Finishing: Build
我的
gradle
版本实际上是
6.1.1

这是我的
gradle包装器。属性
from
android/gradle
code:

...
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip
...
我已尝试将版本更改为
5.4.1
,但出现了类似错误:

FAILURE: Build failed with an exception.


* Where:

Build file '/Users/runner/runners/2.170.1/work/1/s/android/app/build.gradle' line: 24



* What went wrong:

A problem occurred evaluating project ':app'.

> Failed to apply plugin [id 'com.android.internal.version-check']

   > Minimum supported Gradle version is 6.1.1. Current version is 5.4.1. If using the gradle wrapper, try editing the distributionUrl in /Users/runner/runners/2.170.1/work/1/s/android/gradle/wrapper/gradle-wrapper.properties to gradle-6.1.1-all.zip



* 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 18s

Running Gradle task 'assembleRelease'...                           19.8s
Gradle task assembleRelease failed with exit code 1
编辑:

仔细观察后,我发现了另外两个错误:

FAILURE: Build completed with 2 failures.


1: Task failed with an exception.

-----------

* What went wrong:

Execution failed for task ':appcenter:verifyReleaseResources'.

> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade

   > 1 exception was raised by workers:

     com.android.builder.internal.aapt.v2.Aapt2Exception: Android resource linking failed

     /Users/runner/.gradle/caches/transforms-2/files-2.1/469951e99791312bb8bf182873580e29/core-1.1.0/res/values/values.xml:142:5-173:25: AAPT: error: resource android:attr/fontVariationSettings not found.



     /Users/runner/.gradle/caches/transforms-2/files-2.1/469951e99791312bb8bf182873580e29/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.

==============================================================================



2: Task failed with an exception.

-----------

* What went wrong:

Execution failed for task ':appcenter_analytics:verifyReleaseResources'.

> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade

   > 1 exception was raised by workers:

     com.android.builder.internal.aapt.v2.Aapt2Exception: Android resource linking failed

     /Users/runner/.gradle/caches/transforms-2/files-2.1/469951e99791312bb8bf182873580e29/core-1.1.0/res/values/values.xml:142:5-173:25: AAPT: error: resource android:attr/fontVariationSettings not found.



     /Users/runner/.gradle/caches/transforms-2/files-2.1/469951e99791312bb8bf182873580e29/core-1.1.0/res/values/values.xml:142:5-173:25: AAPT: error: resource android:attr/ttcIndex not found.

如果有人能帮助我,我将不胜感激

经过一个月的努力,我找到了解决问题的方法:

  • 我已将gradle版本android/gradle/wrapper/gradle wrapper.properties6.1.1更改为5.6.2。所以我的文件看起来像:
  • 在android/build.gradle中,我将gradle工具版本从4.0.0更改为3.5.0
  • 在android/app/build.gradle中,我在
    lintOptions中添加了
    checkReleaseBuilds false
  • 在android/app/appcenter post clone.sh中,我在发布版本之前添加了两个版本:

  • 我希望这能帮助其他人:)

    经过一个月的努力,我找到了解决问题的方法:

  • 我已将gradle版本android/gradle/wrapper/gradle wrapper.properties6.1.1更改为5.6.2。所以我的文件看起来像:
  • 在android/build.gradle中,我将gradle工具版本从4.0.0更改为3.5.0
  • 在android/app/build.gradle中,我在
    lintOptions中添加了
    checkReleaseBuilds false
  • 在android/app/appcenter post clone.sh中,我在发布版本之前添加了两个版本:
  • 我希望这能帮助其他人:)

    ...
    distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-all.zip
    ...
    
    dependencies {
            classpath 'com.android.tools.build:gradle:3.5.0'
            ...
        }
    
    lintOptions {
            ...
            checkReleaseBuilds false
        }
    
    ...
    # build APK
    flutter build apk --debug
    flutter build apk --profile
    flutter build apk --release
    ...