简体   繁体   中英

java.lang.UnsatisfiedLinkError: Native method not found: com.badlogic.gdx.backends.android.AndroidGL20.glGenTexture:()

I am trying to get a libGDX Android game I have been working on migrated to another laptop. I am now using 1.5.3 version of libGDX. When I try to launch my app from eclipse I get the error shown below:

02-11 21:21:35.519: E/Trace(7276): error opening trace file: No such file or directory (2)
02-11 21:21:36.019: E/dalvikvm(7276): Could not find class 'android.support.v4.app.FragmentActivity', referenced from method com.google.android.gms.common.GooglePlayServicesUtil.showErrorDialogFragment
02-11 21:21:36.019: E/dalvikvm(7276): Could not find class 'android.support.v4.app.FragmentActivity', referenced from method com.google.android.gms.common.GooglePlayServicesUtil.showErrorDialogFragment
02-11 21:21:36.820: E/AndroidRuntime(7276): FATAL EXCEPTION: GLThread 11304
02-11 21:21:36.820: E/AndroidRuntime(7276): java.lang.UnsatisfiedLinkError: Native method not found: com.badlogic.gdx.backends.android.AndroidGL20.glGenTexture:()I
02-11 21:21:36.820: E/AndroidRuntime(7276):     at com.badlogic.gdx.backends.android.AndroidGL20.glGenTexture(Native Method)
02-11 21:21:36.820: E/AndroidRuntime(7276):     at com.badlogic.gdx.graphics.GLTexture.createGLHandle(GLTexture.java:197)
02-11 21:21:36.820: E/AndroidRuntime(7276):     at com.badlogic.gdx.graphics.Texture.<init>(Texture.java:123)
02-11 21:21:36.820: E/AndroidRuntime(7276):     at com.badlogic.gdx.graphics.Texture.<init>(Texture.java:103)
02-11 21:21:36.820: E/AndroidRuntime(7276):     at com.badlogic.gdx.graphics.Texture.<init>(Texture.java:95)
02-11 21:21:36.820: E/AndroidRuntime(7276):     at com.mypkg.mygame.screens.MainMenu.show(MainMenu.java:41)
02-11 21:21:36.820: E/AndroidRuntime(7276):     at com.badlogic.gdx.Game.setScreen(Game.java:61)
02-11 21:21:36.820: E/AndroidRuntime(7276):     at com.mypkg.mygame.mygame.create(mygame.java:20)
02-11 21:21:36.820: E/AndroidRuntime(7276):     at com.badlogic.gdx.backends.android.AndroidGraphics.onSurfaceChanged(AndroidGraphics.java:241)
02-11 21:21:36.820: E/AndroidRuntime(7276):     at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1505)
02-11 21:21:36.820: E/AndroidRuntime(7276):     at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1240)

This is the bit of code that is generating this error.

    public void show () {
        FileHandle gdxfile = Gdx.files.internal("data/title.png");
        Texture t = new Texture(gdxfile); // this is line where my app crashes

The same code works fine on my other laptop. Any help is appreciated.

I migrated my project to Android Studio, followed a few instructions, and BANG! My app worked with out the runtime error. I do not understand why, but I suspect it has something to do with gradle.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM