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

▼魔方 西西 提交于 2019-12-12 06:06:44

问题


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.


回答1:


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.



来源:https://stackoverflow.com/questions/28470101/java-lang-unsatisfiedlinkerror-native-method-not-found-com-badlogic-gdx-backen

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!