Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/eclipse/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/joomla/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 使用eclipse设置LibGDX时发生梯度错误_Java_Eclipse_Gradle_Libgdx - Fatal编程技术网

Java 使用eclipse设置LibGDX时发生梯度错误

Java 使用eclipse设置LibGDX时发生梯度错误,java,eclipse,gradle,libgdx,Java,Eclipse,Gradle,Libgdx,我正在尝试使用这个 但是当我尝试构建项目时,我遇到了这个错误 Configuration on demand is an incubating feature. FAILURE: Build failed with an exception. * What went wrong: A problem occurred configuring root project 'TestGame'. > Could not resolve all dependencies for configu

我正在尝试使用这个
但是当我尝试构建项目时,我遇到了这个错误

Configuration on demand is an incubating feature.

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'TestGame'.
> Could not resolve all dependencies for configuration ':classpath'.
   > Could not resolve de.richsource.gradle.plugins:gwt-gradle-plugin:0.5.
     Required by:
         :TestGame:unspecified
      > Could not GET 'https://repo1.maven.org/maven2/de/richsource/gradle/plugins/gwt-gradle-plugin
/0.5/gwt-gradle-plugin-0.5.pom'.
         > Connection to https://repo1.maven.org refused
      > Could not GET 'https://jcenter.bintray.com/de/richsource/gradle/plugins/gwt-gradle-plugin/0.
5/gwt-gradle-plugin-0.5.pom'.
         > Connection to https://jcenter.bintray.com refused
   > Could not resolve com.android.tools.build:gradle:0.13+.
     Required by:
         :TestGame:unspecified
      > Failed to list versions for com.android.tools.build:gradle.
         > Unable to load Maven meta-data from https://repo1.maven.org/maven2/com/android/tools/buil
d/gradle/maven-metadata.xml.
            > Could not GET 'https://repo1.maven.org/maven2/com/android/tools/build/gradle/maven-met
adata.xml'.
               > Connection to https://repo1.maven.org refused
      > Failed to list versions for com.android.tools.build:gradle.
         > Unable to load Maven meta-data from https://jcenter.bintray.com/com/android/tools/build/g
radle/maven-metadata.xml.
            > Could not GET 'https://jcenter.bintray.com/com/android/tools/build/gradle/maven-metada
ta.xml'.
               > Connection to https://jcenter.bintray.com refused
   > Could not resolve org.robovm:robovm-gradle-plugin:1.0.0-alpha-04.
     Required by:
         :TestGame:unspecified
      > Could not GET 'https://repo1.maven.org/maven2/org/robovm/robovm-gradle-plugin/1.0.0-alpha-04
/robovm-gradle-plugin-1.0.0-alpha-04.pom'.
         > Connection to https://repo1.maven.org refused
      > Could not GET 'https://jcenter.bintray.com/org/robovm/robovm-gradle-plugin/1.0.0-alpha-04/ro
bovm-gradle-plugin-1.0.0-alpha-04.pom'.
         > Connection to https://jcenter.bintray.com refused

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more l
og output.

BUILD FAILED

Total time: 2 mins 12.602 secs
libgdxui生成了这个buildgradle文件

buildscript {
    repositories {
        mavenCentral()
        jcenter()
    }
    dependencies {
        classpath 'de.richsource.gradle.plugins:gwt-gradle-plugin:0.5'
        classpath 'com.android.tools.build:gradle:0.13+'
        classpath 'org.robovm:robovm-gradle-plugin:1.0.0-alpha-04'
    }
}

allprojects {
    apply plugin: "eclipse"
    apply plugin: "idea"

    version = '1.0'
    ext {
        appName = 'TestingGame'
        gdxVersion = '1.4.1'
        roboVMVersion = '1.0.0-alpha-04'
    }

    repositories {
        mavenCentral()
        maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
        maven { url "https://oss.sonatype.org/content/repositories/releases/" }
    }
}

project(":desktop") {
    apply plugin: "java"


    dependencies {
        compile project(":core")
        compile "com.badlogicgames.gdx:gdx-backend-lwjgl:$gdxVersion"
        compile "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-desktop"
        compile "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-desktop"
    }
}

project(":android") {
    apply plugin: "android"

    configurations { natives }

    dependencies {
        compile project(":core")
        compile "com.badlogicgames.gdx:gdx-backend-android:$gdxVersion"
        natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-armeabi"
        natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-armeabi-v7a"
        natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-x86"
        compile "com.badlogicgames.gdx:gdx-box2d:$gdxVersion"
        natives "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-armeabi"
        natives "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-armeabi-v7a"
        natives "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-x86"
        compile "com.badlogicgames.box2dlights:box2dlights:1.2"
    }
}

project(":ios") {
    apply plugin: "java"
    apply plugin: "robovm"

    configurations { natives }

    dependencies {
        compile project(":core")
        compile "org.robovm:robovm-rt:${roboVMVersion}"
        compile "org.robovm:robovm-cocoatouch:${roboVMVersion}"
        compile "com.badlogicgames.gdx:gdx-backend-robovm:$gdxVersion"
        natives "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-ios"
        natives "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-ios"
    }
}

project(":html") {
    apply plugin: "gwt"
    apply plugin: "war"


    dependencies {
        compile project(":core")
        compile "com.badlogicgames.gdx:gdx-backend-gwt:$gdxVersion"
        compile "com.badlogicgames.gdx:gdx:$gdxVersion:sources"
        compile "com.badlogicgames.gdx:gdx-backend-gwt:$gdxVersion:sources"
        compile "com.badlogicgames.gdx:gdx-box2d:$gdxVersion:sources"
        compile "com.badlogicgames.gdx:gdx-box2d-gwt:$gdxVersion:sources"
        compile "com.badlogicgames.box2dlights:box2dlights:1.2:sources"
    }
}

project(":core") {
    apply plugin: "java"


    dependencies {
        compile "com.badlogicgames.gdx:gdx:$gdxVersion"
        compile "com.badlogicgames.gdx:gdx-box2d:$gdxVersion"
        compile "com.badlogicgames.box2dlights:box2dlights:1.2"
    }
}

tasks.eclipse.doLast {
    delete ".project"
}

我认识Maven,但我不认识gradle,因此我无法理解异常情况以及我在教程中做的每件事中出错的地方,请提供帮助?

经过大量搜索后,我发现我需要将下载到eclipse插件中的GWT添加到教程中未提及的GWT中

所以我所做的是

in eclipse go to  WINDOWS --->PREFERENCE--->GOOGLE ---->WEB TOOLKIT --->add and search for the folder you have extracted its ZIP file 

我对Gradle也有类似的问题(无法获取“https…”),但有一个不同的项目。我也在防火墙后面

我尝试使用一个单独的gradle.properties,还尝试通过其他文章提到的VM参数将代理服务器/端口传递给gradle,但这两个都不起作用

下面是我通过Eclipse设置找到的一种适合我的方法

窗口->首选项->网络连接下将活动提供程序设置为手动


然后编辑HTTP和HTTPS的条目,并在其中添加代理服务器和端口。如果您的代理需要您的凭据,请确保您也在那里添加这些凭据。再次尝试构建它,希望这次它能正常工作,但是尝试使用
com.android.tools.build:gradle:0.12+
而不是
0.13+
。另外,确保没有防火墙阻止Gradle与存储库通信(另一个随机想法)。@Zhuinden感谢您的回复,我只是尝试一下,但同样的错误您有防火墙、代理服务器等吗?@Opal是的,我有一个NTLM,我已经设置了中提到的Gradle.proporties文件,显然无法正常工作。仔细检查代理属性,并检查代理相关消息的
--debug
日志。