earlygrey / shapedrawer

A library for libGDX that draws simple shapes using a batch.
MIT License
187 stars 31 forks source link

No implementation found for java.nio.ByteBuffer #26

Closed Surakshaajith closed 4 years ago

Surakshaajith commented 4 years ago

I have successfully compiled my project with 'shapedrawer' and generated the apk file. When run the application it gives error "No implementation found for java.nio.ByteBuffer ".

E/art: No implementation found for java.nio.ByteBuffer com.badlogic.gdx.graphics.g2d.Gdx2DPixmap.newPixmap(long[], int, int, int) (tried Java_com_badlogic_gdx_graphics_g2d_Gdx2DPixmap_newPixmap and Java_com_badlogic_gdx_graphics_g2d_Gdx2DPixmap_newPixmap___3JIII)

No matter which variable i use "com.badlogic.gdx.graphics.Pixmap", "com.badlogic.gdx.graphics.Texture" , "com.badlogic.gdx.graphics.g2d.Batch" it crashes giving the "No implementation found"

How do i resolve this? Please help.

earlygrey commented 4 years ago

Do you have a reproducible example? I'm not sure this has anything to do with shape drawer.

Surakshaajith commented 4 years ago

I just created a new project and compiled with 'shapedrawer' alone. In my main activity i just added the line below inonCreate()function Pixmap pixmap = new Pixmap(10, 10, Pixmap.Format.RGBA8888);

I am getting the error when i run the code

E/hapedrawertria: No implementation found for java.nio.ByteBuffer com.badlogic.gdx.graphics.g2d.Gdx2DPixmap.newPixmap(long[], int, int, int) (tried Java_com_badlogic_gdx_graphics_g2d_Gdx2DPixmap_newPixmap and Java_com_badlogic_gdx_graphics_g2d_Gdx2DPixmap_newPixmap___3JIII) D/AndroidRuntime: Shutting down VM E/AndroidRuntime: FATAL EXCEPTION: main Process: com.example.shapedrawertrial, PID: 7193 java.lang.UnsatisfiedLinkError: No implementation found for java.nio.ByteBuffer com.badlogic.gdx.graphics.g2d.Gdx2DPixmap.newPixmap(long[], int, int, int) (tried Java_com_badlogic_gdx_graphics_g2d_Gdx2DPixmap_newPixmap and Java_com_badlogic_gdx_graphics_g2d_Gdx2DPixmap_newPixmap___3JIII) at com.badlogic.gdx.graphics.g2d.Gdx2DPixmap.newPixmap(Native Method) at com.badlogic.gdx.graphics.g2d.Gdx2DPixmap.<init>(Gdx2DPixmap.java:122) at com.badlogic.gdx.graphics.Pixmap.<init>(Pixmap.java:118) at com.example.shapedrawertrial.MainActivity.onCreate(MainActivity.java:15) at android.app.Activity.performCreate(Activity.java:7224) at android.app.Activity.performCreate(Activity.java:7213) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1272) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2926) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3081) at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78) at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108) at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1831) at android.os.Handler.dispatchMessage(Handler.java:106) at android.os.Looper.loop(Looper.java:201) at android.app.ActivityThread.main(ActivityThread.java:6823) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:547) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:873)

P.S: i am using android studio 3.5.3

tommyettinger commented 4 years ago

There are no lines that come from ShapeDrawer in your stack trace. I don't know how you've designed your application, but if you aren't using the libGDX application structure, it's going to be a challenge to use a library that's tailor-made for use in libGDX applications. See https://stackoverflow.com/questions/58295075/how-do-i-solve-this-error-libgdx-error-stage-creation#comment102984303_58295075 for a similar error that resulted from not using the libGDX framework but still trying to use something that depended on libGDX.

earlygrey commented 4 years ago

I think tommyettinger has probably guessed what's going on correctly - this is supposed to be used with libgdx.