我的android工作室版本来自Help > About
Android Studio 3.3.1
Build #AI-182.5107.16.33.5264788, built on January 29, 2019
JRE: 1.8.0_152-release-1248-b01 amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Linux 5.0.5-arch1-1-ARCHbuild.gradle
buildscript {
repositories {
jcenter()
maven { url 'https://maven.google.com' }
maven { url "https://jitpack.io" }
google()
gradlePluginPortal()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.1.2'
classpath 'com.google.gms:google-services:4.3.5'
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.5.1'
}
}
allprojects {
repositories {
google()
jcenter()
maven { url 'https://maven.google.com' }
maven {
url "https://jitpack.io"
credentials { username "48a9b4c06b5dabbc03328ddcdbb7dfd8fab253ae" }
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}和
project/gradle/wrapper/gradle-wrapper.properties
#Fri Apr 16 20:59:03 IST 2021
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-all.zip当我尝试File > Sync Project with Gradle Files时
我一直在
FAILURE: Build failed with an exception.
* What went wrong:
This version of the Android Support plugin for IntelliJ IDEA (or Android Studio) cannot open this project, please retry with version 4.1 or newer.
* 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
CONFIGURE FAILED in 11s
ERROR: This version of the Android Support plugin for IntelliJ IDEA (or Android Studio) cannot open this project, please retry with version 4.1 or newer.我使用的是classpath 'com.android.tools.build:gradle:4.1.2',它比4.1高
我该怎么办才能避免这个错误?
答::
更新为
Android Studio 4.1.3
Build #AI-201.8743.12.41.7199119, built on March 11, 2021
Runtime version: 1.8.0_242-release-1644-b3-6222593 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Linux 5.0.5-arch1-1-arch
GC: ParNew, ConcurrentMarkSweep
Memory: 2014M
Cores: 4
Registry: ide.new.welcome.screen.force=true, external.system.auto.import.disabled=true
Non-Bundled Plugins: de.mprengemann.intellij.plugin.androidicons
Current Desktop: KDE发布于 2021-04-16 17:53:04
更新你的安卓工作室,你的项目将同步罚款。问题与Gradle无关。
安卓工作室中的转到 Help->check for update
然后更新你的android工作室
https://stackoverflow.com/questions/67129864
复制相似问题