lightsaber icon indicating copy to clipboard operation
lightsaber copied to clipboard

Not Android app and samples crash

Open alex-y-su opened this issue 7 years ago • 3 comments
trafficstars

Hello Michael. Android version works just fine, but when I've tried to make a java app it just crash after run. I've checked samples and non android samples crash as well. Console output (for Java):

Before injection
Wookiee: null
Droid: null
Darth Vader: null
Planet: null
Exception in thread "main" java.lang.NoClassDefFoundError: io/michaelrocks/lightsaber/InjectionDispatcher
	at io.michaelrocks.lightsaber.Lightsaber$DefaultConfigurator.configureInjector(Lightsaber.java:119)
	at io.michaelrocks.lightsaber.Lightsaber.createInjectorInternal(Lightsaber.java:70)
	at io.michaelrocks.lightsaber.Lightsaber.createInjector(Lightsaber.java:43)
	at io.michaelrocks.lightsaber.sample.LightsaberSample.run(LightsaberSample.java:56)
	at io.michaelrocks.lightsaber.sample.LightsaberSample.main(LightsaberSample.java:47)
Caused by: java.lang.ClassNotFoundException: io.michaelrocks.lightsaber.InjectionDispatcher
	at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:335)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	... 5 more

Lightsaber version: 0.8.3-beta (but actually I've tried all 0.8.x)

My java version is:

java 9
Java(TM) SE Runtime Environment (build 9+181)
Java HotSpot(TM) 64-Bit Server VM (build 9+181, mixed mode)

Any ideas? Thanks.

alex-y-su avatar Jul 17 '18 21:07 alex-y-su

Hi @alexeysuvorov, I think it can be related to Java version. The sample works well on my machine with Java 8. I'll try it with Java 9 and 10 later today.

MichaelRocks avatar Jul 23 '18 06:07 MichaelRocks

Yep, seems it's related to the newer Java and Gradle versions. It doesn't work on my machine with JDK 9.0.4 and Gradle 4.9 but it crashes at processing phase. I hope it's already fixed in 0.9.0 version of the library. At least it works fine for me. I'm going to release it soon so we'll check again after the release.

MichaelRocks avatar Jul 23 '18 07:07 MichaelRocks

I faced another issue with JDK 10. When configuring a project classpath is empty and processing doesn't work. I'll try to fix it in the next release or hotfix.

MichaelRocks avatar Jul 25 '18 09:07 MichaelRocks