Не удается подключить плагин AabResGuard
Есть следующий плагин: https://github.com/bytedance/AabResGuard
Пытаюсь подключить, к полностью чистому проекту, так:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
mavenCentral()
}
dependencies {
classpath "com.android.tools.build:gradle:7.0.2"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.20"
classpath "com.bytedance.android:aabresguard-plugin:0.1.8"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
plugins {
id 'com.android.application'
id 'kotlin-android'
id 'com.bytedance.android.aabResGuard'
}
android {
compileSdk 31
defaultConfig {
applicationId "project.example.myapplication"
minSdk 22
targetSdk 31
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}
aabResGuard {
mappingFile = file("mapping.txt").toPath() // Mapping file used for incremental obfuscation
whiteList = [ // White list rules
"*.R.raw.*",
"*.R.drawable.icon"
]
obfuscatedBundleFileName = "duplicated-app.aab" // Obfuscated file name, must end with '.aab'
mergeDuplicatedRes = true // Whether to allow the merge of duplicate resources
enableFilterFiles = true // Whether to allow filter files
filterList = [ // file filter rules
"*/arm64-v8a/*",
"META-INF/*"
]
enableFilterStrings = false // switch of filter strings
unusedStringPath = file("unused.txt").toPath() // strings will be filtered in this file
languageWhiteList = ["en", "zh"] // keep en,en-xx,zh,zh-xx etc. remove others.
}
}
dependencies {
implementation 'androidx.core:core-ktx:1.6.0'
implementation 'androidx.appcompat:appcompat:1.3.1'
implementation 'com.google.android.material:material:1.4.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.1'
testImplementation 'junit:junit:4.+'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
}
Выдает следующее: A problem occurred configuring root project 'My Application'.
Could not resolve all artifacts for configuration ':classpath'. Could not find com.bytedance.android:aabresguard-plugin:0.1.8. Searched in the following locations: - https://dl.google.com/dl/android/maven2/com/bytedance/android/aabresguard-plugin/0.1.8/aabresguard-plugin-0.1.8.pom - https://repo.maven.apache.org/maven2/com/bytedance/android/aabresguard-plugin/0.1.8/aabresguard-plugin-0.1.8.pom Required by: project :
Possible solution:
- Declare repository providing the artifact, see the documentation at https://docs.gradle.org/current/userguide/declaring_repositories.html
Поискал в и-нете, нашел что не работает на gradle 7+, снизил версию выдает тоже, пробовал и разные версии плагина и gradle. Может я совсем что-то не так подключаю, подскажите пожалуйста в чем может быть дело и как поправить, или если кто-то подключал и работало, напишите пожалуйста используемые вами версии.