2

私は私のGradleは、次の依存関係が含ま

Error:Error converting bytecode to dex: 
Cause: com.android.dex.DexException: Multiple dex files define Landroid/support/test/espresso/accessibility/R$attr; 

Error:Execution failed for task ':chegg-study:transformDexArchiveWithDexMergerForDebugAndroidTest'. 
> com.android.build.api.transform.TransformException: com.android.dex.DexException: Multiple dex files define Landroid/support/test/espresso/accessibility/R$attr; 

AGPBI: {"kind":"error","text":"Error converting bytecode to dex:\nCause: com.android.dex.DexException: Multiple dex files define Landroid/support/test/espresso/accessibility/R$attr;","sources":[{}],"original":"UNEXPECTED TOP-LEVEL EXCEPTION:\ncom.android.dex.DexException: Multiple dex files define Landroid/support/test/espresso/accessibility/R$attr;\n","tool":"Dex"} 
AGPBI: {"kind":"error","text":"com.android.dex.DexException: Multiple dex files define Landroid/support/test/espresso/accessibility/R$attr;","sources":[{}]} 
AGPBI: {"kind":"error","text":"\tat com.android.dx.merge.DexMerger.readSortableTypes(DexMerger.java:661)","sources":[{}]} 
AGPBI: {"kind":"error","text":"\tat com.android.dx.merge.DexMerger.getSortedTypes(DexMerger.java:616)","sources":[{}]} 
AGPBI: {"kind":"error","text":"\tat com.android.dx.merge.DexMerger.mergeClassDefs(DexMerger.java:598)","sources":[{}]} 
AGPBI: {"kind":"error","text":"\tat com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:171)","sources":[{}]} 
AGPBI: {"kind":"error","text":"\tat com.android.dx.merge.DexMerger.merge(DexMerger.java:198)","sources":[{}]} 
AGPBI: {"kind":"error","text":"\tat com.android.builder.dexing.DexArchiveMergerCallable.call(DexArchiveMergerCallable.java:61)","sources":[{}]} 
AGPBI: {"kind":"error","text":"\tat com.android.builder.dexing.DexArchiveMergerCallable.call(DexArchiveMergerCallable.java:36)","sources":[{}]} 
AGPBI: {"kind":"error","text":"\tat java.util.concurrent.ForkJoinTask$AdaptedCallable.exec(ForkJoinTask.java:1424)","sources":[{}]} 
AGPBI: {"kind":"error","text":"\tat java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)","sources":[{}]} 
AGPBI: {"kind":"error","text":"\tat java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)","sources":[{}]} 
AGPBI: {"kind":"error","text":"\tat java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)","sources":[{}]} 
AGPBI: {"kind":"error","text":"\tat java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)","sources":[{}]} 

(androidTest)UIテストを実行しようとした後、次のエラーを取得しておいてください。

androidTestImplementation "com.android.support.test.espresso:espresso-core:$espresso" 
androidTestImplementation "com.android.support.test.espresso:espresso-contrib:$espresso" 
androidTestImplementation "com.android.support.test.espresso:espresso-intents:$espresso" 
androidTestImplementation "com.android.support.test.espresso:espresso-accessibility:$espresso" 
androidTestImplementation "com.android.support.test.espresso:espresso-web:$espresso" 
androidTestImplementation "com.android.support.test.espresso:espresso-idling-resource:$espresso" 
androidTestImplementation "com.android.support.test.espresso.idling:idling-concurrent:$espresso" 
androidTestImplementation 'com.android.support:multidex-instrumentation:1.0.2' 
  • エスプレッソ3.0.1

を助けてください

+1

のlibsフォルダ内のすべてのjarファイルの特定のLIBSのバージョンを強制することにより、この問題? –

+0

私は自分のプロジェクトでそれを試しましたが、エスプレッソ・アクセシビリティが含まれるたびにこのエラーが発生します。今必要がない場合は、削除して自分自身のブロックを解除することができます。ここにバグを提出することをおすすめします。https://issuetracker.google.com/issues?q=componentid:192735%2B –

答えて

0

解決済み

configurations.all { 
     resolutionStrategy { 
      // fail eagerly on version conflict (includes transitive dependencies) 
      // e.g. multiple different versions of the same dependency (group and name are equal) 
      failOnVersionConflict() 

      // prefer modules that are part of this build (multi-project or composite build) over external modules 
      preferProjectModules() 

     force 'com.android.support:appcompat-v7:27.0.1' 
     } 
    } 

との依存関係ツリーを表示するには、このGradleのコマンドを使用して::

./gradlew -q dependencies :project_name:dependencies 
関連する問題