bng86 / jbox2d

Automatically exported from code.google.com/p/jbox2d
BSD 2-Clause "Simplified" License
0 stars 0 forks source link

jbox2d-library-2.1.2 run in android sdk #26

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1.
2.
3.
ERROR/AndroidRuntime(748): java.lang.ExceptionInInitializerError
ERROR/AndroidRuntime(748): at 
org.jbox2d.pooling.WorldPool.<init>(WorldPool.java:72)
ERROR/AndroidRuntime(748): at org.jbox2d.dynamics.World.<init>(World.java:126)
...
ERROR/AndroidRuntime(748): Caused by: java.lang.NoClassDefFoundError: 
org.slf4j.impl.StaticLoggerBinder
ERROR/AndroidRuntime(748):     at 
org.slf4j.LoggerFactory.bind(LoggerFactory.java:121)
ERROR/AndroidRuntime(748):     at 
org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:111)
...

What is the expected output? What do you see instead?
Code no problem
Running in the androidSDK environment appeared above errors, whether not 
support androidSDK ah
The version can be run before,

What version of the product are you using? On what operating system?

Please provide any additional information below.

Original issue reported on code.google.com by zjb201...@gmail.com on 21 Oct 2011 at 4:00

GoogleCodeExporter commented 8 years ago
This looks like you don't include the slf4j dependency.  Take a look here
http://www.slf4j.org/android/

you might also need the basic slf4j-api jar

Original comment by toucansa...@gmail.com on 22 Oct 2011 at 3:44

GoogleCodeExporter commented 8 years ago
thank you��i will test it later��

�� 2011 10 22 23:45�� <jbox2d@googlecode.com>���

Original comment by zjb201...@gmail.com on 23 Oct 2011 at 1:09

GoogleCodeExporter commented 8 years ago
I just testing, and found jbox2d-library-2.1.2.jar has already include slfj4, 
add slfj4 packge occur errors

Original comment by zjb201...@gmail.com on 24 Oct 2011 at 1:33

GoogleCodeExporter commented 8 years ago
can you give me the entire stack trace?

Original comment by toucansa...@gmail.com on 24 Oct 2011 at 8:35

GoogleCodeExporter commented 8 years ago
Just calling:

World world = new World(gravity, doSleep);

seems to not work on Android.

Original comment by alexcsts on 26 Oct 2011 at 10:50

GoogleCodeExporter commented 8 years ago
I did some tests here and that error did not occur when I changed the "slf4j" 
package inside the jbox2d.jar to the most recent version.

Original comment by alexcsts on 27 Oct 2011 at 12:39

Attachments:

GoogleCodeExporter commented 8 years ago
add 
jbox2d-library-2.1.2.jar
slf4j-api-1.6.3.jar

eclipse console show these errors:
[2011-10-27 20:55:07 - TestJBox2D212] Dx 
UNEXPECTED TOP-LEVEL EXCEPTION:
java.lang.IllegalArgumentException: already added: 
Lorg/slf4j/helpers/BasicMarker;

Original comment by zjb201...@gmail.com on 27 Oct 2011 at 12:58

GoogleCodeExporter commented 8 years ago
I hope that you can create an Android project to test the 
jbox2d-library-2.1.2.jar, we need it, thank you very much!

Original comment by zjb201...@gmail.com on 27 Oct 2011 at 1:01

GoogleCodeExporter commented 8 years ago
Yeah, that is because the "jbox2d-library-2.1.2.jar" already has a slf4j 
package inside. You must substitute that package for the new one -- OR -- 
remove it there and add the newer version to your project.

Here are the files, as they worked for me:

"jbox2d" without "slf4j" inside and the most recent version of "slf4j"

Original comment by alexcsts on 27 Oct 2011 at 1:07

Attachments:

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
Good, very good, thank you very much!
Suggest you release a specially version for android,now many of game use the 
BOX2D engine , in this i'm very thank you for free engine!
developers from Beijing, China!

Original comment by zjb201...@gmail.com on 27 Oct 2011 at 1:18

GoogleCodeExporter commented 8 years ago
This logging message does not mean anything is wrong, it just means there isn't 
a logger for SLF4J.  So if you want to see any logging output from the engine, 
then include a logging jar from SLF4J's website.

Original comment by toucansa...@gmail.com on 29 Dec 2011 at 8:06

GoogleCodeExporter commented 8 years ago
Ah, so the problem here was different than I thought.

For people with this problem in the future:
* Use the base 2.1.2.2 jar, and include slf4j-api-1.6.1 (or whatever version is 
in the pom)
* Or, use the jar with dependencies. (only dependency is slf4j)
* Make sure your versions match for slf4j if you add a binding.  The one for 
2.1.2.2 is 1.6.1 (check the pom)

Original comment by toucansa...@gmail.com on 24 Apr 2012 at 3:11

GoogleCodeExporter commented 8 years ago
Later I make some changes to the source code of  2.1.2.2 jar, I use the android 
platform Log instead of slf4j-api-1.6.1, and build this jar。

It works good!

And I transplant some jbox2dTestbed code, but it seems like run up more CARDS!

Original comment by zjb201...@gmail.com on 6 May 2012 at 8:08

Attachments:

GoogleCodeExporter commented 8 years ago
you could have just used the android log bindings for slf4j:
http://www.slf4j.org/android/

That's the whole point of slf4j.  It can hook up to any logger.

Original comment by toucansa...@gmail.com on 7 May 2012 at 1:20

GoogleCodeExporter commented 8 years ago
slf4j 库比 android 自带的 
好么,我觉得用自带的效率应该要高一点

Original comment by zjb201...@gmail.com on 7 May 2012 at 6:40

GoogleCodeExporter commented 8 years ago
true, also nice job with the android testbed implementation!

Original comment by toucansa...@gmail.com on 7 May 2012 at 10:28

GoogleCodeExporter commented 8 years ago
so the solution is use the basejbox2d and slf4j1.63 together?

Original comment by fyjc...@gmail.com on 19 Feb 2013 at 6:25

GoogleCodeExporter commented 8 years ago
how do I disable debugView and have just a normal view? Please help

Original comment by tomekc...@gmail.com on 29 Mar 2013 at 11:41