2
  1. Introduction ( What is Bubble-Picker?)

1.1 Bubble-Picker with removing feature :

1.2 Bubble-Picker: An easy-to-use animation which can be used for content picking for Android Original source = https://github.com/igalata/Bubble-Picker

  1. Bug

If you build and run 1.1 Bubble-Picker(with removing feature), then you can see the bugs in android studio.

  1. More Detail.

In JBox2d, world.destroyBody() doesn't work normally. That is to say, I don't know how to remove circle-items from the world in jbox2d.

E/AndroidRuntime: FATAL EXCEPTION: GLThread 2044
Process: com.touchizen.bubblepicker, PID: 26298
java.lang.AssertionError
at org.jbox2d.collision.broadphase.DynamicTree.destroyProxy(DynamicTree.java:115)
at org.jbox2d.collision.broadphase.BroadPhase.destroyProxy(BroadPhase.java:104)
at org.jbox2d.dynamics.Fixture.destroyProxy(Fixture.java:314)
at org.jbox2d.dynamics.World.destroyBody(World.java:344)
at com.igalata.bubblepicker.physics.Engine.move(Engine.kt:66)
at com.igalata.bubblepicker.rendering.PickerRenderer.onDrawFrame(PickerRenderer.kt:74)
at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1571)
at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1270)
I/Process: Sending signal. PID: 26298 SIG: 9

Does anyone know how to resolve this issue?

안국환
  • 21
  • 1

1 Answers1

0

I got stuck in this issue too. After a few days looking for possible solution, I found a great one yesterday. You should import the source code of the library directly in your project as a module. You can research how to import an Android project as a module on Google. There are a lot of blogs and tutorials that will help you.

On the next step, you need to find the Engine file in the bubble library. Scroll to the clear function and replace the code with this code:

fun clear() {
    borders.forEach { if (world.isLocked) world.destroyBody(it.itemBody) }
    bodies.forEach { if (world.isLocked) world.destroyBody(it.physicalBody) }
    borders.clear()
    bodies.clear()
}

And you are almost done. Why? Because there will be some bugs when you import the library source code. Don't be depressed! You just need to modify some configs to solve these bugs. If you need some help, feel free to ask me.

The original issues and discussions are here and here. And the bubble repo by tuxxon is a better choice than the origin. Tuxxon has made some upgrade on gradle config and sdk version config with the newer sdk version. It has helped me avoid some bugs on project config so I think it also would help you.