Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Studio new project can not run, throwing error

Just now I have installed and started working on Android Studio, and created new project after configuring everything I needed to start working on project. In newly created project, I have not changed anything and then tried to run the project. But it is not working and throwing some dependency error I guess. Here is it

Gradle:   FAILURE: Build failed with an exception. 
  • What went wrong: A problem was found with the configuration of task ':StudioTest2:packageDebug'.

    File 'C:\Users\StudioTest2\StudioTest2\build\libs\StudioTest2-debug.dex' specified for property 'dexFile' does not exist.

  • Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

    Could not execute build using Gradle distribution 'http://services.gradle.org/distributions/gradle-1.6-bin.zip'.

like image 610
JNI_OnLoad Avatar asked May 16 '13 06:05

JNI_OnLoad


People also ask

Why Android Studio is not running the app?

Unplug your device from the USB port on the computer. Restart the device by powering off and back on. Verify that Settings => Developer options => USB Debugging is enabled. Quit and re-launch Android Studio.

How do I clean my android project?

Clear your project directory Obviously, try to clean your project from android studio : “Build -> Clean Project”. This will clear your build folders. Clear the cache of Android Studio using “File -> Invalidate Caches / Restart” choose “Invalidate and restart option” and close Android Studio.


1 Answers

One thing I found that helped was to import the project after creating it, I was getting the same issue but once I imported the project (as opposed to just opening it), it built fine.

like image 138
adefran83 Avatar answered Sep 18 '22 09:09

adefran83