android – java.lang.UnsatisfiedLinkError:找不到布尔值的实现

我在我的项目中使用“.so”文件但是它给出了以下错误“
java.lang.UnsatisfiedLinkError:找不到布尔的实现”,我已经尝试使用Cygwin重新创建“.so”并将其放在jniLibs文件夹中并使用create一罐它,但它给出了同样的错误.

但是同样的“.so”文件在我现有的项目中正在运行.我尝试了很多方法,但它根本不起作用,我该怎么办?

com.amaze.filemanager E/art: No implementation found for boolean com.amaze.filemanager.scanner.SignatureLib.InitScanner(java.lang.String, java.lang.String) (tried Java_com_amaze_filemanager_scanner_SignatureLib_InitScanner and Java_com_amaze_filemanager_scanner_SignatureLib_InitScanner__Ljava_lang_String_2Ljava_lang_String_2)
12-19 11:47:07.463 4579-4934/com.amaze.filemanager E/AndroidRuntime: FATAL EXCEPTION: Thread-5230
Process: com.amaze.filemanager, PID: 4579
java.lang.UnsatisfiedLinkError: No implementation found for boolean com.amaze.filemanager.scanner.SignatureLib.InitScanner(java.lang.String, java.lang.String) (tried Java_com_amaze_filemanager_scanner_SignatureLib_InitScanner and Java_com_amaze_filemanager_scanner_SignatureLib_InitScanner__Ljava_lang_String_2Ljava_lang_String_2)
at com.amaze.filemanager.scanner.SignatureLib.InitScanner(Native Method)
at com.amaze.filemanager.scanner.SignatureLib.InitializeScanner(SignatureLib.java:42)
at com.amaze.filemanager.scanner.Signature.(Signature.java:62)
at com.amaze.filemanager.ScanForVirusActivity$1.run(ScanForVirusActivity.java:66)

public class SignatureLib {

    static {
        System.loadLibrary("Signature");
    }

    SharedPreferencesUtils spu;
    Context context;

    public SignatureLib(Context context) {
        this.context = context;
    }

    private native boolean InitScanner(String strDBPath, String dbPathTemp);

    private native boolean DeInitScanner();

    private native String checkVirus(String filepath);

    private native boolean UploadFile(String FilePath, String DeviceID, String path);

    private native boolean DownloadFile(String FilePath, String DeviceID, String path);

    private native boolean IsGameApp(String AppName);

    private native boolean SetUpdateInProgressStatus(boolean bStatus);

    public boolean InitializeScanner(String strDBPath) {

        spu = new SharedPreferencesUtils();
        String packageName = context.getPackageName();
        String dbPathTemp = "data/data/" + packageName + "/";

        return InitScanner(strDBPath, dbPathTemp);
    }

}

最佳答案 是的,需要完整的堆栈跟踪 – 你最初在一个毫无意义的地方打破了它.它的说法是你的.so文件没有InitScanner功能 – 你在C文件中错误地命名它,你的签名错误,或者根本就没有.或者,如果你使用C,你忘了extern C函数.

点赞