android报错(org.gradle.internal.exceptions.LocationAwareException: New Gradle Sync is not supported due to containing Kotlin modules)

报错内容

org.gradle.internal.exceptions.LocationAwareException: New Gradle Sync is not supported due to containing Kotlin modules
    ...
Caused by: com.android.tools.idea.gradle.project.sync.ng.NewGradleSyncNotSupportedException: New Gradle Sync is not supported due to containing Kotlin modules
    ... 75 more

原因:

国内访问不到google的jcenter(),需要使用代理

buildscript {
    repositories {
        // 阿里云 maven 地址
        // maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' }
        // maven { url 'http://maven.aliyun.com/nexus/content/repositories/jcenter' }
        // maven { url 'http://maven.aliyun.com/nexus/content/repositories/google' }
        maven { url 'https://maven.aliyun.com/repository/google' }
        maven { url 'https://maven.aliyun.com/repository/jcenter' }
        maven { url 'https://maven.aliyun.com/repository/public' }
        // google()
        // jcenter()
    }
}

allprojects {
    repositories {
        // 阿里云 maven 地址
        // maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' }
        // maven { url 'http://maven.aliyun.com/nexus/content/repositories/jcenter' }
        // maven { url 'http://maven.aliyun.com/nexus/content/repositories/google' }
        maven { url 'https://maven.aliyun.com/repository/google' }
        maven { url 'https://maven.aliyun.com/repository/jcenter' }
        maven { url 'https://maven.aliyun.com/repository/public' }
        // google()
        // jcenter()
    }
}

转载请注明来源,欢迎对文章中的引用来源进行考证,欢迎指出任何有错误或不够清晰的表达。可以在下面评论区评论,也可以邮件至 wind.kaisa@gmail.com

文章标题:android报错(org.gradle.internal.exceptions.LocationAwareException: New Gradle Sync is not supported due to containing Kotlin modules)

本文作者:kaisawind

发布时间:2019-09-19, 08:27:12

最后更新:2020-08-10, 08:17:32

原始链接:https://kaisawind.gitee.io/2019/09/19/2019-09-19-android/

版权声明: "署名-非商用-相同方式共享 4.0" 转载请保留原文链接及作者。

目录
×

喜欢就点赞,疼爱就打赏