问题
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