由于 "The option setting 'android.enableR8=false' is deprecated",无法从 flutter 项目中获取 SHA1

Can't get SHA1 from flutter project because of "The option setting 'android.enableR8=false' is deprecated"

我想在我的 android 文件夹中获取带有此评论 gradlew signingReport 的 SHA1。但是我不能。

我的 gradle 版本是 4.0.2。 我试图从 gradle.propertie 文件中删除 android.enableR8=true,但没有任何改变!

gradlew signingReport --scan

的结果
> Configure project :app
WARNING: The option setting 'android.enableR8=false' is deprecated.
It will be removed in version 5.0 of the Android Gradle plugin.
You will no longer be able to disable R8

> Configure project :file_picker
WARNING: The option setting 'android.enableR8=true' is deprecated.
It will be removed in version 5.0 of the Android Gradle plugin.
You will no longer be able to disable R8

FAILURE: Build failed with an exception.

* What went wrong:
Task 'singingReport' not found in root project 'android'. Some candidates are: 'signingReport'.

* Try:
Run gradlew tasks to get a list of available tasks. 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

Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.1.1/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 55s

Publishing a build scan to scans.gradle.com requires accepting the Gradle Terms of Service defined at https://gradle.com/terms-of-service. Do you accept these terms? [yes, no] y
Please enter 'yes' or 'no': yes

Gradle Terms of Service accepted.

Publishing build scan...

gradlew singingReport --scan的结果:

Initialized native services in: C:\Users\Ali Azad\.gradle\native
The client will now receive all logging from the daemon (pid: 6348). The daemon log file: C:\Users\Ali Azad\.gradle\daemon.1.1\daemon-6348.out.log
Starting 7th build in daemon [uptime: 1 hrs 22 mins 57.548 secs, performance: 99%, GC rate: 0.00/s, heap usage: 9% of 1.1 GB]
Using 2 worker leases.
Starting Build
Settings evaluated using settings file 'D:\projects\Flutter Projects\mobile-app\android\settings.gradle'.
Projects loaded. Root project using build file 'D:\projects\Flutter Projects\mobile-app\android\build.gradle'.
Included projects: [root project 'android', project ':app', project ':file_picker', project ':firebase_auth', project ':firebase_core', project ':flutter_plugin_android_lifecycle', project ':flutter_splash_screen', project ':google_maps_flutter', project ':google_sign_in', project ':image_cropper', project ':image_picker', project ':location', project ':shared_preferences', project ':webview_flutter']

> Configure project :
Evaluating root project 'android' using build file 'D:\projects\Flutter Projects\mobile-app\android\build.gradle'.

> Configure project :app
Evaluating project ':app' using build file 'D:\projects\Flutter Projects\mobile-app\android\app\build.gradle'.
WARNING: The option setting 'android.enableR8=false' is deprecated.
It will be removed in version 5.0 of the Android Gradle plugin.
You will no longer be able to disable R8
Creating configuration androidTestUtil
Configuring Java sources compilation with source level 1.8 and target level 1.8.
Configuring Java sources compilation with source level 1.8 and target level 1.8.
Configuring Java sources compilation with source level 1.8 and target level 1.8.
Configuring Java sources compilation with source level 1.8 and target level 1.8.
Configuring Java sources compilation with source level 1.8 and target level 1.8.
Configuring Java sources compilation with source level 1.8 and target level 1.8.
Configuring Java sources compilation with source level 1.8 and target level 1.8.

> Configure project :file_picker
Evaluating project ':file_picker' using build file 'D:\Learning\flutter\flutter_sdk\.pub-cache\hosted\pub.dartlang.org\file_picker-2.0.13\android\build.gradle'.
WARNING: The option setting 'android.enableR8=true' is deprecated.
It will be removed in version 5.0 of the Android Gradle plugin.
You will no longer be able to disable R8
Creating configuration androidTestUtil

> Configure project :firebase_auth
Evaluating project ':firebase_auth' using build file 'D:\Learning\flutter\flutter_sdk\.pub-cache\hosted\pub.dartlang.org\firebase_auth-0.18.3\android\build.gradle'.
Creating configuration androidTestUtil

> Configure project :firebase_core
Evaluating project ':firebase_core' using build file 'D:\Learning\flutter\flutter_sdk\.pub-cache\hosted\pub.dartlang.org\firebase_core-0.5.2\android\build.gradle'.
Creating configuration androidTestUtil

> Configure project :flutter_plugin_android_lifecycle
Evaluating project ':flutter_plugin_android_lifecycle' using build file 'D:\Learning\flutter\flutter_sdk\.pub-cache\hosted\pub.dartlang.org\flutter_plugin_android_lifecycle-1.0.11\android\build.gradle'.
Creating configuration androidTestUtil

> Configure project :flutter_splash_screen
Evaluating project ':flutter_splash_screen' using build file 'D:\Learning\flutter\flutter_sdk\.pub-cache\hosted\pub.dartlang.org\flutter_splash_screen-0.1.0\android\build.gradle'.
Creating configuration androidTestUtil

> Configure project :google_maps_flutter
Evaluating project ':google_maps_flutter' using build file 'D:\Learning\flutter\flutter_sdk\.pub-cache\hosted\pub.dartlang.org\google_maps_flutter-1.0.6\android\build.gradle'.
Creating configuration androidTestUtil

> Configure project :google_sign_in
Evaluating project ':google_sign_in' using build file 'D:\Learning\flutter\flutter_sdk\.pub-cache\hosted\pub.dartlang.org\google_sign_in-4.5.6\android\build.gradle'.
Creating configuration androidTestUtil

> Configure project :image_cropper
Evaluating project ':image_cropper' using build file 'D:\Learning\flutter\flutter_sdk\.pub-cache\hosted\pub.dartlang.org\image_cropper-1.3.1\android\build.gradle'.
Creating configuration androidTestUtil

> Configure project :image_picker
Evaluating project ':image_picker' using build file 'D:\Learning\flutter\flutter_sdk\.pub-cache\hosted\pub.dartlang.org\image_picker-0.6.7+14\android\build.gradle'.
Creating configuration androidTestUtil

> Configure project :location
Evaluating project ':location' using build file 'D:\Learning\flutter\flutter_sdk\.pub-cache\hosted\pub.dartlang.org\location-2.5.4\android\build.gradle'.
Creating configuration androidTestUtil

> Configure project :shared_preferences
Evaluating project ':shared_preferences' using build file 'D:\Learning\flutter\flutter_sdk\.pub-cache\hosted\pub.dartlang.org\shared_preferences-0.5.12+4\android\build.gradle'.
Creating configuration androidTestUtil

> Configure project :webview_flutter
Evaluating project ':webview_flutter' using build file 'D:\Learning\flutter\flutter_sdk\.pub-cache\hosted\pub.dartlang.org\webview_flutter-1.0.7\android\build.gradle'.
Creating configuration androidTestUtil
All projects evaluated.
Analytics other plugin to proto: Unknown plugin type FlutterPlugin expected enum FLUTTERPLUGIN
Configuring Java sources compilation with source level 1.7 and target level 1.7.
Configuring Java sources compilation with source level 1.7 and target level 1.7.
Configuring Java sources compilation with source level 1.7 and target level 1.7.
Configuring Java sources compilation with source level 1.7 and target level 1.7.
Configuring Java sources compilation with source level 1.7 and target level 1.7.
Configuring Java sources compilation with source level 1.7 and target level 1.7.
Configuring Java sources compilation with source level 1.7 and target level 1.7.

FAILURE: Build failed with an exception.

* What went wrong:
Task 'singingReport' not found in root project 'android'. Some candidates are: 'signingReport'.

* Try:
Run gradlew tasks to get a list of available tasks. Run with --stacktrace option to get the stack trace. Run with --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.1.1/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 10s

您的命令有错别字。应该是 gradlew signingReport 而不是 gradlew singingReport.