The problem: I'm currently using Android Studio and Gradle to compile code from a github repository (00-Evan/shattered-pixel-dungeon) and while I can run some tasks (tried 'desktop:release', 'desktop:debug'), gradle refuses to sync properly and every time I try to do it, an error log pops up:
FAILURE: Build failed with an exception.
* What went wrong:
'void org.apache.commons.compress.archivers.zip.ZipFile.<init>(java.nio.channels.SeekableByteChannel)'
* Try:
Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Exception is:
java.lang.NoSuchMethodError: 'void org.apache.commons.compress.archivers.zip.ZipFile.<init>(java.nio.channels.SeekableByteChannel)'
at com.android.repository.util.InstallerUtil.unzip(InstallerUtil.java:99)
Important: I've had this issue before (while compiling previous version of this code) and back then downloading a specific version of SDK build tools (30.0.0 and 26.0.0 if I recall correctly) helped, however this doesn't help anymore.
Other people using this code don't report the same issue and I seem to be the only one.
Also for some reason android tasks also don't seem to work, as if the android studio didn't recognize them:
Task 'release' not found in project ':android'.
* Try:
Run gradle tasks to get a list of available tasks. 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.
What I've tried:
Additional info:
For anyone looking for more information, this specific issue has been covered in Google's issue tracker. In short, the problem stems from mismatched dependency resolution of Apache's commons-compress between robovm-gradle-plugin and Gradle itself. As for Shattered Pixel Dungeon, the fix is present in this commit.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With