我有一个非常简单的颤动应用程序,想要使用shared_preference库。在我将它包含在我的应用程序中之前,它能够构建,但在我安装之后,我收到来自gradle的错误。
错误:
* Error running Gradle:
ProcessException: Process "D:\Relaxion\flutter-app-arthas\flutter_app_arthas\android\gradlew.bat" exited abnormally:
FAILURE: Build failed with an exception.
* Where:
Settings file 'D:\Relaxion\flutter-app-arthas\flutter_app_arthas\android\settings.gradle' line: 14
* What went wrong:
A problem occurred evaluating settings 'android'.
> Project with path ':name' could not be 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 1s
Command: D:\Relaxion\flutter-app-arthas\flutter_app_arthas\android\gradlew.bat app:properties
Please review your Gradle project setup in the android/ folder.
Pubspec.yaml文件
dependencies:
flutter:
sdk: flutter
cupertino_icons: ^0.1.2
rxdart: ^0.20.0
font_awesome_flutter: 8.0.1
flutter_tags: ^0.3.2
shared_preferences: ^0.5.3+2
在build.gradle中构建脚本
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
}
}
最后是gradle-wrapper.properties
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-all.zip
我已经尝试将gradle版本升级到更高版本1,但仍然不能像预期的那样工作。你知道我能解决这个问题吗?
发布于 2019-07-15 20:47:40
我最终创建了一个新项目,并将整个android文件夹复制粘贴到我以前的项目中,一切都正常了!
发布于 2019-07-14 19:01:43
尝试更改gradle
版本:
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1' //HERE
}
}
到3.3.0
、3.0.1
或3.4.1
。
https://stackoverflow.com/questions/57026037
复制相似问题