LibGDX html:superDev任务给我一个错误
因此,我一直在尝试为我的项目运行libGDX命令“gradlew html:superDev”,但在整个过程中,它总是给我一些提示和错误:LibGDX html:superDev任务给我一个错误,html,web,libgdx,gwt-super-dev-mode,Html,Web,Libgdx,Gwt Super Dev Mode,因此,我一直在尝试为我的项目运行libGDX命令“gradlew html:superDev”,但在整个过程中,它总是给我一些提示和错误: > Task :html:beforeRun FAILED FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':html:beforeRun'. > Could not resolve all files for con
> Task :html:beforeRun FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':html:beforeRun'.
> Could not resolve all files for configuration ':html:grettyRunnerJetty94'.
> Could not find org.gretty:gretty-runner-jetty94:3.0.2.
Searched in the following locations:
- file:/C:/Users/Joachim/.m2/repository/org/gretty/gretty-runner-jetty94/3.0.2/gretty-runner-jetty94-3.0.2.pom
- https://repo.maven.apache.org/maven2/org/gretty/gretty-runner-jetty94/3.0.2/gretty-runner-jetty94-3.0.2.pom
- https://dl.google.com/dl/android/maven2/org/gretty/gretty-runner-jetty94/3.0.2/gretty-runner-jetty94-3.0.2.pom
- https://oss.sonatype.org/content/repositories/snapshots/org/gretty/gretty-runner-jetty94/3.0.2/gretty-runner-jetty94-3.0.2.pom
- https://oss.sonatype.org/content/repositories/releases/org/gretty/gretty-runner-jetty94/3.0.2/gretty-runner-jetty94-3.0.2.pom
Required by:
project :html
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.7.1/userguide/command_line_interface.html#sec:command_line_warnings
这是build.gradle文件的外观(位于项目文件夹中的文件):
如果您能帮助解决此问题,我们将不胜感激。谢谢 在您正在寻找的项目中,似乎没有这样的版本3.0.2。可能它被删除了,并被3.0.3版所取代
因此,解决方案是检查build.gradle
文件(可能是html项目中的文件),并用org.gretty:gretty-runner-jetty94:3.0.2
替换字符串org.gretty:gretty-runner-jetty94:3.0.3
或org.gretty:gretty-runner-jetty94:2.3.0
您应该首先尝试3.0.3版,因为2.3.0可能缺少一些功能。好的,所以我转到了我的主gradle.build文件,并在存储库{}块中找到了我放入的buildscript{}块和allprojects{}块
gradlePluginPortal()
,现在superDev命令工作正常。这不起作用。我认为是这样的,因为它没有在页面中查找。它列出了它搜索的URL。可能是因为,在新的libGdx版本中,它被gradlePluginPortal()
所取代。如果这也不起作用,那么如果您将您的build.gradle
文件添加到问题中,它将非常有用。好的,我添加了build.gradle文件
buildscript {
repositories {
gradlePluginPortal()
mavenLocal()
mavenCentral()
maven { url "https://plugins.gradle.org/m2/" }
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
google()
}
dependencies {
classpath 'org.wisepersist:gwt-gradle-plugin:1.0.13'
classpath 'org.gretty:gretty:3.0.3'
}
}
allprojects {
apply plugin: "eclipse"
version = '1.0'
ext {
appName = "ludum-dare-48"
gdxVersion = '1.9.14'
roboVMVersion = '2.3.12'
box2DLightsVersion = '1.5'
ashleyVersion = '1.7.3'
aiVersion = '1.8.2'
gdxControllersVersion = '2.1.0'
}
repositories {
gradlePluginPortal()
mavenLocal()
mavenCentral()
google()
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
maven { url "https://oss.sonatype.org/content/repositories/releases/" }
}
}
project(":desktop") {
apply plugin: "java-library"
dependencies {
implementation project(":core")
api "com.badlogicgames.gdx:gdx-backend-lwjgl:$gdxVersion"
api "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-desktop"
}
}
project(":html") {
apply plugin: "java-library"
apply plugin: "gwt"
apply plugin: "war"
apply plugin: "org.gretty"
dependencies {
implementation project(":core")
api "com.badlogicgames.gdx:gdx-backend-gwt:$gdxVersion"
api "com.badlogicgames.gdx:gdx:$gdxVersion:sources"
api "com.badlogicgames.gdx:gdx-backend-gwt:$gdxVersion:sources"
api "com.badlogicgames.box2dlights:box2dlights:$box2DLightsVersion:sources"
}
}
project(":core") {
apply plugin: "java-library"
dependencies {
api "com.badlogicgames.gdx:gdx:$gdxVersion"
api "com.badlogicgames.box2dlights:box2dlights:$box2DLightsVersion"
}
}