gpt4 book ai didi

android - 如何修复 : Gradle sync failed: Unsupported method: SyncIssue. getMultiLineMessage()

转载 作者:行者123 更新时间:2023-12-05 00:03:53 24 4
gpt4 key购买 nike

我正在尝试在我最新的 android studio (4.1.1) 中构建一个旧应用程序(Udacity Android 基础类(class),2017 年)。旧应用需要:

  • Android SDK v23
  • Android 构建工具 v23.0.2
  • Android 支持存储库 v23.3.0

所以我安装了 android build tools v23.0.2,但我每次都收到同步错误。请帮忙。

Gradle sync started

14:34  Gradle sync failed: Unsupported method: SyncIssue.getMultiLineMessage().
          The version of Gradle you connect to does not support that method.          To resolve the problem you can change/upgrade the target version of Gradle you connect to.
          Alternatively, you can ignore this exception and read other information from the model.
          Consult IDE log for more details (Help | Show Log) (17 s 149 ms)

下面是我的 build.gradle(:) 文件:

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.0'

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

allprojects {
repositories {
jcenter()
}
}

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

下面是我的 gradle.wrapper.propertise 文件

#Mon Dec 28 10:00:20 PST 2015
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.10-all.zip

下面是我的 app/build.gradle

apply plugin: 'com.android.application'

android {
compileSdkVersion 23
buildToolsVersion "23.0.2"

defaultConfig {
applicationId "com.example.android.quakereport"
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.3.0'
}

最佳答案

仅更改类路径编号对我不起作用。但我找到的解决方案确实如此:

https://github.com/udacity/ud839_Miwok/issues/215#issuecomment-716142250

I confirm the issue was fixed by making the below changes/additions inthe following files:

build.gradle

and

gradle-wrapper.properties

In the build.gradle file I have added

maven { url 'https://maven.google.com/' name 'Google' } in both thebuildscript and allprojects just below jcenter() and changed theclasspath to classpath 'com.android.tools.build:gradle:4.1.0'

// Top-level build file where you can add configuration options commonto all sub-projects/modules.

buildscript {
repositories {
jcenter()
maven {
url 'https://maven.google.com/'
name 'Google'
}
}
dependencies {
classpath 'com.android.tools.build:gradle:4.1.0'

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

allprojects {
repositories {
jcenter()
maven {
url 'https://maven.google.com/'
name 'Google'
}
} }

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

and in the Gradle Properties I did the changes mentioned by @ Diver1rn and changeddistributionUrl=https://services.gradle.org/distributions/gradle-6.5-all.zip

#Mon Dec 28 10:00:20 PST 2015
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists distr
ibutionUrl=https\://services.gradle.org/distributions/gradle-6.5-all.zip

Hope this helps all the others who are stuck and want to fix thisissue with a copy and paste solution only.

关于android - 如何修复 : Gradle sync failed: Unsupported method: SyncIssue. getMultiLineMessage(),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65406144/

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