-
Minimum supported Gradle version is 5.4.1. Current version is 5.1.1. If using the gradle wrapper...Flutter/errors and solved 2020. 5. 12. 16:01
project \> flutter run --release
The following error occurred when trying to build the Flutter project with the Release Version.
FAILURE: Build failed with an exception.
* Where:
Build file 'C:\Users\Dong\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\shared_preferences_macos-0.0.1+7\android\build.gradle' line: 22
* What went wrong:
A problem occurred evaluating root project 'shared_preferences_macos'.
> Failed to apply plugin [id 'com.android.library']
> Minimum supported Gradle version is 5.4.1. Current version is 5.1.1. If using the gradle wrapper, try editing the distributionUrl in C:\Users\Dong\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\shared_preferences_macos-0.0.1
+7\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 2s
The plugin shared_preferences_macos could not be built due to the issue above.
The error content is that the gradle version set in shraed_preferences_macos-0.0.1 of the flutter package is 5.1.1 and should be set to at least 5.4.1.
To fix this, open the gradle-wrapper.properties file located in the android / gradle / wrapper location of the package (or library) and fix it. The package location is included in the error message.
C:\Users\Dong\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\shared_preferences_macos-0.0.1+7\android\gradle\wrapper
distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists #distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-all.zip distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-all.zip
The existing distributionUrl is commented out (#) and adds a new version.
The gradle-5.6.2-all.zip written above was taken from the gradle-wrapper.properties file in the current Flutter project and used.
In the actual build, about 2 packages had this problem, and after fixing it, the error disappeared.
'Flutter > errors and solved' 카테고리의 다른 글