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

Community
  • 1
  • 1
Iralution
  • 480
  • 1
  • 5
  • 16
  • I tried again with an installation on another drive (I thought it could may be an permission problem) but it did not worked – Iralution Jun 16 '14 at 07:37
  • 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 issue – Daniel Wilson Jun 29 '14 at 23:29
  • 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.1 – Iralution Jun 30 '14 at 07:32
  • I'm sure you've seen this but could the top answer here be relevant? http://stackoverflow.com/questions/21102598/android-studio-unexpected-top-level-exception – Daniel Wilson Jun 30 '14 at 11:23
  • ur gradle should be 1.10 and above – Bubunyo Nyavor Jul 06 '14 at 19:52
  • I had the same problem, deleting all the gradle cache directories did the trick – Lectem Jul 06 '14 at 23:18
  • @Iralution it's not Windows specific, I'm getting this on Mac. – Nestor Ledon Dec 09 '14 at 22:52
  • @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 occured – Iralution Dec 10 '14 at 11:09
  • [This][1] works for me. It might work for you too. [1]: http://stackoverflow.com/a/27407125/1118886 – Sheraz Ahmad Khilji Dec 10 '14 at 17:29

2 Answers2

-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.

Community
  • 1
  • 1
WannaGetHigh
  • 3,826
  • 4
  • 23
  • 31
-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

djr_
  • 25
  • 2