关于android:dexDebug构建任务中的“找不到文件”异常

“File not Found” exception in dexDebug task of build

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
Error:Execution failed for task ':app:dexDebug'.
> com.android.ide.common.internal.LoggedErrorException: Failed to run command:
    D:\AndroidSDK\adt-bundle-windows-x86_64-20140702\adt-bundle-windows-x86_64-20140702\sdk\build-tools\21.1.2\dx.bat --dex --no-optimize --output C:\Users\奇異果Kiwi\AndroidStudioProjects\MyApplication\app\build\intermediates\dex\debug --input-list=C:\Users\奇異果Kiwi\AndroidStudioProjects\MyApplication\app\build\intermediates\tmp\dex\debug\inputList.txt
Error Code:
    1
Output:
    UNEXPECTED TOP-LEVEL EXCEPTION:
    java.lang.RuntimeException: C:\Users\憟???iwi\AndroidStudioProjects\MyApplication\app\build\intermediates\classes\debug: file not found
        at com.android.dex.util.FileUtils.readFile(FileUtils.java:51)
        at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:169)
        at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:144)
        at com.android.dx.command.dexer.Main.processOne(Main.java:632)
        at com.android.dx.command.dexer.Main.processAllFiles(Main.java:510)
        at com.android.dx.command.dexer.Main.runMonoDex(Main.java:280)
        at com.android.dx.command.dexer.Main.run(Main.java:246)
        at com.android.dx.command.dexer.Main.main(Main.java:215)
        at com.android.dx.command.Main.main(Main.java:106)
    UNEXPECTED TOP-LEVEL EXCEPTION:
    java.io.FileNotFoundException: C:\Users\憟???iwi\AndroidStudioProjects\MyApplication\app\build\intermediates\pre-dexed\debug\support-annotations-21.0.3-51286ab94e7499c7ecd0aa476d97b899efaf6c27.jar (系統找不到指定的路徑。)
        at java.util.zip.ZipFile.open(Native Method)
        at java.util.zip.ZipFile.<init>(ZipFile.java:214)
        at java.util.zip.ZipFile.<init>(ZipFile.java:144)
        at java.util.zip.ZipFile.<init>(ZipFile.java:158)
        at com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:244)
        at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:166)
        at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:144)
        at com.android.dx.command.dexer.Main.processOne(Main.java:632)
        at com.android.dx.command.dexer.Main.processAllFiles(Main.java:510)
        at com.android.dx.command.dexer.Main.runMonoDex(Main.java:280)
        at com.android.dx.command.dexer.Main.run(Main.java:246)
        at com.android.dx.command.dexer.Main.main(Main.java:215)
        at com.android.dx.command.Main.main(Main.java:106)
    UNEXPECTED TOP-LEVEL EXCEPTION:
    java.io.FileNotFoundException: C:\Users\憟???iwi\AndroidStudioProjects\MyApplication\app\build\intermediates\pre-dexed\debug\internal_impl-21.0.3-ce55b50963ad65e1327b9400909949150e7611f9.jar (系統找不到指定的路徑。)
        at java.util.zip.ZipFile.open(Native Method)
        at java.util.zip.ZipFile.<init>(ZipFile.java:214)
        at java.util.zip.ZipFile.<init>(ZipFile.java:144)
        at java.util.zip.ZipFile.<init>(ZipFile.java:158)
        at com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:244)
        at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:166)
        at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:144)
        at com.android.dx.command.dexer.Main.processOne(Main.java:632)
        at com.android.dx.command.dexer.Main.processAllFiles(Main.java:510)
        at com.android.dx.command.dexer.Main.runMonoDex(Main.java:280)
        at com.android.dx.command.dexer.Main.run(Main.java:246)
        at com.android.dx.command.dexer.Main.main(Main.java:215)
        at com.android.dx.command.Main.main(Main.java:106)
    UNEXPECTED TOP-LEVEL EXCEPTION:
    java.io.FileNotFoundException: C:\Users\憟???iwi\AndroidStudioProjects\MyApplication\app\build\intermediates\pre-dexed\debug\classes-d623e62ecbc5d0168d8c16d5b214281abe3a28b1.jar (系統找不到指定的路徑。)
        at java.util.zip.ZipFile.open(Native Method)
        at java.util.zip.ZipFile.<init>(ZipFile.java:214)
        at java.util.zip.ZipFile.<init>(ZipFile.java:144)
        at java.util.zip.ZipFile.<init>(ZipFile.java:158)
        at com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:244)
        at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:166)
        at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:144)
        at com.android.dx.command.dexer.Main.processOne(Main.java:632)
        at com.android.dx.command.dexer.Main.processAllFiles(Main.java:510)
        at com.android.dx.command.dexer.Main.runMonoDex(Main.java:280)
        at com.android.dx.command.dexer.Main.run(Main.java:246)
        at com.android.dx.command.dexer.Main.main(Main.java:215)
        at com.android.dx.command.Main.main(Main.java:106)
    UNEXPECTED TOP-LEVEL EXCEPTION:
    java.io.FileNotFoundException: C:\Users\憟???iwi\AndroidStudioProjects\MyApplication\app\build\intermediates\pre-dexed\debug\classes-4970dd912b559490f230c1c9ad0babb79d453354.jar (系統找不到指定的路徑。)
        at java.util.zip.ZipFile.open(Native Method)
        at java.util.zip.ZipFile.<init>(ZipFile.java:214)
        at java.util.zip.ZipFile.<init>(ZipFile.java:144)
        at java.util.zip.ZipFile.<init>(ZipFile.java:158)
        at com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:244)
        at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:166)
        at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:144)
        at com.android.dx.command.dexer.Main.processOne(Main.java:632)
        at com.android.dx.command.dexer.Main.processAllFiles(Main.java:510)
        at com.android.dx.command.dexer.Main.runMonoDex(Main.java:280)
        at com.android.dx.command.dexer.Main.run(Main.java:246)
        at com.android.dx.command.dexer.Main.main(Main.java:215)
        at com.android.dx.command.Main.main(Main.java:106)
    5 errors; aborting


尝试在一个没有非ASCII字符的路径中找到你的项目; 您的用户名是Unicode,并且构建系统无法处理具有非ASCII Unicode的路径名。

这实际上是Java中的一个错误,很难修复; 有关详细信息,请参阅https://code.google.com/p/android/issues/detail?id=56102。 它的关键是Java的启动程序使用错误的Windows API调用从操作系统获取其命令行。


我刚刚在5分钟前解决了同样的问题。 你可以在这里看到debug:在Android 1.0中找不到文件我的问题是路径名。 在更新到1.0之前,我正在使用#Ing.Informatica和/Ingeniería/ AdministradorContrase?因为现在我必须使用Ing.Informatica和/ Ingenieria / AdministradorContrasennas,因为在更新之后,Android Studio似乎永远无法读取特殊字符。

希望它有所帮助。