card-io / card.io-Android-SDK

card.io provides fast, easy credit card scanning in mobile apps

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Failed to load native library: No implementation found for boolean nUseNeon()

ovideozn opened this issue · comments

General information

  • SDK/Library version: 5.4.1
  • Android Version and Device: Sony Xperia Z5 with Android 7.0

Issue description

When using the card.io SDK via Gradle, everything works perfectly.

I now need to customize some features, and the first step is to get the same code running without using the Gradle dependency, which is where I get the issue described below.

I have all the Java classes, as well as the ProGuard configuration. I have extracted all of these as well as the jniLibs from the 5.4.1 AAR file. The jniLibs (all architectures) are placed under src/main/jniLibs.

The project compiles with no errors. When I invoke the CardIOActivity however, I get sent to the manual entry page, and the following error is printed in the logs:

E/card.io: Failed to load native library: No implementation found for boolean com.foo.bar.cardio.CardScanner.nUseNeon() (tried Java_com_foo_bar_cardio_CardScanner_nUseNeon and Java_com_foo_bar_cardio_CardScanner_nUseNeon__)

I have tried lots of different things but I cannot tell why it's failing.

I've even moved the following lines of code higher up so that they get called first, and no error is thrown:

loadLibrary("opencv_core");
loadLibrary("opencv_imgproc");
loadLibrary("cardioDecider");

As soon as if (nUseNeon()) { is called though, the error above is printed in the logs. Please help, I've wasted many hours :)

Funnily, as always, I realize what the issue is 1 minute after asking about it, after several hours of trying really hard to figure it out. The method name looked for is no longer the one in the .so files, because of the different package name.....

Full solution: Compile the .so files under my own package name by taking the source code from the other repository.
Lazy solution (untested): Create a module within the project that has the same package name as the original - "io.card.payment"

(Edit) The lazy solution has now been tested and it does indeed work as expected.