Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

For some reason, my dependency doesn't seem to be working. I used the XStream library (version 1.4.7) in my mod. So, in my build.grade I included the following:

    compile 'org.jsoup:jsoup:1.7.2'
    compile 'com.thoughtworks.xstream:xstream:1.4.7'

 

As you can see, I also have a jsoup dependency, which is working fine and dandy. You can view the XStream maven info here. When I run gradlew build, there is no error thrown (in fact, I could see it downloading everything). But, when I give someone else the file, they receive this error upon running:

 

 

cpw.mods.fml.common.LoaderException: java.lang.NoClassDefFoundError: com/thoughtworks/xstream/io/HierarchicalStreamDriver
        at cpw.mods.fml.common.LoadController.transition(LoadController.java:162)
        at cpw.mods.fml.common.Loader.preinitializeMods(Loader.java:515)
        at cpw.mods.fml.client.FMLClientHandler.beginMinecraftLoading(FMLClientHandler.java:239)
        at net.minecraft.client.Minecraft.func_71384_a(Minecraft.java:480)
        at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:867)
        at net.minecraft.client.main.Main.main(SourceFile:148)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at net.minecraft.launchwrapper.Launch.launch(Launch.java:134)
        at net.minecraft.launchwrapper.Launch.main(Launch.java:28)
Caused by: java.lang.NoClassDefFoundError: com/thoughtworks/xstream/io/HierarchicalStreamDriver
        at us.mcpvpmod.Main.preInit(Main.java:94)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at cpw.mods.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:513)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74)
        at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47)
        at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322)
        at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304)
        at com.google.common.eventbus.EventBus.post(EventBus.java:275)
        at cpw.mods.fml.common.LoadController.sendEventToModContainer(LoadController.java:208)
        at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:187)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74)
        at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47)
        at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322)
        at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304)
        at com.google.common.eventbus.EventBus.post(EventBus.java:275)
        at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:118)
        at cpw.mods.fml.common.Loader.preinitializeMods(Loader.java:513)
        ... 10 more
Caused by: java.lang.ClassNotFoundException: com.thoughtworks.xstream.io.HierarchicalStreamDriver
        at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:188)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        ... 38 more
Caused by: java.lang.NullPointerException
        at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:180)
        ... 40 more

 

 

Any ideas how I could fix this? :(

  • Author

JSoup will not work either. Gradle does not package dependencies with your mod.

 

But nobody has had problems with JSoup. Could it be because JSoup has no other dependencies but XStream does?

  • Author

It just crashes with XStream because you use that first in your mod ....

 

No, JSoup works fine, please trust me. I have used it for some time, and created versions of my mod where JSoup was used successfully.

  • Author

That is impossible unless your users install it separately or it is on the classpath for some other reason.

Pleas trust me: Gradle does not package libraries automatically.

 

Ugh, I'll take your word for it, though I can't imagine people have JSoup installed...

Why does gradlew build not throw any errors? Because I have the requirements on my system?

 

Also, you mentioned something in another topic about all jars in /build/libs being marked as dependencies. Can that help me?

  • Author

No. This is on the build side. All dependencies are resolved in your development environment. But when users install your mod there is no gradle or anything like that to do that. So you have to either ship the dependencies yourself or get users to install them.

 

Right. So you suggest using the Gradle Shadow Plugin to ship the dependency?

  • Author

I can't, I have never used it.

 

Okay, thanks for all your help anyway. Also, perhaps this thread should be moved to the ForgeGradle sub-category?

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.