When doing the project, encounter this exception:
Error:execution failed for task ': Samsung_edge_reader:dexdebug '.
> com.android.ide.common.internal.LoggedErrorException:Failed to Run Command:
/users/xiongcen/documents/develop/android-sdk-macosx/build-tools/21.1.1/dx-jxmx3g--dex--output/users/xiongcen/ Documents/workspace/myapplication3/samsung_edge_reader/build/intermediates/dex/debug--input-list=/Users/ xiongcen/documents/workspace/myapplication3/samsung_edge_reader/build/intermediates/tmp/dex/debug/ InputList.txt
Error Code:
2
Output:
Unexpected top-level EXCEPTION:
Com.android.dex.DexException:Multiple dex Files Define landroid/support/v4/accessibilityservice/ Accessibilityserviceinfocompat$accessibilityserviceinfoversionimpl;
At Com.android.dx.merge.DexMerger.readSortableTypes (dexmerger.java:596)
At Com.android.dx.merge.DexMerger.getSortedTypes (dexmerger.java:554)
At Com.android.dx.merge.DexMerger.mergeClassDefs (dexmerger.java:535)
At Com.android.dx.merge.DexMerger.mergeDexes (dexmerger.java:171)
At Com.android.dx.merge.DexMerger.merge (dexmerger.java:189)
At Com.android.dx.command.dexer.Main.mergeLibraryDexBuffers (main.java:454)
At Com.android.dx.command.dexer.Main.runMonoDex (main.java:302)
At Com.android.dx.command.dexer.Main.run (main.java:245)
At Com.android.dx.command.dexer.Main.main (main.java:214)
At Com.android.dx.command.Main.main (main.java:106)
This error code has a number of levels, and now comes across 2 and 3.
1 "When error code=2:
Let's talk about the environment at the time, using the Androidstudio development tool. In Build.gradle, see a section of code:
dependencies {compile "com.android.support:cardview-v7:21.+"//compile ' com.android.support:multidex:1.0.+ ' Compile ' com.crashlytics.android:crashlytics:1.+ ' compile Filetree (dir: ' Libs ', include: ' *.jar ') compile file S (' Libs/look_v1.1.1.jar ') compile files (' Libs/sdk-v1.0.0.jar ')}
Once saved, then the project is associated with the V7 package, in 650) this.width=650; "Src=" http://s3.51cto.com/wyfs02/M00/59/56/ Wkiom1tqyzpatsolaafe1rcheio582.jpg "title=" screen snapshot 2015-02-03 pm 1.49.07.png "alt=" Wkiom1tqyzpatsolaafe1rcheio582.jpg " You can see the Project Association package in/>.
However, the project has actually added the V4 package under the Libs folder, causing the conflict, so the above exception occurred.
Solution: Just block compile ' com.android.support:cardview-v7:21.+ ' this sentence. Recompile to pass.
2 "When error code=3:
Colleagues say that as long as the Build.gradle file is added,
dexoptions{javamaxheapsize "3g"}
can be passed. But no concrete practice has been done.
This article is from the "Chihiro" blog, please be sure to keep this source http://5200415.blog.51cto.com/3851969/1611099
About Android Studio appears under Dexdebug&loggederrorexception and error code level 2 or 3