簡體   English   中英

加載armabi庫或加載.so文件

[英]load armabi library or load .so files

我想使用Android-pdfview庫在我的應用程序中顯示pdf文件。 我已經成功編譯了庫,但是當我想在logcat之后顯示pdf時出現錯誤:

 java.lang.UnsatisfiedLinkError: Couldn't load vudroid from loader dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/de.gestureanywhere-1.apk"],nativeLibraryDirectories=[/data/app-lib/de.gestureanywhere-1, /vendor/lib, /system/lib]]]: findLibrary returned null
        at java.lang.Runtime.loadLibrary(Runtime.java:358)
        at java.lang.System.loadLibrary(System.java:526)
        at de.gestureanywhere.Changelog_View.onCreate(Changelog_View.java:60)
        at android.app.Activity.performCreate(Activity.java:5241)
        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2151)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2236)
        at android.app.ActivityThread.access$800(ActivityThread.java:138)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1199)
        at android.os.Handler.dispatchMessage(Handler.java:102)
        at android.os.Looper.loop(Looper.java:136)
        at android.app.ActivityThread.main(ActivityThread.java:5034)
        at java.lang.reflect.Method.invokeNative(Native Method)
        at java.lang.reflect.Method.invoke(Method.java:515)
        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:795)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:611)
        at dalvik.system.NativeStart.main(Native Method)

我已經閱讀了幾個小時,才發現我必須編譯libvudroid.so或必須編譯armeabi庫。

但是,我之前閱讀過的所有操作方法都行不通。

那么您能否為我提供一個逐步解決方案如何編譯庫?

我的gradle文件現在看起來像這樣:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 22
    buildToolsVersion "21.1.2"
    compileOptions.encoding = 'ISO-8859-1'

defaultConfig {
    applicationId "de.gestureanywhere"
    minSdkVersion 16
    targetSdkVersion 22
    versionCode 1
    versionName "1.0"
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile ( 'proguard-android.txt' ), 'proguard-rules.pro'
    }
}
}
dependencies {
    compile fileTree ( include: '*.jar', dir: 'libs' )
    compile 'com.android.support:appcompat-v7:22.0.0'
compile files ( 'libs/android-pdfview-1.0.3.jar' )

}

非常感謝您的幫助。

jar文件不包含pdfview庫運行所需的本機庫。

代替

compile files ( 'libs/android-pdfview-1.0.3.jar' )

采用

compile 'com.joanzapata.pdfview:android-pdfview:1.0.4@aar'

加載包含Java和本機庫的AAR包依賴項。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM