Android Studio บ่นเกี่ยวกับคลาส JNI หายไป [ซ้ำกัน]

เหตุใด Android Studio ของฉันจึงไม่ค้นหาคลาส JNI ที่เกี่ยวข้อง

ฉันมีคลาสภายใน AsyncTask ชื่อ opensslSign ซึ่งเกี่ยวข้องกับไฟล์ jni .so, libcryptowrapper.so โครงสร้างทำงานได้ดี แต่ Android Studio บ่น: "ไม่สามารถแก้ไขฟังก์ชัน JNI ที่เกี่ยวข้องได้" ฉันได้ย้ายไฟล์ .so ของฉันไปยังหลายโฟลเดอร์เพื่อดูว่า Android พบหรือไม่ แต่ก็ไม่มีโชค

นี่คือภาพหน้าจอที่ Android Studio สามารถค้นหาคลาส JNI ได้ทั้งในไฟล์ .so และใน ไดเรกทอรีคลาส jni (ประกอบด้วย Android.mk)

เกรดของฉัน:

// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.3.3'
    }
}

apply plugin: 'com.android.application'

dependencies {
    compile 'com.android.support:multidex:1.0.1'
    compile 'com.android.support:appcompat-v7:25.0.0'

    compile fileTree(dir: 'libs', include: '*.so')
    compile fileTree(dir: 'lib', include: '*.jar')

    compile(name:'google-maps-sdk-m4b', ext:'aar')
    compile(project(':deps:android-map-utils:library'))  {
        exclude group: 'com.android.support', module: 'support-v4'
    }
    compile 'com.google.android.gms:play-services:11.0.4'
    compile "com.google.android.gms:play-services-location:11.0.4"

    compile group: 'org.apache.james', name: 'apache-mime4j', version: '0.6'

    compile group: 'commons-codec', name: 'commons-codec', version: '1.10'
    compile group: 'commons-io', name: 'commons-io', version: '2.5'

    compile group: 'net.lingala.zip4j', name: 'zip4j', version: '1.3.2'
    compile group: 'net.sf.kxml', name: 'kxml2', version: '2.3.0'
    compile group: 'net.sf.opencsv', name: 'opencsv', version: '2.3'
    compile group: 'joda-time', name: 'joda-time', version: '2.9.5'
}

android {
    compileSdkVersion 24
    buildToolsVersion '25.0.0'

    useLibrary 'org.apache.http.legacy'

    packagingOptions {
        exclude 'META-INF/DEPENDENCIES'
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/LICENSE.txt'
        exclude 'META-INF/license.txt'
        exclude 'META-INF/NOTICE'
        exclude 'META-INF/NOTICE.txt'
        exclude 'META-INF/notice.txt'
        exclude 'META-INF/ASL2.0'
        exclude  'jsr305_annotations/Jsr305_annotations.gwt.xml'
        exclude  'build-data.properties'
    }

    defaultConfig {
        // Already hit dex limit
        multiDexEnabled true
        dexOptions {
            javaMaxHeapSize "4g"
        }
    }

    sourceSets {
        main {
            manifest.srcFile 'AndroidManifest.xml'
            java.srcDirs = ['src']
            aidl.srcDirs = ['src']
            renderscript.srcDirs = ['src']
            res.srcDirs = ['res']
            assets.srcDirs = ['assets']
            jniLibs.srcDirs = ['libs']
        }

        // Move the tests to tests/java, tests/res, etc...
        instrumentTest.setRoot('tests')

        // Move the build types to build-types/<type>
        // For instance, build-types/debug/java, build-types/debug/AndroidManifest.xml, ...
        // This moves them out of them default location under src/<type>/... which would
        // conflict with src/ being used by the main source set.
        // Adding new build types or product flavors should be accompanied
        // by a similar customization.
        debug.setRoot('build-types/debug')
        release.setRoot('build-types/release')
    }
    lintOptions {
        abortOnError false
    }
    splits {
        abi {
            enable true
            reset()
            include 'x86', 'armeabi-v7a'
            universalApk true
        }
    }
}

repositories {
    flatDir{
        dirs 'libs'
    }
}

allprojects {
    repositories {
        jcenter()
    }
}

comment
โปรดอ่าน stackoverflow.com/a/44422873/192373 ฉันหวังว่านี่จะตอบคำถามของคุณ   -  person Alex Cohn    schedule 18.05.2018
comment
นี่คือคำตอบที่ฉันกำลังมองหา ขอบคุณ   -  person Rijvi Rajib    schedule 19.05.2018


คำตอบ (1)


ลบ

แยก { abi { เปิดใช้งานการรีเซ็ตจริง () รวมถึง 'x86', 'armeabi-v7a' universalApk จริง } }

ตอนนี้เป็นการจัดการอัตโนมัติโดย Android studio

person Sunil    schedule 18.05.2018
comment
ขอบคุณ ฉันลบมันแล้ว บิลด์ยังคงทำงานตามที่คาดไว้ แต่ Android Studio ยังคงบ่นเกี่ยวกับข้อผิดพลาดของลิงก์ - person Rijvi Rajib; 18.05.2018