Я создаю приложение android
и получаю следующую ошибку:
AGPBI: {"kind": "error", "text": " Тип программы уже представлен: org.apache.http.auth.AUTH ", "sources": [{}], "инструмент": "D8"}
Задача: app: mergeExtDexDebug FAILED
java.lang.RuntimeException: java.lang.RuntimeException: com.android.builder.dexing.DexArchiveMergerException: ошибка при объединении dex-архивов:
Узнайте, как решить проблему в https://developer.android.com/studio/build/dependencies#duplicate_classes.
Тип программы уже присутствует: org.apache.http.auth.AUTH
at sun.reflect.NativeConstructorAccessorImpl.newInstance0 (собственный метод)
at sun.reflect.NativeConstructorAccessorImpl.newInstance (NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance (DelegatingConstructorAccessorImpl.java:45)
в java.lang.reflect.Constructor.newInstance (Constructor.java:423)
в java.util.concurrent.ForkJoinTask.getThrowableException (ForkJoinTask.java:593)
в java.util.concurrent.ForkJoinTask.reportException (ForkJoinTask.java:677)
в java.util.concurrent.ForkJoinTask.join (ForkJoinTask.java:720)
на com.android.build.gradle.internal.tasks.DexMergingTaskDelegate.run (DexMergingTask.kt: 316)
на com.android.build.gradle.internal.tasks.DexMergingTask.taskAction (DexMergingTask.kt: 132)
at sun.reflect.NativeMethodAccessorImpl.invoke0 (собственный метод)
at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
в java.lang.reflect.Method.invoke (Method.java:498)
в org.gradle.internal.reflect.JavaMethod.invoke (JavaMethod.java:73)
в org.gradle.api.internal.project.taskfactory.StandardTaskAction.doExecute (StandardTaskAction.java:46)
в org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute (StandardTaskAction.java:39)
в org.gradle.api.internal.project.taskfactory.StandardTaskAction.execute (StandardTaskAction.java:26)
в org.gradle.api.internal.AbstractTask $ TaskActionWrapper.execute (AbstractTask.java:801)
в org.gradle.api.internal.AbstractTask $ TaskActionWrapper.execute (AbstractTask.java:768)
в org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter $ 1.run (ExecuteActionsTaskExecuter.java:131)
в org.gradle.internal.operations.DefaultBuildOperationExecutor $ RunnableBuildOperationWorker.execute (DefaultBuildOperationExecutor.java:300)
в org.gradle.internal.operations.DefaultBuildOperationExecutor $ RunnableBuildOperationWorker.execute (DefaultBuildOperationExecutor.java:292)
в org.gradle.internal.operations.DefaultBuildOperationExecutor.execute (DefaultBuildOperationExecutor.java:174)
в org.gradle.internal.operations.DefaultBuildOperationExecutor.run (DefaultBuildOperationExecutor.java:90)
в org.gradle.internal.operations.DelegatingBuildOperationExecutor.run (DelegatingBuildOperationExecutor.java:31)
в org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction (ExecuteActionsTaskExecuter.java:120)
в org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions (ExecuteActionsTaskExecuter.java:99)
в org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute (ExecuteActionsTaskExecuter.java:77)
в org.gradle.api.internal.tasks.execution.OutputDirectoryCreatingTaskExecuter.execute (OutputDirectoryCreatingTaskExecuter.java:51)
в org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute (SkipUpToDateTaskExecuter.java:59)
в org.gradle.api.internal.tasks.execution.ResolveTaskOutputCachingStateExecuter.execute (ResolveTaskOutputCachingStateExecuter.java:54)
в org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute (ValidatingTaskExecuter.java:59)по адресу org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute (SkipEmptySourceFilesTaskExecuter.java:101) по адресу org.gradle.api.internal.tasks.execution.FinalizeInputFileProgitasTectext.api.internal..tasks.execution..ExecuteAtMostOnceTaskExecuter.execute (ExecuteAtMostOnceTaskExecuter.java:43) в org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute (CatchExceptionTaskExecuter.java:inter.gra..i.grag.nal.tasks.execution.EventFiringTaskExecuter $ 1.run (EventFiringTaskExecuter.java:51) в org.gradle.internal.operations.DefaultBuildOperationExecutor $ RunnableBuildOperationWorker.execute (DefaultBuildOperationExaction.BourfulOperationBoDBoperationDactionU.execute (DefaultBuildOperationExecutor.java:292) в org.gradle.internal.operations.DefaultBuildOperationExecutor.execute (DefaultBuildOperationExecutor.java:174) в org.gradle.internal.operations.DefaultBuildOperationExecutor.rava: atBB по умолчанию (at).gradle.internal.operations.DelegatingBuildOperationExecutor.run (DelegatingBuildOperationExecutor.java:31) в org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter.execute (EventFiringTaskExecuter.java:46dlek.info.graf.выполнить (LocalTaskInfoExecutor.java:42) в org.gradle.execution.taskgraph.DefaultTaskExecutionGraph $ BuildOperationAwareWorkItemExecutor.execute (DefaultTaskExecutionGraph.java:277) в org.gradle.execution.taskgraph.DefaultTaskExecutionGraph $ BuildOperationAwareWorkItemExecutor.execute (DefaultTaskExecutionGraph.java:262) в org.gradle.executionExecTackTeckTeckTecKef) в org.gradle.execution.taskgraph.DefaultTaskPlanExecutor $ ExecutorWorker $ 1.execute (DefaultTaskPlanExecutor.java:130) в org.gradle.execution.taskgraph.DefaultTaskPlanExecutor $ ExecutorWorker.execuj.Exas.geSec..taskgraph.(ExecutorPolicy.java:63) в org.gradle.internal.concurrent.ManagedExecutorImpl $ 1.run (ManagedExecutorImpl.java:46) в java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1142) в java.util.concurrent.ThreadPoolExecutor $ Worker.run (ThreadPoolExecutor.java:617) в org.gradle.internal.concurrent.ThreadFactoryImpl $ ManagedThreadRunnactjun:java.lang.Thread.run (Thread.java:745) Причина: java.lang.RuntimeException: com.android.builder.dexing.DexArchiveMergerException: ошибка при объединении архивов dex: узнайте, как решить проблему в https://developer.android.com/studio/build/dependencies#duplicate_classes. Тип программы уже представлен: org.apache.http.auth.AUTH в java.util.concurrent.ForkJoinTask $ AdaptedCallable.exec (ForkJoinTask.java:1431) в java.util.concurrent.ForkJoinTask.doExec: Fork289) в java.util.concurrent.ForkJoinPool $ WorkQueue.runTask (ForkJoinPool.java:1056)по адресу java.util.concurrent.ForkJoinPool.runWorker (ForkJoinPool.java:1692) по адресу java.util.concurrent.ForkJoinWorkerThread.run (ForkJoinWorkerThread.java:157) Вызывается ошибочным извлечениемАрхивы dex: узнайте, как решить проблему в https://developer.android.com/studio/build/dependencies#duplicate_classes. Тип программы уже представлен: org.apache.http.auth.AUTH в com.android.builder.dexing.D8DexArchiveMerger.getExceptionToRethrow (D8DexArchiveMerger.java:131) вcom.android.builder.dexing.D8DexArchiveMerger.mergeDexArchives (D8DexArchiveMerger.java:118) в com.android.build.gradle.internal.transforms.DexMergerTransformCallable.call (DexMergerTransformCalladle.gragra.gragra.jpg). com:.inner.transforms.DexMergerTransformCallable.call (DexMergerTransformCallable.java:37) в java.util.concurrent.ForkJoinTask $ AdaptedCallable.exec (ForkJoinTask.java:1424) ... еще 4, вызванные: Не удалось завершить компиляцию на com.android.tools.r8.utils.ExceptionUtils.withCompilationHandler (ExceptionUtils.java:70) в com.android.tools.r8.utils.ExceptionUtils.withD8CompilationHandler (ExceptionUtils.java:43) в com.android.tools.r8.D8.run (D8.java:94)at com.android.builder.dexing.D8DexArchiveMerger.mergeDexArchives (D8DexArchiveMerger.java:116) ... еще 7 причин: com.android.tools.r8.utils.AbortException: Ошибка: тип программы уже присутствует: org.apache.http.auth.AUTH на com.android.tools.r8.utils.Reporter.failIfPendingErrors (Reporter.java:89) на com.android.tools.r8.utils.Reporter.fatalError (Reporter.java:60) на com.android.tools.r8.utils.ExceptionUtils.withCompilationHandler (ExceptionUtils.java:64) ... еще 10
FAILURE: сборка завершилась с исключением.
Мои приложения build.gradle
файл
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
useLibrary 'org.apache.http.legacy'
defaultConfig {
applicationId "com.example.bottomnavigation"
minSdkVersion 26
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
packagingOptions {
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/license.txt'
exclude 'META-INF/NOTICE'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/notice.txt'
exclude 'META-INF/ASL2.0'
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:support-media-compat:28.0.0'
implementation 'com.android.support:support-v4:28.0.0'
implementation 'com.android.support:design:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.google.android.gms:play-services-vision:17.0.2'
implementation 'me.dm7.barcodescanner:zxing:1.9'
implementation 'com.amitshekhar.android:android-networking:1.0.2'
implementation('kg.net.bazi.gsb4j:gsb4j-core:1.0.3') {
exclude module: "guice"
exclude group: 'org.apache.httpcomponents'
}
implementation('com.google.inject:guice:4.0:no_aop') {
exclude group: 'org.sonatype.sisu.inject', module: 'cglib'
}
implementation 'com.ishansong.network:okhttp-client:1.2'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation files('libs/httpclient-4.5.7.jar')
}