thiagolocatelli / parse4j

Java Library to deal with Parse (parse.com) REST API
http://thiagolocatelli.github.io/parse4j
143 stars 117 forks source link

ExceptionInInitializerError #28

Open GaurabAryal opened 9 years ago

GaurabAryal commented 9 years ago

Hi,

First of all, thank you for this amazing Library. I am making a game using libgdx and I would love to use the library. However, after adding compile 'com.github.thiagolocatelli:parse4j:1.4' to my build.gradle, I tried to initialize Parse in my main class using Parse.initialize(APPID, RESTfulKey);. However, i am getting java.lang.ExceptionInInitializerError in that line. How would I go about fixing this? Thank you.

EDIT: Here are some warnings i get WARNING: Dependency org.apache.httpcomponents:httpclient:4.3.2 is ignored for debug as it may be conflicting with the internal version provided by Android. In case of problem, please repackage it with jarjar to change the class packages WARNING: Dependency org.json:json:20131018 is ignored for debug as it may be conflicting with the internal version provided by Android. In case of problem, please repackage with jarjar to change the class packages WARNING: Dependency org.apache.httpcomponents:httpclient:4.3.2 is ignored for release as it may be conflicting with the internal version provided by Android. In case of problem, please repackage it with jarjar to change the class packages WARNING: Dependency org.json:json:20131018 is ignored for release as it may be conflicting with the internal version provided by Android. In case of problem, please repackage with jarjar to change the class packages

thiagolocatelli commented 9 years ago

Do you have a stacktrace of the exception?

On Thu, Mar 5, 2015 at 5:14 PM, Gaurab Aryal notifications@github.com wrote:

Hi,

First of all, thank you for this amazing Library. I am making a game using libgdx and I would love to use the library. However, after adding compile 'com.github.thiagolocatelli:parse4j:1.4' to my build.gradle, I tried to initialize Parse in my main class using Parse.initialize(APPID, RESTfulKey);. However, i am getting java.lang.ExceptionInInitializerError in that line. How would I go about fixing this? Thank you.

— Reply to this email directly or view it on GitHub https://github.com/thiagolocatelli/parse4j/issues/28.

"thiago:locatelli$gmail:com".replace(':','.').replace('$','@')

GaurabAryal commented 9 years ago

Stack trace:
1053-1066/fungeons.game.android I/System.out﹕ java.lang.ExceptionInInitializerError 03-06 20:06:35.077 1053-1066/fungeons.game.android I/System.out﹕ at fungeons.game.main.create(main.java:32) 03-06 20:06:35.089 1053-1066/fungeons.game.android I/System.out﹕ at com.badlogic.gdx.backends.android.AndroidGraphics.onSurfaceChanged(AndroidGraphics.java:241) 03-06 20:06:35.089 1053-1066/fungeons.game.android I/System.out﹕ at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1505) 03-06 20:06:35.093 1053-1066/fungeons.game.android I/System.out﹕ at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1240) 03-06 20:06:35.093 1053-1066/fungeons.game.android I/System.out﹕ Caused by: java.lang.ExceptionInInitializerError 03-06 20:06:35.097 1053-1066/fungeons.game.android I/System.out﹕ at org.parse4j.Parse.(Parse.java:28) 03-06 20:06:35.101 1053-1066/fungeons.game.android I/System.out﹕ ... 4 more 03-06 20:06:35.101 1053-1066/fungeons.game.android I/System.out﹕ Caused by: java.lang.NoClassDefFoundError: org.slf4j.impl.StaticLoggerBinder 03-06 20:06:35.109 1053-1066/fungeons.game.android I/System.out﹕ at org.slf4j.LoggerFactory.bind(LoggerFactory.java:121) 03-06 20:06:35.113 1053-1066/fungeons.game.android I/System.out﹕ at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:111) 03-06 20:06:35.117 1053-1066/fungeons.game.android I/System.out﹕ at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:268) 03-06 20:06:35.117 1053-1066/fungeons.game.android I/System.out﹕ at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:241) 03-06 20:06:35.117 1053-1066/fungeons.game.android I/System.out﹕ at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:254) 03-06 20:06:35.121 1053-1066/fungeons.game.android I/System.out﹕ at org.parse4j.util.ParseRegistry.(ParseRegistry.java:17) 03-06 20:06:35.121 1053-1066/fungeons.game.android I/System.out﹕ ... 5 more

EDIT: I believe this maybe due to an old version of httpcomponents:httpclient:4.3.2 and json. As Android is currently using 4.3.3 and 20141113 for json (I think)

EDIT 2: I changed the dependency versions in POM file so no it isn't the issue. @thiagolocatelli