Closed sunneo closed 3 years ago
after run in android studio I got 'Could not get unknown property 'classesDir' for main classes of type Org.gradle.api.internal.tasks.DefaultSourceSetOutput. ' afterward I try to alternate it with classesDirs However the other error comes out:
$ ./gradle-6.7/bin/gradle desktop:dist
FAILURE: Build failed with an exception.
* What went wrong:
Could not determine the dependencies of task ':desktop:compileJava'.
> Could not resolve all task dependencies for configuration ':desktop:compileClasspath'.
> Could not resolve project :core.
Required by:
project :desktop
> No matching variant of project :core was found. The consumer was configured to find an API of a library compatible with Java 6, preferably in the form of class files, and its dependencies declared externally but:
- Variant 'apiElements' capability riiablo:core:1.0 declares an API of a library, packaged as a jar, and its dependencies declared externally:
- Incompatible because this component declares a component compatible with Java 7 and the consumer needed a component compatible with Java 6
- Variant 'runtimeElements' capability riiablo:core:1.0 declares a runtime of a library, packaged as a jar, and its dependencies declared externally:
- Incompatible because this component declares a component compatible with Java 7 and the consumer needed a component compatible with Java 6
* 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/userguide/command_line_interface.html#sec:command_line_warnings
BUILD FAILED in 5s
Perhaps it is exactly a bad idea to utilize gradle, because gradle heavily depends on jdk version, and commands/recipe are frequently deleted or marked as deprecated. Which would lead to unnecessary cost of maintenance after project published. Use make file could be better.
1) use included gradle wrapper to build the project (newer versions are incompatible with the scripts as you're seeing)
2) only Java 8 is officially supported in the current state (this is what works for me)
3) android sdk is required to build the project unless you remove all traces of it from the project hierarchy
4) virtually all of the above issues are currently being worked on in the gradle-migration
branch -- as well as importing the project into IntelliJ 2019+
. I'm hoping to get this done ASAP.
LibGDX project structures are generated using a tool -- and this one was generated years ago, so much of it is just outdated now -- which is why is a bit of a pain to deal with and I'm in the process of attempting to migrate it myself and learning about gradle. I'm sure someone with a greater domain knowledge of gradle would not have these issues, but I'm not that person :). If you want to build the project in its current form without android -- you will need to use the included gradle wrapper and Java 8 and comment out the android module from build.gradle
and settings.gradle
. Sit tight in the meantime, I'm hoping I can have a better solution soon.
@sunneo Feel free to try the updated gradle wrapper in the gradle-migration
branch and let me know if there are any issues. I've been putting in a lot of effort updating it to be more compatible. Bear in mind, I'm not a build script guy, but I'm doing my best. It's not completely finished, but I want to get it functional so that I can merge.
@sunneo gradle-migration
has been merged back into master
-- I think that should resolve the issues you were having.
When I use gradlew desktop:dist gradlew shows:
gradle-6.7
After gradle-6.7 is downloaded, the error message shows:
gradle --refresh-dependencies
I'm not going to build it for android, and I'd like to build a jar for rapsberry pi. What can I do
Or could you publish/release built jar file?
According to the Post
I removed android-related references
However the gradle outputs another error