【发布时间】:2014-12-03 22:46:24
【问题描述】:
我正在尝试启动我的第一个 Android Studio 应用,但在尝试运行或调试时一遍又一遍地遇到相同的错误。我正在使用 Spotify API 构建一个音乐应用程序,并将压缩的 jar 文件导入正确的目录(在我的应用程序的 libs 下)。
问题似乎是我的 SDK 文件夹可能在另一个驱动器中?我不这么认为,但这是我唯一能想到的。我什至移动了我的 Android Studio 文件夹并尝试从同一个 D: 驱动器运行它,但没有任何区别。
我还安装了所有适当的 SDK,包括。 SDK 工具、平台工具、SDK 构建工具 19.1、20、API 19、20、Android 支持存储库、库、Google Play 服务、存储库、USB 驱动程序和英特尔仿真器。
这是我得到的错误:
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 构建/道具:
local.properties
sdk.dir=D\:\\adt-bundle-windows-x86_64-20140702(2)\\adt-bundle-windows-x86_64-20140702\\sdk
build.gradle(app)
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'
}
如果有人知道这是什么交易,请告诉我。我需要开始为最终项目做这件事,但由于某种原因无法解决这个技术问题。
【问题讨论】:
标签: debugging gradle android-studio