java.lang.UnsatisfiedLinkError: 无法获取类 com.sun.jna.Pointer (Neurotechnology Megamatcher SDK)



我想尝试将多生物识别示例android(来自 https://www.neurotechnology.com/download.html#megamatcher_verifinger_verilook_verieye_sdk_trial(组合到我的项目中。

我已经将源代码复制到我的项目中,并添加了所有 gradle depedies。在构建apk时,出现了此错误:

java.lang.UnsatisfiedLinkError: 无法获取类 com.sun.jna.Pointer

当我调试错误时,错误是尝试调用此代码时:

NLicenseManager.setTrialMode(LicensingPreferencesFragment.isUseTrial(this));

如果我注释该代码,仍然会出现相同的错误,但在此代码中:

NCore.setContext(this);

这是我的 Gradle 实现库:

//for my project
    implementation 'com.android.support.constraint:constraint-layout:1.0.2'
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation 'com.android.support:appcompat-v7:27.1.1'
    implementation 'com.android.support:design:27.1.1'
    implementation 'com.android.support:mediarouter-v7:27.1.1'
    implementation 'org.greenrobot:greendao:3.2.2'
    implementation 'com.github.yuweiguocn:GreenDaoUpgradeHelper:v2.0.2'
    implementation 'com.jakewharton:butterknife:7.0.1'
    implementation 'com.google.firebase:firebase-appindexing:17.1.0'
    implementation 'com.google.android.gms:play-services-maps:16.1.0'
    implementation 'com.google.android.gms:play-services-location:16.0.0'
    implementation 'com.journeyapps:zxing-android-embedded:3.6.0'
    implementation 'com.google.zxing:core:3.3.2'
    implementation 'com.github.dmytrodanylyk.android-process-button:library:1.0.4'
    implementation files('libs/volley.jar')
    implementation files('libs/httpclient-4.5.2.jar')
    implementation files('libs/httpcore-4.4.4.jar')
    implementation files('libs/httpmime-4.5.2.jar')
    implementation files('libs/commons-io-2.6.jar')
    implementation 'com.hrules:horizontalnumberpicker:1.1.1'
    implementation 'com.afollestad.material-dialogs:commons:0.9.6.0'
    implementation 'com.github.cdflynn:checkview:v1.1'
    api 'io.jsonwebtoken:jjwt-api:0.10.5'
    runtimeOnly 'io.jsonwebtoken:jjwt-impl:0.10.5'
    runtimeOnly('io.jsonwebtoken:jjwt-orgjson:0.10.5') {
        exclude group: 'org.json', module: 'json' 
    }

// for megamatcher multiobiometric 
        implementation ":neurotec-biometrics-client-android"
        implementation ":neurotec-devices-fscanners-nitgen-android"
        implementation ":neurotec-devices-fscanners-aratek-android"
        implementation ":neurotec-devices-fscanners-aratek-trustfinger-android"
        implementation ":neurotec-devices-fscanners-suprema-biomini-android"
        implementation ":neurotec-devices-fscanners-bluefin-android"
        implementation ":neurotec-devices-multimodal-credenceid-android"
        implementation ":neurotec-devices-fscanners-digitalpersona-uareu-android"
        implementation ":neurotec-devices-fscanners-secugen-android"
        implementation ":neurotec-devices-fscanners-futronic-android"
        implementation ":neurotec-devices-fscanners-integratedbiometrics-android"
        implementation ":neurotec-devices-fscanners-smufsbio-android"
        implementation ":neurotec-devices-fscanners-startek-android"
        implementation ":neurotec-devices-fscanners-nextbiometrics-android"
        implementation ":neurotec-devices-fscanners-greenbit-android"
        implementation ":neurotec-devices-fscanners-zkteco-android"
        implementation ":neurotec-devices-irisscanners-iritech-irishield-android"
        implementation ":neurotec-devices-irisscanners-mantra-android"
        implementation ":neurotec-devices-media-android"
        implementation ":neurotec-biometrics-android"
        implementation ":neurotec-devices-android"
        implementation(name:'neurotec-biometrics-gui-android', ext:'aar')
        implementation project(":samples-utils")
//inside samples-utils
    api ":neurotec-core-android"
    api ":neurotec-licensing-android"
    api ":neurotec-gui-android"
    api ":neurotec-media-android"
    api ":neurotec-media-processing-android"
    api ":jna"
    api "com.android.support:support-v4:27.1.1"
    api(name:'neurotec-licensing-gui-android', ext:'aar')
我已经

检查过我已经在 gradle 中调用了 jna jar 的实现,任何人都可以提供帮助吗?

最后,过了一天,我发现问题是如果我们的应用程序使用 shrinkResources true 和 minifyEnabled true,我们应该在 proguard 规则中为 megamatcher 使用的所有库添加一些例外,如下所示:

-keep class com.sun.jna.** { *; }
-keep class org.libusb.** { *; }
-keep class com.neurotec.** { *; }
-keep class cn.com.aratek.** { *; }
-keep class com.aratek.** { *; }
-keep class com.cognaxon.** { *; }
-keep class com.digitalpersona.uareu.** { *; }
-keep class com.futronictech.** { *; }
-keep class com.greenbit.** { *; }
-keep class com.integratedbiometrics.** { *; }
-keep class com.nextbiometrics.fingerprint.NXTSensor.** { *; }
-keep class com.SecuGen.** { *; }
-keep class com.smufsbio.** { *; }
-keep class com.startek.fp300u.** { *; }
-keep class com.android.biomini.** { *; }
-keep class com.suprema.** { *; }
-keep class com.zkteco.** { *; }
-keep class com.zkteco.** { *; }
-keep class com.iritech.** { *; }
-keep class com.mantra.mis100.** { *; }
-keep class com.credenceid.** { *; }
-keep class com.gstreamer.** { *; }

相关内容

最新更新