Gradle: how to add a can for assembly, but not export it


I am using the Open Mobile API (SEEK API) in my project by adding a jar file to my gradle construct:

dependencies {compile files('libs/org.simalliance.openmobileapi.jar')}

this gives me this exception:

        java.lang.IllegalAccessError: Class ref in pre-verified class resolved to unexpected implementation
        at dalvik.system.DexFile.defineClassNative(Native Method)
        at dalvik.system.DexFile.defineClass(DexFile.java:222)
        at dalvik.system.DexFile.loadClassBinaryName(DexFile.java:215)
        at dalvik.system.DexPathList.findClass(DexPathList.java:322)
        at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:65)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:497)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:457)

I understand that I need to include jar in the compilation process, but exclude it in the link and not export to APK. this is usually done using a simple checkbox in eclipse, but I cannot find a way to do this with gradle.

any help is appreciated.

+4
source share
1 answer

In order not to export your .jar THIS may be useful. (reads well)

Additionally:

Try this to get rid of the error:

→ , lib "".

+4

Source: https://habr.com/ru/post/1529705/


All Articles