0

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.

Red Cricket
  • 9,762
  • 21
  • 81
  • 166
  • It says `Native method not found`, so do you put libgdx's so in your apk, does it support your ABI? – Mine Feb 12 '15 at 06:39
  • That's a good question how can I tell if I am putting libgdx's co in my apk? I don't know what ABI is? Can you explain? thanks! – Red Cricket Feb 12 '15 at 06:45
  • I did not know libgdx, but a library which uses JNI should be built with .so files for different CPUs (Native CPU ABI). The .so files shall be packaged into your app's apk file so that Android can load the library for your app. – Mine Feb 12 '15 at 06:58
  • the last commit says "... still need to add to JNI" https://github.com/libgdx/libgdx/commits/master/backends/gdx-backend-android/src/com/badlogic/gdx/backends/android/AndroidGL20.java How would I add it to JNI? – Red Cricket Feb 12 '15 at 09:10

1 Answers1

-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.

Red Cricket
  • 9,762
  • 21
  • 81
  • 166