gpt4 book ai didi

gradle - 我包含一些库后出现Gradle错误(Shared_preference)

转载 作者:行者123 更新时间:2023-12-03 05:34:54 25 4
gpt4 key购买 nike

我有一个非常简单的flutter应用程序,它想使用shared_preference lib。在我将其包含在我的应用中之前,它已经可以构建,但是在安装后,我从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
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,但仍无法按预期工作。任何想法,我可以解决这个问题?

最佳答案

尝试更改gradle版本:

buildscript {
repositories {
google()
jcenter()
}

dependencies {
classpath 'com.android.tools.build:gradle:3.2.1' //HERE
}
}

3.3.03.0.13.4.1

关于gradle - 我包含一些库后出现Gradle错误(Shared_preference),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57026037/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com