java.lang.UnsatifiedLinkError:Can';t获取类com.sun.jna.Pointer(神经技术Megamatcher SDK)

java.lang.UnsatifiedLinkError:Can';t获取类com.sun.jna.Pointer(神经技术Megamatcher SDK),java,android,gradle,jna,Java,Android,Gradle,Jna,我想尝试将多生物特征样本android(from)结合到我的项目中 我已经将源代码复制到我的项目中,并添加所有渐变依赖项。生成apk时,出现以下错误: java.lang.UnsatifiedLinkError:无法获取类com.sun.jna.Pointer 调试错误时,错误发生在尝试调用以下代码时: NLicenseManager.setTrialMode(LicensingPreferencesFragment.isUseTrial(this)); 如果我对该代码进行注释,同样的错误仍然

我想尝试将多生物特征样本android(from)结合到我的项目中

我已经将源代码复制到我的项目中,并添加所有渐变依赖项。生成apk时,出现以下错误:

java.lang.UnsatifiedLinkError:无法获取类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.** { *; }

最后,过了一天,我发现问题在于,如果我们的应用程序使用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.** { *; }

您的依赖项或其版本有问题。如果看不到您包含了哪些JAR,就无法提供帮助。@DanielWiddis我已经用“添加项目中包含的库”编辑了我的问题,也许您可以检查一下,我看不到您将JNA列为依赖项。它很可能是您列出的内容的可传递依赖项。从您的问题听起来,您似乎是在手动包含JAR,而不是让gradle将其拉入。jna已经列出,正如您在最后一部分(sampel utils内部)中所看到的,有api“:jna”@DanielWiddis您的依赖项或其版本有问题。如果看不到您包含了哪些JAR,就无法提供帮助。@DanielWiddis我已经用“添加项目中包含的库”编辑了我的问题,也许您可以检查一下,我看不到您将JNA列为依赖项。它很可能是您列出的内容的可传递依赖项。从您的问题听起来,您似乎是在手动包含JAR,而不是让gradle将其拉入。jna已经列出,正如您在最后一部分(sampel utils内部)中所看到的,有api“:jna”@DanielWiddis
-keep class com.digitalpersona.uareu.*{*;}
这能解决您的问题吗?我仍然困在这里面。
-保留com.digitalpersona.uareu.*{*}
这能解决你的问题吗?我仍然困在这里面。