gpt4 book ai didi

gradle - 找不到 lint-gradle-api.jar (com.android.tools.lint :lint-gradle-api:26. 1.2) flutter 项目

转载 作者:IT王子 更新时间:2023-10-29 06:59:39 28 4
gpt4 key购买 nike

我有一个 lint-gradle-api.jar 错误,我在论坛上查看了其他类似的问题,但我仍然有问题。有人有想法吗?

  • Error running Gradle: Exit code 1 from: C:\Users\bgbra\Documents\Flutter_apps\flutter_app\android\gradlew.bat app:properties: Project evaluation failed including an error in afterEvaluate {}. Run with --stacktrace for details of the afterEvaluate {} error.

FAILURE: Build failed with an exception.

  • Where: Build file 'C:\Users\bgbra\Documents\Flutter_apps\flutter_app\android\app\build.gradle' line: 25

  • What went wrong: A problem occurred evaluating project ':app'. Could not resolve all artifacts for configuration 'classpath'. Could not find lint-gradle-api.jar (com.android.tools.lint:lint-gradle-api:26.1.2). Searched in the following locations: https://jcenter.bintray.com/com/android/tools/lint/lint-gradle-api/26.1.2/lint-gradle-api-26.1.2.jar

  • 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.

构建.gradle

buildscript {
repositories {
google()
jcenter()
maven {
url 'https://dl.google.com/dl/android/maven2'
}
}

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

allprojects {
repositories {
google()
jcenter()
}
}

rootProject.buildDir = '../build'
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(':app')
}

task clean(type: Delete) {
delete rootProject.buildDir
}

最佳答案

这是我的 build.gradle 文件。不知道对你有没有帮助。

buildscript {
ext.kotlin_version = '1.3.10'

repositories {
google()
jcenter()
maven {
url 'https://dl.google.com/dl/android/maven2'
}
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
classpath 'com.google.gms:google-services:3.2.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}

// global properties used in sub modules
ext {
versionCodeProp = 81100
versionNameProp = "0.8.11-dev"
versionBuild = System.getenv("BUILD_NUMBER") as Integer ?: 0
buildNumberProp = "${versionBuild}"
}

allprojects {
repositories {
jcenter()

maven {
url "https://maven.google.com"
}
google()
}
}

可能你应该将 maven 添加到 allprojects 分支。

关于gradle - 找不到 lint-gradle-api.jar (com.android.tools.lint :lint-gradle-api:26. 1.2) flutter 项目,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53267104/

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