将Android Gradle插件更新到3.0.1后,我无法构建应用程序的发布版本并收到以下错误:
任务执行失败':transformClassesWithDexForReleaseCLI'。 com.android.build.api.transform.TransformException:com.android.ide.common.process.ProcessException:java.util.concurrent.ExecutionException:com.android.ide.common.process.ProcessException:返回dex进程的代码1
我一直在寻找问题的解决方案,但所有这些都与progruard有关,我没有使用或指向将multiDexEnabled
设置为我设置的true。我也设定了:
lintOptions {
abortOnError false
}
所以lint错误也不应该影响构建结果。我很确定该问题与构建已签名的APK有关,因为调试构建成功。
这是我的build.gradle文件:
import java.nio.charset.StandardCharsets;
def vCode, vName
def JVM_MAX_HEAP_SIZE = "2g"
buildscript {
repositories{
jcenter()
mavenCentral()
maven {
url "https://dl.google.com/dl/android/maven2"
}
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
}
tasks.withType(JavaCompile) { options.encoding = "UTF-8" }
}
repositories {
mavenCentral()
maven {
url "https://dl.google.com/dl/android/maven2"
}
}
apply plugin: 'com.android.application'
dependencies {
// LOCAL LIBS
compile fileTree(include: ['*.jar'], dir: 'libs')
// ANDROID SUPPORT LIBS
compile 'com.android.support:appcompat-v7:27.0.1'
compile 'com.android.support:support-v13:27.0.1'
compile 'com.android.support:support-v4:27.0.1'
compile 'com.android.support:design:27.0.1'
// OTHER LIBS
compile 'com.google.code.gson:gson:2.2.2' // DO NOT UPDATE!
compile 'com.amazonaws:aws-android-sdk-core:2.1.10'
compile 'com.amazonaws:aws-android-sdk-s3:2.1.10'
// compile 'com.amazonaws:aws-android-sdk-core:2.3.3'
// compile 'com.amazonaws:aws-android-sdk-s3:2.3.3'
compile 'org.sqldroid:sqldroid:1.0.3'
//
compile 'com.j256.ormlite:ormlite-android:5.0'
compile 'com.j256.ormlite:ormlite-core:5.0'
compile 'com.madgag:sc-light-jdk15on:1.47.0.3'
// APACHE HTTP MIME TYPE
compile 'cz.msebera.android:httpclient:4.4.1.1'
// https://mvnrepository.com/artifact/org.slf4j/slf4j-api
compile group: 'org.slf4j', name: 'slf4j-api', version: '1.7.24'
// https://mvnrepository.com/artifact/com.github.tony19/logback-android-classic
compile group: 'com.github.tony19', name: 'logback-android-classic', version: '1.1.1-6'
// MultiDex support:https://developer.android.com/studio/build/multidex.html
compile 'com.android.support:multidex:1.0.2'
// https://mvnrepository.com/artifact/com.github.angads25/filepicker
compile group: 'com.github.angads25', name: 'filepicker', version: '1.1.1'
}
def signPropertiesFile
def signProperties
def File keyStoreFile = null
task preapreCLISigning {
if (project.hasProperty("release") && project.getProperty("release").equals("assembleReleaseCLI")) {
println "Reading signing settings for CLI from file."
signPropertiesFile = rootProject.file("sign.properties")
signProperties = new Properties()
signProperties.load(new FileInputStream(signPropertiesFile))
keyStoreFile = file("keystore")
} else {
println "Not reading signing settings, null provided."
signProperties = [
keyAlias : "",
keyPassword: "",
storePassword: ""
]
keyStoreFile = null;
}
}
task loadVersionProperties() {
def versionPropsFile = file("versions.properties")
if (!versionPropsFile.exists()) {
throw new GradleException("versions.properties file not found")
}
def Properties versionProps = new Properties()
versionProps.load(new FileInputStream(versionPropsFile))
vCode = versionProps["vCode"].toInteger()
vName = versionProps["vName"];
}
// CHANGE APP VERSION AND NAME IN STRINGS.XML FILE
task changeAppVersionAndName() {
// UTF-8 NAMES FIX
Properties baseProps = new Properties();
def basePropFile = file("gradle.properties");
if (basePropFile.canRead()) {
baseProps.load(new InputStreamReader(new FileInputStream(basePropFile), StandardCharsets.UTF_8));
appName = baseProps.appName;
println "[DEBUG] UTF-8 FIX NAME: " + baseProps.appName + " NAME: " + appName;
}
else {
println "[DEBUG] CANNOT READ PROPERTIES FILE..."
}
// FIX END
println "[INFO] REPLACING APP NAME TO: " + appName + " AND VERSION TO: " + vName
def resValuesPath = "res" + File.separatorChar + "values" + File.separatorChar
// FILE IS COPIED TO TEMP LOCATION BECAUSE THERE WILL BE OVERWRITTEN TOKENS
if (!file("tmp" + File.separatorChar + "strings.xml").exists()) {
println "[INFO] CREATING TEMP DIRECTORY WITH STRING.XML"
copy {
from file(resValuesPath + File.separatorChar + "strings.xml")
into "tmp"
}
}
if (!file("tmp" + File.separatorChar + "strings.xml").exists()){
throw FileNotFoundException("UNABLE TO CREATE TEMPORARY strings.xml FILE")
}
File stringFile = file("res" + File.separatorChar + "values" + File.separatorChar + "strings.xml")
String _content = stringFile.getText("UTF-8")
_content = _content.replaceAll("%app_name%", appName)
_content = _content.replaceAll("%app_version%", vName)
stringFile.write(_content, "UTF-8")
println "[INFO] APP NAME AND VERSION SET"
}
android {
compileSdkVersion = 27
buildToolsVersion = '26.0.2'
lintOptions {
abortOnError false
}
dexOptions {
javaMaxHeapSize JVM_MAX_HEAP_SIZE
}
android.variantFilter {variant ->
if (project.hasProperty("release") && project.getProperty("release").equals("assemble")) {
if (variant.getBuildType().name.equals("releaseCLI") || variant.getBuildType().name.equals("releaseDebug")) {
println "SKIPPING CLI SIGNING..."
variant.setIgnore(true)
}
}
}
signingConfigs {
cliSigning {
keyAlias signProperties['keyAlias']
keyPassword signProperties['storePassword']
storeFile keyStoreFile
storePassword signProperties['storePassword']
}
}
defaultConfig {
applicationId appClass
minSdkVersion 19
targetSdkVersion 27
versionCode vCode
versionName vName
setProperty("archivesBaseName", "$appName-$vName")
multiDexEnabled true
}
compileOptions {
sourceCompatibility 1.7 // JAVA 1.8 REQUIRE JACK OPTIONS ENABLED
targetCompatibility 1.7
}
buildTypes {
release {
minifyEnabled false
debuggable false
}
debug {
debuggable true
versionNameSuffix "-debug"
}
releaseCLI {
minifyEnabled false
debuggable false
signingConfig signingConfigs.cliSigning
}
}
useLibrary 'org.apache.http.legacy'
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
res.srcDirs = ['res']
assets.srcDirs = ['assets']
}
instrumentTest.setRoot('tests')
debug.setRoot('build/debug')
release.setRoot('build/release')
releaseCLI.setRoot('build/releaseCLI')
}
}
我也在寻找Android Gradle插件迁移页面以获得有用的信息,但没有结果。你有什么想法我应该在build.gradle文件中修复吗?
//编辑:完整堆栈跟踪:
* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':transformClassesWithDexForReleaseCLI'.
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:100)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:70)
at org.gradle.api.internal.tasks.execution.OutputDirectoryCreatingTaskExecuter.execute(OutputDirectoryCreatingTaskExecuter.java:51)
at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:62)
at org.gradle.api.internal.tasks.execution.ResolveTaskOutputCachingStateExecuter.execute(ResolveTaskOutputCachingStateExecuter.java:54)
at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:60)
at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:97)
at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:87)
at org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter.execute(ResolveTaskArtifactStateTaskExecuter.java:52)
at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:52)
at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:54)
at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:34)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker$1.run(DefaultTaskGraphExecuter.java:248)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:199)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:110)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:241)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:230)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.processTask(DefaultTaskPlanExecutor.java:123)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.access$200(DefaultTaskPlanExecutor.java:79)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:104)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker$1.execute(DefaultTaskPlanExecutor.java:98)
at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.execute(DefaultTaskExecutionPlan.java:626)
at org.gradle.execution.taskgraph.DefaultTaskExecutionPlan.executeWithTask(DefaultTaskExecutionPlan.java:581)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor$TaskExecutorWorker.run(DefaultTaskPlanExecutor.java:98)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor.process(DefaultTaskPlanExecutor.java:59)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter.execute(DefaultTaskGraphExecuter.java:128)
at org.gradle.execution.SelectedTaskExecutionAction.execute(SelectedTaskExecutionAction.java:37)
at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:37)
at org.gradle.execution.DefaultBuildExecuter.access$000(DefaultBuildExecuter.java:23)
at org.gradle.execution.DefaultBuildExecuter$1.proceed(DefaultBuildExecuter.java:43)
at org.gradle.execution.DryRunBuildExecutionAction.execute(DryRunBuildExecutionAction.java:46)
at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:37)
at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:30)
at org.gradle.initialization.DefaultGradleLauncher$ExecuteTasks.run(DefaultGradleLauncher.java:314)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:199)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:110)
at org.gradle.initialization.DefaultGradleLauncher.runTasks(DefaultGradleLauncher.java:204)
at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:134)
at org.gradle.initialization.DefaultGradleLauncher.executeTasks(DefaultGradleLauncher.java:109)
at org.gradle.internal.invocation.GradleBuildController$1.call(GradleBuildController.java:78)
at org.gradle.internal.invocation.GradleBuildController$1.call(GradleBuildController.java:75)
at org.gradle.internal.work.DefaultWorkerLeaseService.withLocks(DefaultWorkerLeaseService.java:152)
at org.gradle.internal.invocation.GradleBuildController.doBuild(GradleBuildController.java:100)
at org.gradle.internal.invocation.GradleBuildController.run(GradleBuildController.java:75)
at org.gradle.tooling.internal.provider.ExecuteBuildActionRunner.run(ExecuteBuildActionRunner.java:28)
at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
at org.gradle.tooling.internal.provider.ValidatingBuildActionRunner.run(ValidatingBuildActionRunner.java:32)
at org.gradle.launcher.exec.RunAsBuildOperationBuildActionRunner$1.run(RunAsBuildOperationBuildActionRunner.java:43)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:199)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:110)
at org.gradle.launcher.exec.RunAsBuildOperationBuildActionRunner.run(RunAsBuildOperationBuildActionRunner.java:40)
at org.gradle.tooling.internal.provider.SubscribableBuildActionRunner.run(SubscribableBuildActionRunner.java:51)
at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:47)
at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:30)
at org.gradle.launcher.exec.BuildTreeScopeBuildActionExecuter.execute(BuildTreeScopeBuildActionExecuter.java:39)
at org.gradle.launcher.exec.BuildTreeScopeBuildActionExecuter.execute(BuildTreeScopeBuildActionExecuter.java:25)
at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:80)
at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:53)
at org.gradle.tooling.internal.provider.ServicesSetupBuildActionExecuter.execute(ServicesSetupBuildActionExecuter.java:57)
at org.gradle.tooling.internal.provider.ServicesSetupBuildActionExecuter.execute(ServicesSetupBuildActionExecuter.java:32)
at org.gradle.tooling.internal.provider.GradleThreadBuildActionExecuter.execute(GradleThreadBuildActionExecuter.java:36)
at org.gradle.tooling.internal.provider.GradleThreadBuildActionExecuter.execute(GradleThreadBuildActionExecuter.java:25)
at org.gradle.tooling.internal.provider.ParallelismConfigurationBuildActionExecuter.execute(ParallelismConfigurationBuildActionExecuter.java:43)
at org.gradle.tooling.internal.provider.ParallelismConfigurationBuildActionExecuter.execute(ParallelismConfigurationBuildActionExecuter.java:29)
at org.gradle.tooling.internal.provider.StartParamsValidatingActionExecuter.execute(StartParamsValidatingActionExecuter.java:64)
at org.gradle.tooling.internal.provider.StartParamsValidatingActionExecuter.execute(StartParamsValidatingActionExecuter.java:29)
at org.gradle.tooling.internal.provider.SessionFailureReportingActionExecuter.execute(SessionFailureReportingActionExecuter.java:59)
at org.gradle.tooling.internal.provider.SessionFailureReportingActionExecuter.execute(SessionFailureReportingActionExecuter.java:44)
at org.gradle.tooling.internal.provider.SetupLoggingActionExecuter.execute(SetupLoggingActionExecuter.java:45)
at org.gradle.tooling.internal.provider.SetupLoggingActionExecuter.execute(SetupLoggingActionExecuter.java:30)
at org.gradle.launcher.daemon.server.exec.ExecuteBuild.doBuild(ExecuteBuild.java:67)
at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122)
at org.gradle.launcher.daemon.server.exec.WatchForDisconnection.execute(WatchForDisconnection.java:37)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122)
at org.gradle.launcher.daemon.server.exec.ResetDeprecationLogger.execute(ResetDeprecationLogger.java:26)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122)
at org.gradle.launcher.daemon.server.exec.RequestStopIfSingleUsedDaemon.execute(RequestStopIfSingleUsedDaemon.java:34)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122)
at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:74)
at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:72)
at org.gradle.util.Swapper.swap(Swapper.java:38)
at org.gradle.launcher.daemon.server.exec.ForwardClientInput.execute(ForwardClientInput.java:72)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122)
at org.gradle.launcher.daemon.server.exec.LogAndCheckHealth.execute(LogAndCheckHealth.java:50)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122)
at org.gradle.launcher.daemon.server.exec.LogToClient.doBuild(LogToClient.java:62)
at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122)
at org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment.doBuild(EstablishBuildEnvironment.java:82)
at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122)
at org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy$1.run(StartBuildOrRespondWithBusy.java:50)
at org.gradle.launcher.daemon.server.DaemonStateCoordinator$1.run(DaemonStateCoordinator.java:295)
at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46)
at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
Caused by: java.lang.RuntimeException: com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.ide.common.process.ProcessException: Return code 1 for dex process
at com.android.builder.profile.Recorder$Block.handleException(Recorder.java:55)
at com.android.builder.profile.ThreadRecorder.record(ThreadRecorder.java:104)
at com.android.build.gradle.internal.pipeline.TransformTask.transform(TransformTask.java:213)
at org.gradle.internal.reflect.JavaMethod.invoke(JavaMethod.java:73)
at org.gradle.api.internal.project.taskfactory.IncrementalTaskAction.doExecute(IncrementalTaskAction.java:46)
at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:39)
at org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute(StandardTaskAction.java:26)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$1.run(ExecuteActionsTaskExecuter.java:121)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)
at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:199)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:110)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:110)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:92)
... 103 more
Caused by: com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.ide.common.process.ProcessException: Return code 1 for dex process
at com.android.build.gradle.internal.transforms.DexTransform.transform(DexTransform.java:222)
at com.android.build.gradle.internal.pipeline.TransformTask$2.call(TransformTask.java:222)
at com.android.build.gradle.internal.pipeline.TransformTask$2.call(TransformTask.java:218)
at com.android.builder.profile.ThreadRecorder.record(ThreadRecorder.java:102)
... 115 more
Caused by: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.ide.common.process.ProcessException: Return code 1 for dex process
at com.android.builder.core.DexByteCodeConverter.dexInProcess(DexByteCodeConverter.java:178)
at com.android.builder.core.DexByteCodeConverter.runDexer(DexByteCodeConverter.java:150)
at com.android.builder.core.DexByteCodeConverter.convertByteCode(DexByteCodeConverter.java:135)
at com.android.build.gradle.internal.transforms.DexTransform.transform(DexTransform.java:213)
... 118 more
Caused by: java.util.concurrent.ExecutionException: com.android.ide.common.process.ProcessException: Return code 1 for dex process
at com.android.builder.core.DexByteCodeConverter.dexInProcess(DexByteCodeConverter.java:176)
... 121 more
Caused by: com.android.ide.common.process.ProcessException: Return code 1 for dex process
at com.android.builder.internal.compiler.DexWrapper$DexProcessResult.assertNormalExitValue(DexWrapper.java:117)
at com.android.builder.core.DexByteCodeConverter.lambda$dexInProcess$0(DexByteCodeConverter.java:171)
答案 0 :(得分:1)
对于会遇到同样问题的其他人。我在构建过程中启用了调试,然后出现如下错误:
错误:(18)错误:android定义的类与Android现在提供的类冲突。解决方案包括查找没有相同问题的更新版本或替代库(例如,对于httpclient使用HttpUrlConnection或okhttp),或者使用jarjar之类的东西重新打包库。 [DuplicatePlatformClasses]
这意味着我必须通过向android
部分添加以下代码来从构建过程中排除某些模块:
configurations {
all {
exclude module: 'httpclient'
exclude module: 'commons-logging'
exclude module: 'opengl-api'
exclude module: 'xmlParserAPIs'
exclude module: 'xpp3'
}
}