I am using AdblockWebView
in my Android app. I have three build types: "release", "debug" and "dev", and the Webview was working while I was testing "dev" build type.
However, when I launch "debug" type, which is different from "dev" only with config constants, the app crashes when I open webview activity with no reason at all.
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)
I tried deleting "dev" build type, but that does not help. I tried searching the web for hours, but the only thing I found relevant was this
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
I was having the same problem with
implementation 'org.adblockplus:adblock-android-webview:3.0'
but degrading Gradle Plugin Version to 3.4.2
worked but I need to use Gradle Plugin Version to 4.1
for data binding. After updating to
implementation 'org.adblockplus:adblock-android-webview:4.0'
it is working now. I have used gradle plugin version 4.1.1
and gradle version 6.5
in project structure. I was able to block most of the ads but still 5% ads bypass it.