Card.IO on Android with Gradle

我是研究僧i 提交于 2019-12-11 11:22:15

问题


I've been using Card.IO for a while. Recently I switched my build system to Gradle and I noticed the scanner does not work anymore. Instead of the camera popping up, I get a manual entry form instead. I assume this has something to do with the .so files not being included in the build, but I have no idea how to fix this.

I've tried some things in the build.gradle file, such as including '*.so' explicitly and including the subdirectories. But nothing seems to get the scanner back to work.


回答1:


Gradle doesn't yet fully support NDK and hence the *.so files need to be places in the following structure which is different:

lib/
 .. armeabi/    armeabi-v7a/    mips/       x86/

you can than put it inside of the native-libs.jar, and include that jar with card.io.jar so it ends up in .aar/libs folder.

Hope it helps.




回答2:


The Gradle Android plugin supports this now, starting version 0.7.2. All you need to do is put the native libraries in src/main/jniLibs

Sources: https://github.com/card-io/card.io-Android-SDK/issues/9 and http://tools.android.com/tech-docs/new-build-system



来源:https://stackoverflow.com/questions/19688783/card-io-on-android-with-gradle

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!