简体   繁体   中英

Why does jar library work in Eclipse but not Android Studio?

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)

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?

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.

在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM