Gradle Execution failed for task ':app:dexDebug' with new Android Studio Project
Asked Answered
X

2

9

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

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'])
}

Installed via SDK Managers are: enter image description here

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

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

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

Android Studio is in Version 0.6.1

I have no clue what I could try now.

Thanks in advance,

Ira

Update:

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

and

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

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.

enter image description here

Xiaoximena answered 15/6, 2014 at 23:2 Comment(9)
I tried again with an installation on another drive (I thought it could may be an permission problem) but it did not workedXiaoximena
You could try Android Studio 0.8.1, the latest version - I know it's not the solution but might solve the problem, or if the problem persists you will know it's likely a project set-up issue rather than an IDE issuePeriphrastic
As far as I can say it is a Windows specific error, because on Linux I have no problems with Android Studio. At this moment I'm running Android Studio 0.8.1 on Windows 8.1Xiaoximena
I'm sure you've seen this but could the top answer here be relevant? #21103098Periphrastic
ur gradle should be 1.10 and aboveYahoo
I had the same problem, deleting all the gradle cache directories did the trickKemper
@Xiaoximena it's not Windows specific, I'm getting this on Mac.Crumble
@Xerosigma at that time with that version I think it was a problem with my git installation. I used msysgit or something like that, which asks you in the installation process if you want to install custom behaviour to the cmd (like ls command etc.). After a new windows installation without installing that git-package the problem didn't occuredXiaoximena
[This][1] works for me. It might work for you too. [1]: https://mcmap.net/q/1276647/-android-studio-error-39-reg-39-is-not-recognized-as-an-internal-or-external-commandJezabella
P
-2

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

https://stackoverflow.com/a/21752326

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

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.

Phenylalanine answered 4/7, 2014 at 14:31 Comment(0)
I
-3

I had this same issue. For me, the culprit was a cmd.exe AutoRun registry key, located at

HKEY_CURRENT_USER\Software\Microsoft\Command Processor\AutoRun

I deleted this key, and the errors disappeared.

For more information, see: http://blogs.msdn.com/b/oldnewthing/archive/2007/11/21/6447771.aspx

Ilyse answered 15/8, 2014 at 0:39 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.