-
Creator 版本: 2.3.1
-
目标平台: Android
-
重现方式:编译出错
-
错误信息如下:
FAILURE: Build failed with an exception.
-
Where:
Build file ‘E:\wxgame\BaodaBingdu\BaodaBingdu\build\androidgame\jsb-default\frameworks\runtime-src\proj.android-studio\build.gradle’ line: 6 -
What went wrong:
A problem occurred evaluating root project ‘proj.android-studio’.
Could not find method google() for arguments [] on repository container.
- Try:
Run with --stacktrace option to get the stack trace. Run with --debug option to get more log output.
BUILD FAILED
Total time: 2 mins 52.484 secs
Received result Failure[value=org.gradle.initialization.ReportedException: org.gradle.internal.exceptions.LocationAwareException: Build file ‘E:\wxgame\BaodaBingdu\BaodaBingdu\build\androidgame\jsb-default\frameworks\runtime-src\proj.android-studio\build.gradle’ line: 6
A problem occurred evaluating root project ‘proj.android-studio’.] from daemon DaemonInfo{pid=8284, address=[6ae32c95-ffce-4252-b5e9-0b0371664918 port:5394, addresses:[/127.0.0.1, /0:0:0:0:0:0:0:1]], state=Busy, lastBusy=1626319898012, context=DefaultDaemonContext[uid=5ef72b86-d148-4670-89a9-b1d91d05cc9b,javaHome=D:\Program Files\Java\jdk1.8.0_05,daemonRegistryDir=C:\Users\Administrator.gradle\daemon,pid=8284,idleTimeout=10800000,daemonOpts=-XX:MaxPermSize=256m,-XX:+HeapDumpOnOutOfMemoryError,-Xmx1024m,-Dfile.encoding=GBK,-Duser.country=CN,-Duser.language=zh,-Duser.variant]} (build should be done).
执行命令出错,返回值:1。
=====================此处分界线=====================================
=====================此处分界线=====================================
gradle-wrapper.properties文件如下:
#Fri Oct 27 10:18:28 CST 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=file:///C:/Users/Administrator/.gradle/wrapper/dists/gradle-3.2-all.zip
=====================此处分界线=====================================
=====================此处分界线=====================================
build.gradle文件如下(错误行是 google()这句):
// 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.5.2'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
flatDir {
dirs ‘libs’
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}