Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Android Build a Simple Android App (2014) Getting Started with Android Running the Fun Facts Project

Artur Mamedov
PLUS
Artur Mamedov
Courses Plus Student 1,600 Points

Unable to start Android Studio once installed

I recently installed android studio and tried to run it for the first time. It wouldn't run and this error kept showing up. Is there something I can do to fix this? Thank you.

Error:Execution failed for task ':app:dexDebug'.

com.android.ide.common.internal.LoggedErrorException: Failed to run command: C:\Users\arturmame\Downloads\android-studio-bundle-windows(1)\android-studio\sdk\build-tools\android-4.4W\dx.bat --dex --no-optimize --output C:\Users\arturmame\AndroidStudioProjects\FunFacts\MyApplication\app\build\intermediates\dex\debug C:\Users\arturmame\AndroidStudioProjects\FunFacts\MyApplication\app\build\intermediates\classes\debug Error Code: 1 Output: 'C:\Users\arturmame\Downloads\android-studio-bundle-windows' is not recognized as an internal or external command, operable program or batch file.

It seems like AS starts just fine, it is not able to run the Funfact project.

I am not sure of the problem, but here is a common procedure that I try to fix projects that fail to run when they ran successfully before.

If you are migrating/trying to open the eclipse project from android studio, make back up of the project. Try to sync the project with gradle (one of the icons in the menu bar) and rebuild/clean up the project (one of the dropdown menu item).

Artur Mamedov
Artur Mamedov
Courses Plus Student 1,600 Points

I tried all of those things and it still wouldn't work for me. This is a newly installed android studio. I tried using the one linked in the previous videos and it had the same error. I then reinstalled the program and downloaded the new one on the android site. Both of the versions had the same error and neither let me run the default project.

2 Answers

Naya Moss
Naya Moss
9,894 Points

I had the same issue. I went into my library files and deleted all files related with Java and Andriod Studio to start fresh. I then did a restart, downloaded the JDK versrion 6, downloaded JDK version7, Installed JKD v6, Installed JDK v7, restart, download this fix for macs on yosmite: http://t.co/t4eLXf4Hsu, restarted again and it worked like a charm!

Artur Mamedov
PLUS
Artur Mamedov
Courses Plus Student 1,600 Points

I found the problem. Turns out when I redownloaded it, it was renamed with a (1). Once I renamed it to the base file, everything worked smoothly.