Debugging 任务';的Android Studio执行失败:应用程序:dexDebug';
我正在尝试启动我的第一个Android Studio应用程序,当我尝试运行或调试时,一次又一次地遇到相同的错误。我正在使用SpotifyAPI构建一个音乐应用程序,并已将压缩的jar文件导入到正确的目录中(在我的应用程序的libs下) 问题似乎是我的SDK文件夹可能在另一个驱动器中?我不这么认为,但这是我唯一能想到的。我甚至移动了我的Android Studio文件夹,并尝试从相同的D:驱动器运行它,但没有任何区别 我还安装了所有适当的SDK,包括SDK工具、平台工具、SDK构建工具19.1、20、API 19、20、Android支持存储库、库、Google Play服务、存储库、USB驱动程序和Intel Emulator 这就是我得到的错误:Debugging 任务';的Android Studio执行失败:应用程序:dexDebug';,debugging,gradle,android-studio,Debugging,Gradle,Android Studio,我正在尝试启动我的第一个Android Studio应用程序,当我尝试运行或调试时,一次又一次地遇到相同的错误。我正在使用SpotifyAPI构建一个音乐应用程序,并已将压缩的jar文件导入到正确的目录中(在我的应用程序的libs下) 问题似乎是我的SDK文件夹可能在另一个驱动器中?我不这么认为,但这是我唯一能想到的。我甚至移动了我的Android Studio文件夹,并尝试从相同的D:驱动器运行它,但没有任何区别 我还安装了所有适当的SDK,包括SDK工具、平台工具、SDK构建工具19.1、2
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:dexDebug'.
> com.android.ide.common.internal.LoggedErrorException: Failed to run command:
D:\adt-bundle-windows-x86_64-20140702(2)\adt-bundle-windows-x86_64-20140702\sdk\build-tools\19.1.0\dx.bat --dex --output C:\Users\Jesse\AndroidStudioProjects\SubRosa\app\build\intermediates\dex\debug C:\Users\Jesse\AndroidStudioProjects\SubRosa\app\build\intermediates\classes\debug C:\Users\Jesse\AndroidStudioProjects\SubRosa\app\build\intermediates\dependency-cache\debug C:\Users\Jesse\AndroidStudioProjects\SubRosa\app\build\intermediates\exploded-aar\com.spotify.sdk\spotifysdk\1.0.0-beta5\libs\jnihelpers-1.0.jar D:\adt-bundle-windows-x86_64-20140702(2)\adt-bundle-windows-x86_64-20140702\sdk\extras\android\m2repository\com\android\support\support-v4\19.0.1\support-v4-19.0.1.jar C:\Users\Jesse\AndroidStudioProjects\SubRosa\app\build\intermediates\exploded-aar\com.spotify.sdk\spotifysdk\1.0.0-beta5\classes.jar C:\Users\Jesse\AndroidStudioProjects\SubRosa\app\build\intermediates\exploded-aar\com.android.support\appcompat-v7\19.0.1\classes.jar
Error Code:
1
Output:
'D:\adt-bundle-windows-x86_64-20140702' is not recognized as an internal or external command,
operable program or batch file.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
以下是一些我的代码和gradle构建/道具:
本地物业
sdk.dir=D\:\\adt-bundle-windows-x86_64-20140702(2)\\adt-bundle-windows-x86_64-20140702\\sdk
build.gradle(应用程序)
如果有人知道这是什么交易,请告诉我。我需要为最后一个项目开始这方面的工作,但由于某种原因,我无法解决这个技术问题。问题似乎是您的SDK位于一个带有括号的路径中(D:\adt-bundle-windows-x86\u 64-20140702(2)\adt-bundle-windows-x86\u 64-20140702\SDK),这会在构建过程的一个阶段造成问题。将您的SDK移动到一个名称更简单的路径,并在Android Studio中更新其位置(项目结构>SDK位置),您就可以开始了。这样就可以了!非常感谢。我从来没有想到(2)会把目录弄乱。我的路径中没有parenths<代码>/Users/umer/Development/adt-bundle-mac-x86_64-20140702/sdk,但执行失败:app:dexDebug。我如何解决它?检查您的项目目录路径中是否有一些奇怪的符号。例如,我的dir中有“ä”。这产生了类似的错误。
apply plugin: 'com.android.application'
android {
compileSdkVersion 19
buildToolsVersion '19.1.0' // Note: this version should match the latest build-tools version
// that you installed in the SDK manager
defaultConfig {
applicationId "com.jesse.spalding.subrosa"
minSdkVersion 14
targetSdkVersion 19
versionName "1.0"
}
buildTypes {
release {
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
dexOptions {
preDexLibraries = false
}
}
repositories {
mavenCentral()
flatDir {
dirs 'libs'
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.spotify.sdk:spotifysdk:1.0.0-beta5@aar'
compile 'com.android.support:appcompat-v7:19.0.1'
}