У меня есть приложение android, которое использует jarjar. Я могу собрать его нормально с помощью Build> Build bundles / apks, но когда я пытаюсь создать его с помощью Build> Generate signed bundle / apk, он начинает сборку, но затем выдает эту ошибку:
Задача: app: mergeDexRelease
FAILURE: сбой сборки с исключением.
- Что пошло не так: Выполнение не выполнено для задачи ': app: collectReleaseDependencies'.
java .io.FileNotFoundException: / home / joshualausch / AndroidStudioProjects / MineServers / app / build / jarjar (Это каталог)
Я пробовал: Очистка , Удаление папки jarjar, но я все еще не могу заставить ее работать
build.gradle:
apply plugin: 'com.android.application'
apply plugin: 'org.anarres.jarjar'
android {
compileSdkVersion 29
buildToolsVersion "29.0.3"
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
defaultConfig {
applicationId "uk.yoshichill.mineservers"
minSdkVersion 24
targetSdkVersion 27
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
packagingOptions {
//exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/INDEX.LIST'
exclude 'META-INF/io.netty.versions.properties'
}
}
repositories {
maven {
url = uri('https://repo.nukkitx.com/maven-releases/')
}
maven {
url = uri('https://repo.nukkitx.com/maven-snapshots/')
}
maven {
url = uri('https://jitpack.io')
}
mavenCentral()
}
dependencies {
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'com.google.android.material:material:1.1.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'androidx.navigation:navigation-fragment:2.3.0'
implementation 'androidx.navigation:navigation-ui:2.3.0'
implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
implementation 'androidx.preference:preference:1.1.1'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
implementation group: 'com.fasterxml.jackson.dataformat', name: 'jackson-dataformat-yaml', version: '2.9.8'
implementation "com.fasterxml.jackson.core:jackson-databind:2.9.8"
implementation ("com.nukkitx.protocol:bedrock-v407:2.6.0-SNAPSHOT") {
exclude group: 'com.nukkitx.fastutil', module:'fastutil-common'
exclude group: 'io.netty', module:'netty-transport-native-epoll'
exclude group: 'io.netty', module:'netty-transport-native-kqueue'
exclude group: 'com.nukkitx.network'
}
// Remove the duplicate classes and include fastutil-common
implementation jarjar.repackage {
from 'com.nukkitx.fastutil:fastutil-common:8.3.1'
classDelete "it.unimi.dsi.fastutil.ints.IntIterator"
classDelete "it.unimi.dsi.fastutil.longs.LongIterator"
classDelete "it.unimi.dsi.fastutil.objects.ObjectIterator"
}
implementation 'com.github.rtm516:Network:a8377bbe59'
/*implementation "org.apache.logging.log4j:log4j-core:2.13.3"
implementation "org.apache.logging.log4j:log4j-api:2.13.3"*/
}
Project build.gradle:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
maven {
url 'https://jitpack.io'
}
}
dependencies {
classpath "com.android.tools.build:gradle:4.0.1"
classpath "com.github.shevek:jarjar:9a7eca72f9"
}
}
allprojects {
repositories {
maven { url "https://repo.nukkitx.com/maven-releases/" }
maven { url "https://repo.nukkitx.com/maven-snapshots" }
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
configurations.all {
resolutionStrategy.eachDependency { details ->
def requested = details.requested
if (requested.group == "com.android.support") {
if (!requested.name.startsWith("multidex")) {
details.useVersion "26.+"
}
}
}
}