简体   繁体   中英

Why is Android Studio giving me an error about .so files when I try to add a .jar file as a dependency?

I am trying to add a .jar file to my company's app. I added it to app\libs , and added the dependency to my gradle file as implementation files('libs\\libname.jar) . Android Studio detects the imported classes and everything, but when I go to build and run my app, it immediately crashes with the following error: Failed to load libname.so. Make sure the jni symbols are accessible somehow Failed to load libname.so. Make sure the jni symbols are accessible somehow . I'm not sure why it is talking about an .so file and jni symbols, but I'm guessing it's related. There is also an example app for this .jar library but it also crashes with the same error.

The JAR contains a reference to a JNI library that it is trying to load. You are not including the corresponding .so file.

My guess is that this JAR is not set up for use with Android. If it is, look for an AAR file, preferably via a Maven repository reference rather than a bare file, and use it.

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