我正在使用AdblockWebView
在我的Android应用程序中。我有三种构建类型:"release“、"debug”和"dev",而Webview在测试"dev“构建类型时正在工作。
但是,当我启动"debug“类型时,它与只使用配置常量的"dev”不同,当我毫无理由地打开webview活动时,应用程序就会崩溃。
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
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
发布于 2021-06-03 00:58:55
我也有同样的问题
implementation 'org.adblockplus:adblock-android-webview:3.0'
但是将Gradle插件版本降级到3.4.2
有效,但我需要使用Gradle插件版本到4.1
进行数据绑定。在更新到
implementation 'org.adblockplus:adblock-android-webview:4.0'
现在起作用了。我在项目结构中使用了gradle plugin version 4.1.1
和gradle version 6.5
。我能够阻止大部分广告,但仍然有5%的广告绕过它。
发布于 2019-08-27 10:13:55
它不是在应用程序的libs文件夹中生成libadblockplus-jni.so。
对我来说,这是在升级到Android 3.5.0之后开始发生的。在将其改为3.4.2之后,它起了作用。
尝试将您的Android插件版本更改为项目结构、文件>项目结构>项目中的3.4.2
https://stackoverflow.com/questions/56065445
复制相似问题