我想知道为什么这不是在Android上运行

时间:2014-12-20 04:07:51

标签: java android eclipse libgdx 2d

我在Github上看到这个2D游戏并且它在桌面上正常运行但是当我尝试在android上运行它时,它似乎有一个我不知道的错误。我使用genymotion作为模拟器

12-20 03:56:05.067: W/dalvikvm(1023): Exception Lcom/badlogic/gdx/utils/GdxRuntimeException; thrown while initializing Lcom/badlogic/gdx/backends/android/AndroidApplication;
12-20 03:56:05.075: W/dalvikvm(1023): Class init failed in newInstance call (Lcom/game/libgdx/roguelikeengine/MainActivity;)
12-20 03:56:05.075: D/AndroidRuntime(1023): Shutting down VM
12-20 03:56:05.075: W/dalvikvm(1023): threadid=1: thread exiting with uncaught exception (group=0xa6315288)
12-20 03:56:05.079: E/AndroidRuntime(1023): FATAL EXCEPTION: main
12-20 03:56:05.079: E/AndroidRuntime(1023): java.lang.ExceptionInInitializerError
12-20 03:56:05.079: E/AndroidRuntime(1023):     at java.lang.Class.newInstanceImpl(Native Method)
12-20 03:56:05.079: E/AndroidRuntime(1023):     at java.lang.Class.newInstance(Class.java:1319)
12-20 03:56:05.079: E/AndroidRuntime(1023):     at android.app.Instrumentation.newActivity(Instrumentation.java:1053)
12-20 03:56:05.079: E/AndroidRuntime(1023):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1974)
12-20 03:56:05.079: E/AndroidRuntime(1023):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2084)
12-20 03:56:05.079: E/AndroidRuntime(1023):     at android.app.ActivityThread.access$600(ActivityThread.java:130)
12-20 03:56:05.079: E/AndroidRuntime(1023):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1195)
12-20 03:56:05.079: E/AndroidRuntime(1023):     at android.os.Handler.dispatchMessage(Handler.java:99)
12-20 03:56:05.079: E/AndroidRuntime(1023):     at android.os.Looper.loop(Looper.java:137)
12-20 03:56:05.079: E/AndroidRuntime(1023):     at android.app.ActivityThread.main(ActivityThread.java:4745)
12-20 03:56:05.079: E/AndroidRuntime(1023):     at java.lang.reflect.Method.invokeNative(Native Method)
12-20 03:56:05.079: E/AndroidRuntime(1023):     at java.lang.reflect.Method.invoke(Method.java:511)
12-20 03:56:05.079: E/AndroidRuntime(1023):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
12-20 03:56:05.079: E/AndroidRuntime(1023):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
12-20 03:56:05.079: E/AndroidRuntime(1023):     at dalvik.system.NativeStart.main(Native Method)
12-20 03:56:05.079: E/AndroidRuntime(1023): Caused by: com.badlogic.gdx.utils.GdxRuntimeException: Couldn't load shared library 'gdx' for target: Linux, 32-bit
12-20 03:56:05.079: E/AndroidRuntime(1023):     at com.badlogic.gdx.utils.SharedLibraryLoader.load(SharedLibraryLoader.java:110)
12-20 03:56:05.079: E/AndroidRuntime(1023):     at com.badlogic.gdx.utils.GdxNativesLoader.load(GdxNativesLoader.java:34)
12-20 03:56:05.079: E/AndroidRuntime(1023):     at com.badlogic.gdx.backends.android.AndroidApplication.<clinit>(AndroidApplication.java:62)
12-20 03:56:05.079: E/AndroidRuntime(1023):     ... 15 more
12-20 03:56:05.079: E/AndroidRuntime(1023): Caused by: java.lang.UnsatisfiedLinkError: Couldn't load gdx: findLibrary returned null
12-20 03:56:05.079: E/AndroidRuntime(1023):     at java.lang.Runtime.loadLibrary(Runtime.java:365)
12-20 03:56:05.079: E/AndroidRuntime(1023):     at java.lang.System.loadLibrary(System.java:535)
12-20 03:56:05.079: E/AndroidRuntime(1023):     at com.badlogic.gdx.utils.SharedLibraryLoader.load(SharedLibraryLoader.java:106)
12-20 03:56:05.079: E/AndroidRuntime(1023):     ... 17 more

我尝试了这个libgdx throwing an exception on helloworld app when ran in emulator但是对我没有用,但是logcat变成了这个

12-20 06:01:01.724: D/dalvikvm(1560): Trying to load lib /data/data/com.game.libgdx.roguelikeengine/lib/libgdx.so 0xa6ac84b8
12-20 06:01:01.724: D/dalvikvm(1560): Added shared lib /data/data/com.game.libgdx.roguelikeengine/lib/libgdx.so 0xa6ac84b8
12-20 06:01:01.728: D/dalvikvm(1560): No JNI_OnLoad found in /data/data/com.game.libgdx.roguelikeengine/lib/libgdx.so 0xa6ac84b8, skipping init
12-20 06:01:01.732: D/libEGL(1560): loaded /system/lib/egl/libEGL_genymotion.so
12-20 06:01:01.732: D/(1560): HostConnection::get() New Host Connection established 0xb8c34bc8, tid 1560
12-20 06:01:01.736: D/libEGL(1560): loaded /system/lib/egl/libGLESv1_CM_genymotion.so
12-20 06:01:01.736: D/libEGL(1560): loaded /system/lib/egl/libGLESv2_genymotion.so
12-20 06:01:01.756: I/AndroidInput(1560): sensor listener setup
12-20 06:01:01.920: W/EGL_genymotion(1560): eglSurfaceAttrib not implemented
12-20 06:01:01.928: D/OpenGLRenderer(1560): Enabling debug mode 0
12-20 06:01:01.948: D/(1560): HostConnection::get() New Host Connection established 0xb8c28f30, tid 1573
12-20 06:01:01.960: D/OpenGLRenderer(1560): TextureCache::get: create texture(0xb8c3c750): name, size, mSize = 1, 1048576, 1048576
12-20 06:01:01.960: W/GL2JNIView(1560): creating OpenGL ES 2.0 context
12-20 06:01:02.024: D/dalvikvm(1560): Trying to load lib /data/data/com.game.libgdx.roguelikeengine/lib/libgdx.so 0xa6ac84b8
12-20 06:01:02.024: D/dalvikvm(1560): Shared lib '/data/data/com.game.libgdx.roguelikeengine/lib/libgdx.so' already loaded in same CL 0xa6ac84b8
12-20 06:01:02.024: I/GL2(1560): all initialized 2
12-20 06:01:02.024: I/AndroidGraphics(1560): OGL renderer: Android Emulator OpenGL ES Translator (GeForce GT 750M/PCIe/SSE2)
12-20 06:01:02.028: I/AndroidGraphics(1560): OGL vendor: Google (NVIDIA Corporation)
12-20 06:01:02.032: I/AndroidGraphics(1560): OGL version: OpenGL ES 2.0 (4.4.0 NVIDIA 344.75)
12-20 06:01:02.032: I/AndroidGraphics(1560): OGL extensions: GL_EXT_debug_marker GL_OES_EGL_image GL_OES_depth24 GL_OES_depth32 GL_OES_element_index_uint GL_OES_texture_float GL_OES_texture_float_linear GL_OES_compressed_paletted_texture GL_OES_compressed_ETC1_RGB8_texture GL_OES_depth_texture GL_OES_texture_half_float GL_OES_texture_half_float_linear GL_OES_packed_depth_stencil GL_OES_vertex_half_float 
12-20 06:01:02.032: E/EGL_genymotion(1560): [getAttribValue] Bad attribute idx
12-20 06:01:02.032: E/EGL_genymotion(1560): tid 1573: eglGetConfigAttrib(575): error 0x3004 (EGL_BAD_ATTRIBUTE)
12-20 06:01:02.032: E/EGL_genymotion(1560): [getAttribValue] Bad attribute idx
12-20 06:01:02.032: E/EGL_genymotion(1560): tid 1573: eglGetConfigAttrib(575): error 0x3004 (EGL_BAD_ATTRIBUTE)
12-20 06:01:02.032: I/AndroidGraphics(1560): framebuffer: (5, 6, 5, 0)
12-20 06:01:02.032: I/AndroidGraphics(1560): depthbuffer: (24)
12-20 06:01:02.032: I/AndroidGraphics(1560): stencilbuffer: (0)
12-20 06:01:02.032: I/AndroidGraphics(1560): samples: (0)
12-20 06:01:02.032: I/AndroidGraphics(1560): coverage sampling: (false)
12-20 06:01:02.032: I/AndroidGraphics(1560): Managed meshes/app: { }
12-20 06:01:02.032: I/AndroidGraphics(1560): Managed textures/app: { }
12-20 06:01:02.032: I/AndroidGraphics(1560): Managed shaders/app: { }
12-20 06:01:02.032: I/AndroidGraphics(1560): Managed buffers/app: { }
12-20 06:01:02.052: D/OpenGLRenderer(1560): TextureCache::get: create texture(0xb8c4fc08): name, size, mSize = 2, 1764, 1050340
12-20 06:01:02.172: E/dalvikvm(1560): Could not find class 'com.badlogic.gdx.graphics.g2d.freetype.FreeTypeFontGenerator', referenced from method com.game.libgdx.roguelikeengine.Credits.show
12-20 06:01:02.172: W/dalvikvm(1560): VFY: unable to resolve new-instance 384 (Lcom/badlogic/gdx/graphics/g2d/freetype/FreeTypeFontGenerator;) in Lcom/game/libgdx/roguelikeengine/Credits;
12-20 06:01:02.172: D/dalvikvm(1560): VFY: replacing opcode 0x22 at 0x0009
12-20 06:01:02.172: D/dalvikvm(1560): DexOpt: unable to opt direct call 0x0fe0 at 0x0b in Lcom/game/libgdx/roguelikeengine/Credits;.show
12-20 06:01:02.172: W/dalvikvm(1560): threadid=10: thread exiting with uncaught exception (group=0xa62f7288)
12-20 06:01:02.172: E/AndroidRuntime(1560): FATAL EXCEPTION: GLThread 119
12-20 06:01:02.172: E/AndroidRuntime(1560): java.lang.NoClassDefFoundError: com.badlogic.gdx.graphics.g2d.freetype.FreeTypeFontGenerator
12-20 06:01:02.172: E/AndroidRuntime(1560):     at com.game.libgdx.roguelikeengine.Credits.show(Credits.java:55)
12-20 06:01:02.172: E/AndroidRuntime(1560):     at com.badlogic.gdx.Game.setScreen(Game.java:62)
12-20 06:01:02.172: E/AndroidRuntime(1560):     at com.game.libgdx.roguelikeengine.Explorer_libgdx.create(Explorer_libgdx.java:37)
12-20 06:01:02.172: E/AndroidRuntime(1560):     at com.badlogic.gdx.backends.android.AndroidGraphics.onSurfaceChanged(AndroidGraphics.java:334)
12-20 06:01:02.172: E/AndroidRuntime(1560):     at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1505)
12-20 06:01:02.172: E/AndroidRuntime(1560):     at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1240)
12-20 06:01:02.208: I/AndroidInput(1560): sensor listener tear down
12-20 06:01:02.208: I/AndroidGraphics(1560): Managed meshes/app: { }
12-20 06:01:02.208: I/AndroidGraphics(1560): Managed textures/app: { }
12-20 06:01:02.208: I/AndroidGraphics(1560): Managed shaders/app: { }
12-20 06:01:02.208: I/AndroidGraphics(1560): Managed buffers/app: { }

1 个答案:

答案 0 :(得分:0)

将文件夹armeabi和armeabi-v7a添加到项目的/ libs