kaisawind's blog
  • 关于
  • 所有帖子

android报错(org.gradle.internal.exceptions.LocationAwareException: New Gradle Sync is not supported due to containing Kotlin modules) - Thu, Sep 19, 2019

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()
    }
}


辽ICP备2021007608号 | © 2025 | kaisawind

Facebook Twitter GitHub

▄