用新的Andr​​oid Studio项目摇篮执行失败的任务“:dexDebug:应用”摇篮、任务、项目、oid

2023-09-07 15:10:14 作者:欠你一滴泪

我新装的Andr​​oid开始了新的缺省项目。每次我尝试启动出现此错误应用程序:

I newly installed Android started a new default project. Everytime I try to start the app this error occurs:

错误:执行失败的任务:应用程序:dexDebug。  com.android.ide.common.internal.LoggedErrorException:无法运行命令:      C:\\用户\\ iralu_000 \\应用程序数据\\本地\\的Andr​​oid \\ android的工作室\\ SDK \\构建工具\\ 19.1.0 \\ dx.bat --dex --num线程= 4 --output C:\\用户\\ iralu_000 \\ AndroidStudioProjects \\ BuyItOrNot \\程序\\建立\\中间体\\ DEX \\调试C:\\用户\\ iralu_000 \\ AndroidStudioProjects \\ BuyItOrNot \\程序\\编译\\中间体\\类\\调试C:\\用户\\ iralu_000 \\ AndroidStudioProjects \\ BuyItOrNot \\程序\\编译\\中间体\\依赖缓存\\调试  错误code:      1  输出:      DAS系统卡恩书房angegebenen PFAD nicht芬登。      DAS系统卡恩书房angegebenen PFAD nicht芬登。      DAS系统卡恩书房angegebenen PFAD nicht芬登。  (Englisch:系统找不到指定的路径)

Error:Execution failed for task ':app:dexDebug'. com.android.ide.common.internal.LoggedErrorException: Failed to run command: C:\Users\iralu_000\AppData\Local\Android\android-studio\sdk\build-tools\19.1.0\dx.bat --dex --num-threads=4 --output C:\Users\iralu_000\AndroidStudioProjects\BuyItOrNot\app\build\intermediates\dex\debug C:\Users\iralu_000\AndroidStudioProjects\BuyItOrNot\app\build\intermediates\classes\debug C:\Users\iralu_000\AndroidStudioProjects\BuyItOrNot\app\build\intermediates\dependency-cache\debug Error Code: 1 Output: Das System kann den angegebenen Pfad nicht finden. Das System kann den angegebenen Pfad nicht finden. Das System kann den angegebenen Pfad nicht finden. (Englisch: The system can not find the path specified.)

的build.gradle

apply plugin: 'android'

android {
    compileSdkVersion 19
    buildToolsVersion "19.1.0"

    defaultConfig {
        applicationId "iralution.buyitornot"
        minSdkVersion 19
        targetSdkVersion 19
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            runProguard false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-    rules.pro'
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
}

通过SDK安装管理器有:

Installed via SDK Managers are:

我试图通过CMD清理项目,gradlew干净,但仍然是错误。

I tried to clean the project via cmd with gradlew clean but the error remains.

我尝试不同的SDK JAVA(7和目前为8)。

I tried different JAVA SDKs (7 and currently 8).

我试图支持库添加到依赖的建议here.

I tried to add the support library to the dependencies as suggested here.

Android的工作室是在版本0.6.1

Android Studio is in Version 0.6.1

我不知道我现在可以试试。

I have no clue what I could try now.

由于提前,

艾拉

更新:

我已经操纵在Android的SDK中的find_java.bat这是由dx.bat调用。而不是

I've manipulated the find_java.bat in the android-sdk which is called by the dx.bat. Instead of

for /f "delims=" %%a in ('"%~dps0\find_java.exe" -s') do set java_exe=%%a

for /f "delims=" %%a in ('"%~dps0\find_java.exe" -s -w') do set javaw_exe=%%a

我直接设置java_exe和javaw_exe。这根除两三个找不到指定的路径的错误,而是一个仍然和我想不通为什么。

I've set the java_exe and javaw_exe directly. This eradicates two of the three "could not find the path specified" errors, but one still remains and I cannot figure why.

推荐答案

您好:我不知道这是否会解决您的问题,但你应该在这个答案看看

Hello i'm not sure if this will solve your problem but you should take a look at this answer

http://stackoverflow.com/a/21752326

在这个答案似乎的cmd.exe 命令无法找到。他通过这种变化解决了它:

in this answer it seems that the cmd.exe command can't be found. And he solved it by making this change :

我删除键默认与值 C:在 HKEY_CURRENT_USER \\软件\\微软\\命令处理器和\\ WINDOWS \\ CMD.EXE 注册表问题解决...

I removed key default with value C:\windows\cmd.exe in registry at HKEY_CURRENT_USER\Software\Microsoft\Command Processor and Problem Resolved...

因此​​,也许你应该在这个系统登录看看,看看你可以改变命令的路径来解决这个问题。

So maybe you should take a look at this registery to see if you could change the path of the command to fix this issue.