gpt4 book ai didi

java - 发现多个文件的操作系统独立路径为 'META-INF/groovy-release-info.properties'

转载 作者:行者123 更新时间:2023-11-29 23:19:37 25 4
gpt4 key购买 nike

如果我尝试构建我的应用程序,我将收到此错误:

DuplicateRelativeFileException: More than one file was found with OS independent path 'META-INF/groovy-release-info.properties

还有这个:

Caused by: com.android.tools.r8.utils.AbortException: Error: MethodHandle.invoke and MethodHandle.invokeExact are only supported starting with Android O (--min-api 26)

我的 build.gradle 文件:

apply plugin: 'com.android.application'

android {
compileSdkVersion 27

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
defaultConfig {
applicationId "com.example.example"
minSdkVersion 15
targetSdkVersion 27
versionCode 1
versionName "1.0"
testInstrumentationRunner
"android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.squareup.okhttp3:okhttp:3.13.0'
implementation 'com.fasterxml.jackson.core:jackson-databind:2.8.5'
implementation 'com.fasterxml.jackson.core:jackson-core:2.8.5'
implementation 'com.fasterxml.jackson.core:jackson-annotations:2.8.5'
implementation 'io.rest-assured:json-path:3.3.0'
testImplementation 'org.mockito:mockito-core:1.10.19'
testImplementation 'junit:junit:4.12'
testImplementation 'com.squareup.okhttp3:mockwebserver:3.13.0'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-
core:3.0.2'
}

我尝试通过将以下代码和平添加到我的 gradle.build 文件中来解决这个问题:

packagingOptions {
exclude 'META-INF/groovy-release-info.properties'
}

但是我会得到这个错误:

com.android.builder.dexing.DexArchiveBuilderException: Failed to process C:\Users\[myUserNamePlaceholder]\.gradle\caches\modules-2\files-2.1\org.codehaus.groovy\groovy\2.4.15\74b7e0b99526c569e3a59cb84dbcc6204d601ee6\groovy-2.4.15.jar

你能帮帮我吗?几个小时以来,我一直在努力解决这个问题。我很感激任何对我有很大帮助的回答。

最佳答案

尝试使用 pickFirst 只选择一个文件:

packagingOptions {
pickFirst 'META-INF/groovy-release-info.properties'
}

关于java - 发现多个文件的操作系统独立路径为 'META-INF/groovy-release-info.properties',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54600073/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com