cocosCreator 打android包,报错:Could not download groovy-all.jar

官网:https://www.cocos.com/

参考:https://docs.cocos.com/creator/manual/zh/getting-started/project-structure.html

配置: MacOS 10.12.6  CocosCreator2.3.3 JavaScript

 

问题:

在cocoscreator中Android 打包编译中native.log报错(路径:Users/name/.CocosCreator/logs/native.log)

* What went wrong:
Could not resolve all files for configuration ':game:lintClassPath'.
> Could not download groovy-all.jar (org.codehaus.groovy:groovy-all:2.4.12)
    > Could not get resource 'https://jcenter.bintray.com/org/codehaus/groovy/groovy-all/2.4.12/groovy-all-2.4.12.jar'.
        > Read timed out

* Try:
Run with --stacktrace option to get the stack trace. Run with --debug...

问题原因:网络问题导致,无法下载

解决方式:打开项目目录下: ../build/jsb-link/frameworks/runtime-src/proj.android-studio/build.gradle ,修改内容为(加粗部分)

// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.2.0'
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

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

        flatDir {
            dirs 'libs'
        }
    }
}

//这个也要注释掉否则报异常:Declaring custom 'clean' task when using the standard Gradle lifecycle plugins is not allowed.
// task clean(type: Delete) {
//     delete rootProject.buildDir
// }
posted @ 2020-05-31 02:24  Code~  阅读(1138)  评论(0)    收藏  举报