首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >UnsatisfiedLinkError:在Android调试构建中找不到"libadblockplus-jni.so“

UnsatisfiedLinkError:在Android调试构建中找不到"libadblockplus-jni.so“
EN

Stack Overflow用户
提问于 2019-05-09 18:21:38
回答 2查看 615关注 0票数 0

我正在使用AdblockWebView

https://github.com/adblockplus/libadblockplus-android

在我的Android应用程序中。我有三种构建类型:"release“、"debug”和"dev",而Webview在测试"dev“构建类型时正在工作。

但是,当我启动"debug“类型时,它与只使用配置常量的"dev”不同,当我毫无理由地打开webview活动时,应用程序就会崩溃。

代码语言:javascript
运行
复制
java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/app....debug-W8BipJfr6wKqz06J0zWgrQ==/base.apk"],nativeLibraryDirectories=[/data/app/app...debug-W8BipJfr6wKqz06J0zWgrQ==/lib/arm64, /data/app/app....debug-W8BipJfr6wKqz06J0zWgrQ==/base.apk!/lib/arm64-v8a, /system/lib64, /system/vendor/lib64]]] couldn't find "libadblockplus-jni.so"
    at java.lang.Runtime.loadLibrary0(Runtime.java:1011)
    at java.lang.System.loadLibrary(System.java:1657)
    at org.adblockplus.libadblockplus.Platform.<clinit>(Platform.java:27)
    at org.adblockplus.libadblockplus.android.AdblockEngine$Builder.createEngines(AdblockEngine.java:265)
    at org.adblockplus.libadblockplus.android.AdblockEngine$Builder.build(AdblockEngine.java:250)
    at org.adblockplus.libadblockplus.android.SingleInstanceEngineProvider.createAdblock(SingleInstanceEngineProvider.java:174)
    at org.adblockplus.libadblockplus.android.SingleInstanceEngineProvider.access$100(SingleInstanceEngineProvider.java:35)
    at org.adblockplus.libadblockplus.android.SingleInstanceEngineProvider$1.run(SingleInstanceEngineProvider.java:211)
    at java.lang.Thread.run(Thread.java:764)

我尝试删除"dev“构建类型,但这没有帮助。我试着在网上搜索了几个小时,但我发现唯一相关的是

build.gradle

代码语言:javascript
运行
复制
apply plugin: 'com.android.application'

apply plugin: 'kotlin-android'

apply plugin: 'kotlin-android-extensions'

apply plugin: 'kotlin-kapt'

apply plugin: 'com.google.gms.google-services'

android {
    signingConfigs {
        config {
            keyAlias 'androiddebugkey'
            keyPassword 'android'
            storeFile file('C:/Users/Name/.android/debug.keystore')
            storePassword 'android'
        }
    }
    compileSdkVersion 28
    defaultConfig {
        applicationId "app.example"
        minSdkVersion 21
        targetSdkVersion 28
        versionCode 15
        versionName "1.3.9"
        multiDexEnabled true
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
        signingConfig signingConfigs.config
    }
    buildTypes {
        debug {
            applicationIdSuffix ".debug"
            debuggable true
            resValue "string", "app_name", "example debug"
            buildConfigField "String", "BACKEND_URL", '"https://api.example.com/"'
        }
        dev {
            applicationIdSuffix ".dev"
            debuggable true
            resValue "string", "app_name", "example dev"
            buildConfigField "String", "BACKEND_URL", '"https://dev.example.com/"'
            signingConfig signingConfigs.config
        }
        release {
            resValue "string", "app_name", "example"
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            buildConfigField "String", "BACKEND_URL", '"https://api.example.com/"'
        }
    }
    kapt {
        generateStubs = true
    }
    buildToolsVersion '28.0.3'
    productFlavors {
    }
}

dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation files('libs/YouTubeAndroidPlayerApi.jar')
    implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.0.0'
    implementation 'com.jakewharton.threetenabp:threetenabp:1.1.0'
    implementation 'org.adblockplus:adblock-android-webview:3.0'
    implementation 'com.github.bumptech.glide:recyclerview-integration:4.8.0'
    implementation 'com.google.android:flexbox:0.3.2'
    implementation 'com.google.dagger:dagger:2.16'
    implementation 'com.google.dagger:dagger-android:2.16'
    implementation 'com.google.dagger:dagger-android-support:2.16'
    kapt 'com.google.dagger:dagger-android-processor:2.16'
    implementation 'com.andkulikov:transitionseverywhere:1.8.0'
    kapt 'com.google.dagger:dagger-compiler:2.16'
    implementation 'com.squareup.retrofit2:retrofit:2.4.0'
    implementation 'com.squareup.retrofit2:converter-gson:2.4.0'
    implementation 'com.github.rubensousa:gravitysnaphelper:1.5'
    implementation 'com.github.takusemba:multisnaprecyclerview:1.3.4'
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    implementation 'com.github.bumptech.glide:glide:4.8.0'
    kapt 'com.github.bumptech.glide:compiler:4.8.0'
    implementation 'org.slf4j:slf4j-nop:1.7.25'
    implementation 'com.github.stfalcon:stfalcon-imageviewer:0.1.0'
    implementation 'com.vk:androidsdk:1.6.9'
    implementation 'com.appyvet:materialrangebar:1.4.4'
    implementation 'com.github.ome450901:SimpleRatingBar:1.4.2'
    implementation 'androidx.legacy:legacy-support-v4:1.0.0'
    implementation 'androidx.lifecycle:lifecycle-runtime:2.0.0'
    implementation 'androidx.lifecycle:lifecycle-extensions:2.0.0'
    implementation 'androidx.room:room-runtime:2.1.0-alpha04'
    kapt 'androidx.room:room-compiler:2.1.0-alpha04'
    implementation 'androidx.paging:paging-runtime:2.1.0'
    implementation 'androidx.appcompat:appcompat:1.0.2'
    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
    implementation 'com.google.android.material:material:1.0.0'
    implementation 'androidx.cardview:cardview:1.0.0'
    implementation 'androidx.recyclerview:recyclerview:1.0.0'
    implementation 'com.facebook.android:facebook-android-sdk:[4,5)'
    implementation 'io.sentry:sentry-android:1.7.16'
    implementation 'com.google.android.gms:play-services-gcm:16.1.0'
    implementation 'com.mixpanel.android:mixpanel-android:5.4.4'
    implementation 'com.amplitude:android-sdk:2.16.0'
    implementation 'io.branch.sdk.android:library:3.0.4'
    implementation 'com.android.support:customtabs:28.3.0'
    // Chrome Tab matching
    implementation 'com.google.firebase:firebase-core:16.0.7'
    implementation 'com.google.firebase:firebase-messaging:17.4.0'
    implementation 'com.google.firebase:firebase-appindexing:17.1.0'
    implementation 'com.google.android.gms:play-services-auth:16.0.1'
    // App indexing
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'androidx.test:runner:1.1.1'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
    debugImplementation 'com.amitshekhar.android:debug-db:1.0.4'
}

com.google.gms.googleservices.GoogleServicesPlugin.config.disableVersionCheck = true
EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2021-06-03 00:58:55

我也有同样的问题

代码语言:javascript
运行
复制
implementation 'org.adblockplus:adblock-android-webview:3.0'

但是将Gradle插件版本降级到3.4.2有效,但我需要使用Gradle插件版本到4.1进行数据绑定。在更新到

代码语言:javascript
运行
复制
implementation 'org.adblockplus:adblock-android-webview:4.0'

现在起作用了。我在项目结构中使用了gradle plugin version 4.1.1gradle version 6.5。我能够阻止大部分广告,但仍然有5%的广告绕过它。

  • 还请注意:这个adblockplus库使您的apk大小很大。在我的例子中,apk大小从11 MB更改为33 MB。在playstore上发布时使用包
票数 1
EN

Stack Overflow用户

发布于 2019-08-27 10:13:55

它不是在应用程序的libs文件夹中生成libadblockplus-jni.so

对我来说,这是在升级到Android 3.5.0之后开始发生的。在将其改为3.4.2之后,它起了作用。

尝试将您的Android插件版本更改为项目结构、文件>项目结构>项目中的3.4.2

项目结构菜单

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/56065445

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档