当前位置: 首页 > 知识库问答 >
问题:

Android-Studio(3.1)更新后Gradle项目同步失败

段干长恨
2023-03-14

在我于2018年27-03-2018进行更新后,我的gradle同步失败。我得到了错误

Could not find org.jetbrains.kotlin:kotlin-stdlib:1.1.3-2.
    // Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    repositories {
        google()
        jcenter()
        maven {
            url 'https://maven.google.com/'
        }
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.1.0'
        classpath 'com.google.gms:google-services:3.0.0'
        classpath 'com.loopj.android:android-async-http:1.4.9'

        // 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
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
apply plugin: 'com.google.gms.google-services'

buildscript {
    repositories {
        maven { url 'https://maven.fabric.io/public' }
        google()
    }

    dependencies {
        classpath 'io.fabric.tools:gradle:1.+'
    }
}

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

android {
    compileSdkVersion 25
    buildToolsVersion '26.0.2'
    lintOptions {
        disable 'InvalidPackage'
    }
    defaultConfig {
        applicationId 'app.myapp.com'
        minSdkVersion 15
        targetSdkVersion 25
        versionCode 33
        versionName "1.1.30"
        useLibrary 'org.apache.http.legacy'
        // Enabling multidex support.
        multiDexEnabled true
        vectorDrawables.useSupportLibrary = true
    }
    dexOptions {
        preDexLibraries = false
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    productFlavors {
    }
    lintOptions {
        checkReleaseBuilds false
    }

    packagingOptions {
        exclude 'META-INF/DEPENDENCIES'
        exclude 'META-INF/NOTICE'
        exclude 'META-INF/LICENSE'
    }
}
repositories {
    mavenCentral()
    jcenter()

    maven { url 'https://maven.fabric.io/public'

    }

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

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])


    compile project(':android-async-http-1.4.9')


    //    compile 'com.daimajia.androidanimations:library:1.0.3@aar'
    compile project(':PayTabs_SDK_NOSCAN')
    compile('com.twitter.sdk.android:twitter:1.14.1@aar') {
        transitive = true;
    }
    compile('org.apache.httpcomponents:httpmime:4.3') {
        exclude module: "httpclient"
    }
    compile files('libs/signpost-core-1.2.1.2.jar')
    // Discovery and Outlook services
    compile('com.microsoft.services:discovery-services:1.0.0@aar') {
        transitive = true
    }
    compile('com.microsoft.services:outlook-services:1.0.0@aar') {
        transitive = true
    }
    compile 'org.sufficientlysecure:html-textview:3.3'
    compile 'com.android.support:appcompat-v7:25.3.1'
    compile 'com.android.support:design:25.3.1'
    compile 'com.android.support:support-v4:25.3.1'
    compile 'cz.msebera.android:httpclient:4.3.6'
    compile 'com.squareup.picasso:picasso:2.5.2'
    compile 'com.nineoldandroids:library:2.4.0'
    compile 'com.daimajia.slider:library:1.1.5@aar'
    compile 'me.dm7.barcodescanner:zxing:1.8.4'
    compile 'com.google.android.gms:play-services:9.0.0'
    compile 'com.android.support:multidex:1.0.1'
    compile 'com.google.gms:google-services:3.0.0'
    compile 'com.google.android.gms:play-services-ads:9.0.0'
    compile 'com.google.android.gms:play-services-auth:9.0.0'
    compile 'com.google.android.gms:play-services-gcm:9.0.0'
    compile 'org.codepond:wizardroid:1.3.1'
    compile 'com.facebook.android:facebook-android-sdk:4.0.0'
    compile 'com.google.code.gson:gson:2.3.1'
    compile 'com.google.zxing:core:3.2.0'
    compile 'io.card:android-sdk:5.3.0'
    compile 'com.google.firebase:firebase-messaging:9.0.1'
    compile 'com.mcxiaoke.volley:library-aar:1.0.0'
    compile 'me.dm7.barcodescanner:zbar:1.8.2'
    compile 'com.journeyapps:zxing-android-embedded:3.0.2@aar'
    compile 'de.hdodenhof:circleimageview:2.0.0'
    compile 'com.cloudrail:cloudrail-si-android:2.11.0'
    compile 'org.apache.httpcomponents:httpclient-android:4.3.5.1'
    compile 'com.davemorrissey.labs:subsampling-scale-image-view:3.6.0'
    compile 'com.android.support.constraint:constraint-layout:1.0.2'
    compile 'com.android.support:recyclerview-v7:25.3.1'
    compile 'com.ss.bannerslider:bannerslider:1.8.0'
    compile 'com.marshalchen.ultimaterecyclerview:library:0.7.3'
//    compile "org.jetbrains.kotlin:kotlin-stdlib-jdk7"


    testCompile 'junit:junit:4.12'
}
configurations.all {
    resolutionStrategy.eachDependency { DependencyResolveDetails details ->
        def requested = details.requested
        if (requested.group == 'com.android.support') {
            if (!requested.name.startsWith("multidex")) {
                details.useVersion '25.3.1'
            }
        }
    }
}

我在这里张贴我得到的错误

Could not find org.jetbrains.kotlin:kotlin-stdlib:1.1.3-2.
Searched in the following locations:
    https://maven.fabric.io/public/org/jetbrains/kotlin/kotlin-stdlib/1.1.3-2/kotlin-stdlib-1.1.3-2.pom
    https://maven.fabric.io/public/org/jetbrains/kotlin/kotlin-stdlib/1.1.3-2/kotlin-stdlib-1.1.3-2.jar
    https://dl.google.com/dl/android/maven2/org/jetbrains/kotlin/kotlin-stdlib/1.1.3-2/kotlin-stdlib-1.1.3-2.pom
    https://dl.google.com/dl/android/maven2/org/jetbrains/kotlin/kotlin-stdlib/1.1.3-2/kotlin-stdlib-1.1.3-2.jar
Required by:
    project :app > com.android.tools.build:gradle:3.0.1 > com.android.tools.build:gradle-core:3.0.1
    project :app > com.android.tools.build:gradle:3.0.1 > com.android.tools.build:gradle-core:3.0.1 > com.android.tools.build:builder:3.0.1
    project :app > com.android.tools.build:gradle:3.0.1 > com.android.tools.build:gradle-core:3.0.1 > com.android.tools.lint:lint:26.0.1
    project :app > com.android.tools.build:gradle:3.0.1 > com.android.tools.build:gradle-core:3.0.1 > com.android.tools.build:builder:3.0.1 > com.android.tools:sdk-common:26.0.1
    project :app > com.android.tools.build:gradle:3.0.1 > com.android.tools.build:gradle-core:3.0.1 > com.android.tools.build:builder:3.0.1 > com.android.tools:sdklib:26.0.1 > com.android.tools:repository:26.0.1
    project :app > com.android.tools.build:gradle:3.0.1 > com.android.tools.build:gradle-core:3.0.1 > com.android.tools.lint:lint:26.0.1 > com.android.tools.lint:lint-checks:26.0.1 > com.android.tools.lint:lint-api:26.0.1

共有1个答案

汪修诚
2023-03-14

我也想出了同样的问题。似乎android studio也在寻求更新kotlin插件。

转到工具>Kotlin>Configure Kotlin Plugin Update并更新插件。然后重启studio,它将同步重启时的梯度。

 类似资料:
  • 问题内容: 我收到错误消息:“ Gradle项目同步失败。基本功能(例如,整理)将无法正常工作。” 和错误日志: 我在这里阅读时试图删除.gradle文件夹。昨天可以正常工作,但是今天当我启动Android Studio时,错误再次显示,删除.gradle文件夹无济于事。 我真的不知道该怎么办。 有没有人有什么建议? 问题答案: 只是一个盲目的猜测:尝试在项目的 gradle.properties

  • 我已经搜索了网络,尝试了一切,但没有任何效果。我有使用Gradle1.11的Android Studio的0.4.6版。 错误消息为:

  • 我目前在同步 gradle 时遇到问题。每当我尝试同步它时,我都会收到以下消息。我从头开始创建了一个新项目,我不知道如何从这里开始。 生成文件'C:\Users\Yun\AndroidStudioProjects\Prac_App_2\Build。坡度线:3 在以下任何源中都找不到插件[id: 'com.android.application ',版本:' 7.2.0 ',apply: false

  • 我刚刚安装了android Studio2.1.1。当我开始一个老项目的时候,我会犯这个错误- 平台和插件更新:以下组件已准备好更新:Android Support Repository,Google Repository,Google API Intel x86 Atom系统映像,Android SDK Tools 25.1.7 8:18:58 AM Gradle sync启动8:19:39 A

  • // distributionbase=gradle_user_home distributionpath=wrapper/dists zipstorebase=gradle_user_home zipstorepath=wrapper/distributionurl=https://services.gradle.org/distributions/gradle-2.2.1-all.zip

  • 事后看来,我不应该启用L构建的东西。 我是一个编程新手,我创建了一个新的Android Studio项目,它马上就会抛出Gradle错误。 messages gradle sync-compilesdkversion android-L需要使用JDK-7进行编译。打开sdk设置,打开文件。 我试着浏览了谷歌和其他堆栈溢出评论,但没有找到任何我能理解的东西,除了Android Studio-Grad