0

I have a big problem with the Android Studio on my Win 8.1 (32-bit) when I finish my app (everything is correct. No Bugs).

I can't try it on emulator or generate a registered APK, and I get this error:

Failed to complete Gradle execution

Cause:

(there is no cause just an empty line)

also I can't open the SDK Manager :(

Sufian
  • 6,405
  • 16
  • 66
  • 120
Ayham Najem
  • 65
  • 2
  • 6
  • msgs tab: Error:Execution failed for task ':app:preDexDebug'. > com.android.ide.common.internal.LoggedErrorException: Failed to run command:C:\Users\Ayham\AppData\Local\Android\Sdk\build-tools\21.1.1\dx.bat --dex --output C:\Users\Ayham\AndroidStudioProjects\Firstlesson\app\build\intermediates\pre-dexed\debug\support-annotations-21.0.2-492c833ed7692533ed7aa043d989bf322215f185.jar C:\Users\Ayham\AppData\Local\Android\Sdk\extras\android\m2repository\com\android\support\support-annotations\21.0.2\support-annotations-21.0.2.jar Error Code:1 Output:The system cannot find the path specified. – Ayham Najem Dec 09 '14 at 19:14

4 Answers4

0

Go to File -> Settings -> Gradle

Input the following in the "Gradle VM options:" box: -XX:MaxHeapSize=256m -Xmx256m

Hit apply and Android Studio should build your project successfully.

bjiang
  • 6,068
  • 2
  • 22
  • 35
0

It seems that your SDK is not on the path that it is expected to be or inside your Android Studio you have to specify the path to where you have your SDK on your computer.

David Kasabji
  • 1,049
  • 3
  • 15
  • 32
  • ok then, how can I change the path, the SDK manager is not working :( – Ayham Najem Dec 09 '14 at 19:28
  • YOu might find an answer here: http://stackoverflow.com/questions/16581752/android-studio-how-to-change-android-sdk-path or by googling it. I'm sure there are solutions online for this fix. – David Kasabji Dec 09 '14 at 19:30
  • nop >> I put the right path but nothing changed, the same problem, and I googled a lot for this :( – Ayham Najem Dec 09 '14 at 19:44
0

I think you may want to double check your SDK and it's path, that's usually the case.

Alex P.
  • 488
  • 5
  • 12
  • ok I think I will repeat every thing, can you please send me a link for the correct SDK package for the android studio? – Ayham Najem Dec 09 '14 at 21:12
  • I used http://developer.android.com/sdk/installing/index.html and it woked fine but if it doesnt you can check http://developer.android.com/sdk/index.html hope it helpt. – Alex P. Dec 10 '14 at 18:35
0

Try this. It helped me, FINALLY !!!

*close android studio *Download http://goo.gl/v0UPm6 * goto \sdk * rename 'tools' to 'tools1' (In case you need backup) * extract this zip to \sdk * it will make tools folder in \sdk *restart studio and errors will be gone

Source: Google Plus

PD: Thank you, Aman ;) PD2: Android SDK Tools 24.0.1 is coming !!!

Diego
  • 109
  • 2