最近一直在做C++游戏全栈开发,今天接手了一个移动端APP的开发,下载了android studio 3.5.2 准备安装IDE测试,结果发现了让人一个奔溃的问题,运行APP测试的时候发现提示模块未定义。然后file->sync project with gradle files 提示一直download然后就没有反应了,我都等的快睡着了。仔细一看, download url https://jcenter.bintray.com/ 没有响应,应该是需要翻墙。那国内岂不是很尴尬!解决方法:打开 Gradle Scripts --> build.gradle 改为以下内容即可, 加入阿里云镜像即可
build.gradle内容如下所示:
buildscript {

ext.kotlin\_version = '1.3.50'  

repositories {

    maven{url 'http://maven.aliyun.com/nexus/content/groups/public/'}  
    google()  
    jcenter()  
      
}  
dependencies {  
    classpath 'com.android.tools.build:gradle:3.5.2'  

classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files }
}

allprojects {

repositories {  
    maven{url 'http://maven.aliyun.com/nexus/content/groups/public/'}  
    google()  
    jcenter()  
      
}  

}

task clean(type: Delete) {

delete rootProject.buildDir  

}

新建位图图像.jpg


全栈胖叔叔
10 声望0 粉丝