简体   繁体   English

Firebase_auth 无法在 flutter [firebase_auth: ^0.16.1] 上构建发布 apk

[英]Firebase_auth cannot build release apk on flutter [firebase_auth: ^0.16.1]

Describe the bug Hi, I was working on a project related to Firebase and using the latest version of firebase_auth: ^0.16.1.描述错误嗨,我正在从事与 Firebase 相关的项目,并使用最新版本的 firebase_auth:^0.16.1。 I can't make a release build on this package.我无法在此 package 上发布版本。 The following information on my flutter doctor and error console.以下是关于我的 flutter 医生和错误控制台的信息。

To Reproduce重现

Run flutter build apk --release运行 flutter 构建 apk --release

Expected behavior预期行为

    jerald@IN-81:~/Documents/myown/flutter-game/Flutter-Apps/Hangman$ flutter build apk --release
You are building a fat APK that includes binaries for android-arm, android-arm64, android-x64.
If you are deploying the app to the Play Store, it's recommended to use app bundles or split the APK to reduce the APK size.
    To generate an app bundle, run:
        flutter build appbundle --target-platform android-arm,android-arm64,android-x64
        Learn more on: https://developer.android.com/guide/app-bundle
    To split the APKs per ABI, run:
        flutter build apk --target-platform android-arm,android-arm64,android-x64 --split-per-abi
        Learn more on:  https://developer.android.com/studio/build/configure-apk-splits#configure-abi-split

FAILURE: Build failed with an exception.                                

* Where:                                                                
Build file '/home/jerald/Documents/myown/flutter-game/Flutter-Apps/Hangman/android/app/build.gradle' line: 46

* What went wrong:                                                      
A problem occurred evaluating project ':app'.                           
> Could not find method signingConfig() for arguments [build_c22a35jnh8wqwng2bpwid9s9i$_run_closure2$_closure7@2634cea7] on object of type com.android.build.gradle.internal.dsl.BaseAppModuleExtension.

* 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 5s                                                      
Running Gradle task 'assembleRelease'...                                
Running Gradle task 'assembleRelease'... Done                       7.3s
Gradle task assembleRelease failed with exit code 1
jerald@IN-81:~/Documents/myown/flutter-game/Flutter-Apps/Hangman$ clear
jerald@IN-81:~/Documents/myown/flutter-game/Flutter-Apps/Hangman$ flutter build apk --release
You are building a fat APK that includes binaries for android-arm, android-arm64, android-x64.
If you are deploying the app to the Play Store, it's recommended to use app bundles or split the APK to reduce the APK size.
    To generate an app bundle, run:
        flutter build appbundle --target-platform android-arm,android-arm64,android-x64
        Learn more on: https://developer.android.com/guide/app-bundle
    To split the APKs per ABI, run:
        flutter build apk --target-platform android-arm,android-arm64,android-x64 --split-per-abi
        Learn more on:  https://developer.android.com/studio/build/configure-apk-splits#configure-abi-split

FAILURE: Build failed with an exception.                                

* Where:                                                                
Build file '/home/jerald/Documents/myown/flutter-game/Flutter-Apps/Hangman/android/app/build.gradle' line: 46

* What went wrong:                                                      
A problem occurred evaluating project ':app'.                           
> Could not find method signingConfig() for arguments [build_c22a35jnh8wqwng2bpwid9s9i$_run_closure2$_closure7@47335095] on object of type com.android.build.gradle.internal.dsl.BaseAppModuleExtension.

* 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 0s                                                      
Running Gradle task 'assembleRelease'...                                
Running Gradle task 'assembleRelease'... Done                       1.1s
Gradle task assembleRelease failed with exit code 1
jerald@IN-81:~/Documents/myown/flutter-game/Flutter-Apps/Hangman$ clear
jerald@IN-81:~/Documents/myown/flutter-game/Flutter-Apps/Hangman$ flutter build apk --release
You are building a fat APK that includes binaries for android-arm, android-arm64, android-x64.
If you are deploying the app to the Play Store, it's recommended to use app bundles or split the APK to reduce the APK size.
    To generate an app bundle, run:
        flutter build appbundle --target-platform android-arm,android-arm64,android-x64
        Learn more on: https://developer.android.com/guide/app-bundle
    To split the APKs per ABI, run:
        flutter build apk --target-platform android-arm,android-arm64,android-x64 --split-per-abi
        Learn more on:  https://developer.android.com/studio/build/configure-apk-splits#configure-abi-split

FAILURE: Build failed with an exception.                                

* Where:                                                                
Build file '/home/jerald/Documents/myown/flutter-game/Flutter-Apps/Hangman/android/app/build.gradle' line: 46

* What went wrong:                                                      
A problem occurred evaluating project ':app'.                           
> Could not find method signingConfig() for arguments [build_c22a35jnh8wqwng2bpwid9s9i$_run_closure2$_closure7@7f548c1c] on object of type com.android.build.gradle.internal.dsl.BaseAppModuleExtension.

* 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 0s                                                      
Running Gradle task 'assembleRelease'...                                
Running Gradle task 'assembleRelease'... Done                       1.0s
Gradle task assembleRelease failed with exit code 1
jerald@IN-81:~/Documents/myown/flutter-game/Flutter-Apps/Hangman$ clear
jerald@IN-81:~/Documents/myown/flutter-game/Flutter-Apps/Hangman$ flutter build apk --release
You are building a fat APK that includes binaries for android-arm, android-arm64, android-x64.
If you are deploying the app to the Play Store, it's recommended to use app bundles or split the APK to reduce the APK size.
    To generate an app bundle, run:
        flutter build appbundle --target-platform android-arm,android-arm64,android-x64
        Learn more on: https://developer.android.com/guide/app-bundle
    To split the APKs per ABI, run:
        flutter build apk --target-platform android-arm,android-arm64,android-x64 --split-per-abi
        Learn more on:  https://developer.android.com/studio/build/configure-apk-splits#configure-abi-split
Removed unused resources: Binary resource data reduced from 309KB to 295KB: Removed 4%

FAILURE: Build failed with an exception.                                

* What went wrong:                                                      
Execution failed for task ':screenshot_and_share:verifyReleaseResources'.
> java.util.concurrent.ExecutionException: com.android.builder.internal.aapt.v2.Aapt2Exception: Android resource linking failed
  Output:  /home/jerald/Documents/myown/flutter-game/Flutter-Apps/Hangman/build/screenshot_and_share/intermediates/res/merged/release/values/values.xml:186: error: resource android:attr/fontVariationSettings not found.
  /home/jerald/Documents/myown/flutter-game/Flutter-Apps/Hangman/build/screenshot_and_share/intermediates/res/merged/release/values/values.xml:187: error: resource android:attr/ttcIndex not found.
  error: failed linking references.                                     

Apps/Hangman/build/screenshot_and_share/intermediates/res/compiled/release/values-tr_values-tr.arsc.flat\
          --auto-add-overlay\                                           
          --non-final-ids\                                              
          -0\                                                           
          apk\                                                          
          --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 1m 55s                                                  
Running Gradle task 'assembleRelease'...                                
Running Gradle task 'assembleRelease'... Done                     117.5s
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 firebase_auth...
Running Gradle task 'assembleAarRelease'...                             
Running Gradle task 'assembleAarRelease'... Done                    3.2s


FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'firebase_auth'.
> The SDK directory '/home/jerald/Android/sdk' does not exist.

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


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

flutter Doctor information flutter 医生信息

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, v1.12.13+hotfix.7, on Linux, locale en_IN)

[!] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
    ! Some Android licenses not accepted.  To resolve this, run: flutter doctor --android-licenses
[✓] Android Studio (version 3.6)
[✓] Android Studio (version 4.0)
[✓] VS Code (version 1.36.1)
[✓] Connected device (1 available)

! Doctor found issues in 1 category.

Follow these steps:按着这些次序:

  1. you open flutter doctor and type flutter doctor.您打开 flutter 医生并输入 flutter 医生。

  2. doctor flutter - Android licenses.医生 flutter - Android 许可证。

  3. you get two options y / N, you type Y, you press enter.你得到两个选项y / N,你输入Y,你按回车。

  4. after you leave, OK?离开后,好吗? (y / N) write Y, you press enter. (y / N)写Y,你按回车。

  5. you put Y to everything, accepting everything你把Y放在一切上,接受一切

  6. after accepting you write in the last flutter doctor and wait for the update check in green.接受您在最后一个 flutter 医生中写入后,等待绿色更新检查。

  7. after all that you close the flutter doctor and enter your pubspec.yaml, add the latest version of firebase_auth: ^ 0.16.1 and run it.毕竟你关闭 flutter 医生并输入你的 pubspec.yaml,添加最新版本的 firebase_auth: ^ 0.16.1 并运行它。

I hope it will be of great help.我希望它会有很大的帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM