Error:Execution failed for task ':app:dexDebug'
Error:Execution failed for task ':app:dexDebug'
我正在尝试制作一个简单的应用程序,但每次尝试 运行 该应用程序时,我都会收到此错误。
Error:Execution failed for task ':app:dexDebug'.>com.android.ide.common.internal.LoggedErrorException: Failed to run command:
C:\Users\Alejandro\AppData\Local\Android\sdk\build-tools.1.2\dx.bat --dex --no-optimize --output C:\Users\Alejandro\Dropboxº DAM\AndroidStudioProjectsDropbox\FastyFast\app\build\intermediates\dex\debug --input-list=C:\Users\Alejandro\Dropboxº DAM\AndroidStudioProjectsDropbox\FastyFast\app\build\intermediates\tmp\dex\debug\inputList.txt
Error Code:
1
Output:
UNEXPECTED TOP-LEVEL EXCEPTION:
java.lang.RuntimeException: C:\Users\Alejandro\Dropboxº DAM\AndroidStudioProjectsDropbox\FastyFast\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\Alejandro\Dropboxº DAM\AndroidStudioProjectsDropbox\FastyFast\app\build\intermediates\pre-dexed\debug\support-annotations-21.0.3-b29fd01b30007e41669b44d2e19fb39eea844240.jar (El sistema no puede encontrar la ruta especificada)
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.(Unknown Source)
at java.util.zip.ZipFile.(Unknown Source)
at java.util.zip.ZipFile.(Unknown Source)
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\Alejandro\Dropboxº DAM\AndroidStudioProjectsDropbox\FastyFast\app\build\intermediates\pre-dexed\debug\internal_impl-21.0.3-5a0c9ff4d81e7e53b50296e4e2549fc036b4b3db.jar (El sistema no puede encontrar la ruta especificada)
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.(Unknown Source)
at java.util.zip.ZipFile.(Unknown Source)
at java.util.zip.ZipFile.(Unknown Source)
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\Alejandro\Dropboxº DAM\AndroidStudioProjectsDropbox\FastyFast\app\build\intermediates\pre-dexed\debug\classes-1a3933f3cfbb63995646d20c10e8ee01b7f2eac5.jar (El sistema no puede encontrar la ruta especificada)
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.(Unknown Source)
at java.util.zip.ZipFile.(Unknown Source)
at java.util.zip.ZipFile.(Unknown Source)
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\Alejandro\Dropboxº DAM\AndroidStudioProjectsDropbox\FastyFast\app\build\intermediates\pre-dexed\debug\classes-1337a4751778935a1a6ca6cffc12c9f23e5cc37f.jar (El sistema no puede encontrar la ruta especificada)
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.(Unknown Source)
at java.util.zip.ZipFile.(Unknown Source)
at java.util.zip.ZipFile.(Unknown Source)
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
我一直在寻找解决方案,但一无所获。
这是我的 build.gradle 文件:
apply plugin: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion "21.1.2"
defaultConfig {
applicationId "com.fasty.fastyfast"
minSdkVersion 15
targetSdkVersion 21
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:21.0.3'
}
这是我的 AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.fasty.fastyfast" >
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name=".MainActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
我同步的时候没有崩溃。使用 Gradle 文件,但我尝试 运行 应用程序
我可以看到:
UNEXPECTED TOP-LEVEL EXCEPTION: java.io.FileNotFoundException: C:\Users\Alejandro\Dropboxº DAM\AndroidStudioProjectsDropbox\FastyFast\app\build\intermediates\pre-dexed\debug\internal_impl-21.0.3-5a0c9ff4d81e7e53b50296e4e2549fc036b4b3db.jar
在我看来 2º
不应该在路径中。奇怪的编码。
C:\Users\Alejandro\Dropboxº DAM\AndroidStudioProjectsDropbox\FastyFast\app\build\intermediates\dex\debug --input-list=C:\Users\Alejandro\Dropboxº DAM\AndroidStudioProjectsDropbox\FastyFast\app\build\intermediates\tmp\dex\debug\inputList.txt
º Android 或 class 无法识别此字符。我会建议你更改项目名称并输入一些没有特殊字符的内容。
我正在尝试制作一个简单的应用程序,但每次尝试 运行 该应用程序时,我都会收到此错误。
Error:Execution failed for task ':app:dexDebug'.>com.android.ide.common.internal.LoggedErrorException: Failed to run command: C:\Users\Alejandro\AppData\Local\Android\sdk\build-tools.1.2\dx.bat --dex --no-optimize --output C:\Users\Alejandro\Dropboxº DAM\AndroidStudioProjectsDropbox\FastyFast\app\build\intermediates\dex\debug --input-list=C:\Users\Alejandro\Dropboxº DAM\AndroidStudioProjectsDropbox\FastyFast\app\build\intermediates\tmp\dex\debug\inputList.txt Error Code: 1 Output: UNEXPECTED TOP-LEVEL EXCEPTION: java.lang.RuntimeException: C:\Users\Alejandro\Dropboxº DAM\AndroidStudioProjectsDropbox\FastyFast\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\Alejandro\Dropboxº DAM\AndroidStudioProjectsDropbox\FastyFast\app\build\intermediates\pre-dexed\debug\support-annotations-21.0.3-b29fd01b30007e41669b44d2e19fb39eea844240.jar (El sistema no puede encontrar la ruta especificada) at java.util.zip.ZipFile.open(Native Method) at java.util.zip.ZipFile.(Unknown Source) at java.util.zip.ZipFile.(Unknown Source) at java.util.zip.ZipFile.(Unknown Source) 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\Alejandro\Dropboxº DAM\AndroidStudioProjectsDropbox\FastyFast\app\build\intermediates\pre-dexed\debug\internal_impl-21.0.3-5a0c9ff4d81e7e53b50296e4e2549fc036b4b3db.jar (El sistema no puede encontrar la ruta especificada) at java.util.zip.ZipFile.open(Native Method) at java.util.zip.ZipFile.(Unknown Source) at java.util.zip.ZipFile.(Unknown Source) at java.util.zip.ZipFile.(Unknown Source) 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\Alejandro\Dropboxº DAM\AndroidStudioProjectsDropbox\FastyFast\app\build\intermediates\pre-dexed\debug\classes-1a3933f3cfbb63995646d20c10e8ee01b7f2eac5.jar (El sistema no puede encontrar la ruta especificada) at java.util.zip.ZipFile.open(Native Method) at java.util.zip.ZipFile.(Unknown Source) at java.util.zip.ZipFile.(Unknown Source) at java.util.zip.ZipFile.(Unknown Source) 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\Alejandro\Dropboxº DAM\AndroidStudioProjectsDropbox\FastyFast\app\build\intermediates\pre-dexed\debug\classes-1337a4751778935a1a6ca6cffc12c9f23e5cc37f.jar (El sistema no puede encontrar la ruta especificada) at java.util.zip.ZipFile.open(Native Method) at java.util.zip.ZipFile.(Unknown Source) at java.util.zip.ZipFile.(Unknown Source) at java.util.zip.ZipFile.(Unknown Source) 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
我一直在寻找解决方案,但一无所获。
这是我的 build.gradle 文件:
apply plugin: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion "21.1.2"
defaultConfig {
applicationId "com.fasty.fastyfast"
minSdkVersion 15
targetSdkVersion 21
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:21.0.3'
}
这是我的 AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.fasty.fastyfast" >
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
android:name=".MainActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
我同步的时候没有崩溃。使用 Gradle 文件,但我尝试 运行 应用程序
我可以看到:
UNEXPECTED TOP-LEVEL EXCEPTION: java.io.FileNotFoundException: C:\Users\Alejandro\Dropboxº DAM\AndroidStudioProjectsDropbox\FastyFast\app\build\intermediates\pre-dexed\debug\internal_impl-21.0.3-5a0c9ff4d81e7e53b50296e4e2549fc036b4b3db.jar
在我看来 2º
不应该在路径中。奇怪的编码。
C:\Users\Alejandro\Dropboxº DAM\AndroidStudioProjectsDropbox\FastyFast\app\build\intermediates\dex\debug --input-list=C:\Users\Alejandro\Dropboxº DAM\AndroidStudioProjectsDropbox\FastyFast\app\build\intermediates\tmp\dex\debug\inputList.txt
º Android 或 class 无法识别此字符。我会建议你更改项目名称并输入一些没有特殊字符的内容。