Note that there are some explanatory texts on larger screens.

plurals
  1. POandroid using third party libraries getting "Link of class failed" and "VFY: unable to find class"
    primarykey
    data
    text
    <p>I have a libgdx project using third party libraries (jersey). It compiles fine on the desktop version but crashes on android with "Link of class XXX failed" and "VFY: unable to find class ... " errors.</p> <p>It seems like this exact question comes up a lot here. But I've looked through other answers and have been trying to get this to work for a couple of days now with no luck.</p> <p>I've added libraries to the libs folder and checked that they're ticked in the order and export menu as all the other questions suggest.</p> <p>Here's a minimal project that has the problem. It's the default base project and android project automatically created by libgdx with the jersey library added and a couple of lines in the base project (in MyGdxGame.java) that use the jersey library and cause it to crash on android. <a href="https://dl.dropboxusercontent.com/u/23063759/my-gdx-game.zip" rel="nofollow">https://dl.dropboxusercontent.com/u/23063759/my-gdx-game.zip</a></p> <p>Here's the logcat output i'm getting</p> <pre><code>12-10 21:19:10.531: W/dalvikvm(12940): Link of class 'Lcom/sun/jersey/core/osgi/OsgiRegistry;' failed 12-10 21:19:10.541: I/dalvikvm(12940): Could not find method com.sun.jersey.core.osgi.OsgiRegistry.getInstance, referenced from method com.sun.jersey.core.reflection.ReflectionHelper.getOsgiRegistryInstance 12-10 21:19:10.541: W/dalvikvm(12940): VFY: unable to resolve static method 10327: Lcom/sun/jersey/core/osgi/OsgiRegistry;.getInstance ()Lcom/sun/jersey/core/osgi/OsgiRegistry; 12-10 21:19:10.541: D/dalvikvm(12940): VFY: replacing opcode 0x71 at 0x0008 12-10 21:19:10.541: I/dalvikvm(12940): Failed resolving Lcom/sun/jersey/core/osgi/OsgiRegistry; interface 2368 'Lorg/osgi/framework/SynchronousBundleListener;' 12-10 21:19:10.541: W/dalvikvm(12940): Link of class 'Lcom/sun/jersey/core/osgi/OsgiRegistry;' failed 12-10 21:19:10.541: W/dalvikvm(12940): VFY: unable to find class referenced in signature (Lcom/sun/jersey/core/osgi/OsgiRegistry;) 12-10 21:19:10.631: W/dalvikvm(12940): threadid=11: thread exiting with uncaught exception (group=0x41560b 90) 12-10 21:19:10.672: D/dalvikvm(12940): GC_FOR_ALLOC freed 563K, 7% free 9262K/9856K, paused 37ms, total 3 7ms 12-10 21:19:10.672: E/AndroidRuntime(12940): FATAL EXCEPTION: GLThread 792 12-10 21:19:10.672: E/AndroidRuntime(12940): Process: com.me.mygdxgame, PID: 12940 12-10 21:19:10.672: E/AndroidRuntime(12940): java.lang.NullPointerException 12-10 21:19:10.672: E/AndroidRuntime(12940): at javax.ws.rs.core.MediaType.valueOf(MediaType.java:119) 12-10 21:19:10.672: E/AndroidRuntime(12940): at com.sun.jersey.api.client.PartialRequestBuilder.type(PartialRequestBuilder.java:92) 12-10 21:19:10.672: E/AndroidRuntime(12940): at com.sun.jersey.api.client.WebResource.type(WebResource.java:349) 12-10 21:19:10.672: E/AndroidRuntime(12940): at com.me.mygdxgame.MyGdxGame.create(MyGdxGame.java:48) 12-10 21:19:10.672: E/AndroidRuntime(12940): at com.badlogic.gdx.backends.android.AndroidGraphics.onSurfaceChanged(AndroidGraphics.java:292) 12-10 21:19:10.672: E/AndroidRuntime(12940): at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1512) 12-10 21:19:10.672: E/AndroidRuntime(12940): at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1240) </code></pre> <p>In the example i gave i'm using jersey, but the same thing happened when i switched it for a different library. I feel like there's something stupid i'm missing. But I just can't find it.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload