0

I have a jar library (specifically Rajawali v0.9) that works perfectly in Eclipse when using and compiling my project but Android Studio gives a ton of errors when trying to compile. Why is that and is there a way to bypass lint on specific jar library?

EDIT

Had to remove the manifest via gradle because of some mismatch but here is the logcat when I try to run the app:

    java.lang.UnsatisfiedLinkError: Couldn't load bufferutil from loader dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.pspdemocenter.graffitilwp-1.apk"],nativeLibraryDirectories=[/data/app-lib/com.pspdemocenter.graffitilwp-1, /vendor/lib, /system/lib]]]: findLibrary returned null
    at java.lang.Runtime.loadLibrary(Runtime.java:358)
    at java.lang.System.loadLibrary(System.java:526)
    at rajawali.util.BufferUtil.<clinit>(BufferUtil.java:16)
    at rajawali.Geometry3D.setVertices(Geometry3D.java:506)
    at rajawali.Geometry3D.setVertices(Geometry3D.java:494)
    at rajawali.Geometry3D.setData(Geometry3D.java:259)
    at rajawali.BaseObject3D.setData(BaseObject3D.java:177)
    at rajawali.BaseObject3D.setData(BaseObject3D.java:154)
    at rajawali.BaseObject3D.setData(BaseObject3D.java:171)
    at rajawali.BaseObject3D.<init>(BaseObject3D.java:114)
    at com.pspdemocenter.graffitilwp.MyRenderer.LoadSerializedMesh(MyRenderer.java:65)
    at com.pspdemocenter.graffitilwp.MyRenderer.initScene(MyRenderer.java:119)
    at rajawali.renderer.RajawaliRenderer.onSurfaceCreated(RajawaliRenderer.java:362)
    at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1505)
    at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1244)
Steve C.
  • 1,283
  • 3
  • 18
  • 50

2 Answers2

1

You can also use jar library in android studio like that :-

Step 1 : Now under your app folder you should see libs, if you don't see it, then create it .

Step 2 : Drag & Drop the .jar file here, you may be get a prompt "This file does not belong to the project", just click OK Button .

Step 3 : Now you should see the jar file under libs folder, right click on the jar file and select "Add as library", Click OK for prompt "Create Library"

Step 4 : Now this jar has been added.

enter image description here

0

Rajawali works better with gradle when going with Android studio. Jar does not work with Android Studio because it has Gradle. Eclipse needs jars because it does not start nativly with Gradle. I have looked into Rajawali myself and the only descriptions of how it works is with Gradle.

EDIT:

Maybe this will help: Android Studio: Add jar as library?

Community
  • 1
  • 1
Zoe stands with Ukraine
  • 25,310
  • 18
  • 114
  • 149
  • Correct, the new version works better with Gradle but I need to continue to use the older version which is in jar format because of the features my app needs from that version. – Steve C. Jun 29 '16 at 09:48
  • Maybe this will help: http://stackoverflow.com/questions/25660166/how-to-add-a-jar-in-external-libraries-in-android-studio – Zoe stands with Ukraine Jun 29 '16 at 09:53
  • I appreciate the help but I already know how to add a jar library as well as an external library. I've done it multiple times with other apps. I was hoping to update this particular app using Android Studio because of the features available in Android Studio. – Steve C. Jun 29 '16 at 10:01
  • Is it possible that because I have to remove the manifest that the app is not registering an OpenGL api? – Steve C. Jun 29 '16 at 10:02
  • maybe, but you have to have a manifest. Gradle does not replace everything! – Zoe stands with Ukraine Jun 29 '16 at 10:03