Problem occurrence:

Room, which was originally used for database, found that the author of Greendao had written an objectbox and imported the project for fun. As a result, the above problems occurred.

Screen:

  1. First check if there is this so file in the installation file,adb shellEnter the device atThe data/data/lib/package nameSure enough, there are some other SO, but there is no error so. Ok, problem finding.
  2. Since there is no installation, is there a problem with packing? Find the apK file, open it, arm, armv7, armV8, etc in lib. Error so in arm, armV7, ARMV8 do not exist. OK, problem located.

The device is ARMV7. The database framework room used before is some encapsulation of SQLite by Google, without introducing SO, only ARM is used after packaging, which is compatible with almost all Android devices, so no error was reported. After the introduction of ObjectBox, the author thinks that ARM is outdated and has no support. Moreover, I did not introduce it manually. It was introduced in build.gradle through the plug-in, and I did not perceive this problem. Therefore, arm, ARMV7, ARMV8 and so on are packaged, but the device is V7, and armV7 is only installed in the installation, resulting in an error.

Solution:

The NDK support in module build.gradle is limited to armv7

defaultConfig {
        applicationId "com.optimais.scales"
        minSdkVersion 19
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"

        ndk {
            abiFilters 'armeabi-v7a'// generate armv7 so}}Copy the code

Then rename the ARM folder in jnilib to armeabi-v7a. (He didn’t provide V7, so that’s it)