Android Studio AVD is not launching - android

Hi I have installed the latest version of Android Studio on Windows 7 32-bit.
I have created a welcome app, but when I try to test it using AVD it's not launching, instead it's showing the error below:
Executing tasks: [:app:assembleDebug, :app:assembleDebugTest]
Configuration on demand is an incubating feature.
:app:preBuild
:app:compileDebugNdk UP-TO-DATE
:app:preDebugBuild
:app:checkDebugManifest
:app:preReleaseBuild
:app:prepareComAndroidSupportAppcompatV72102Library UP-TO-DATE
:app:prepareComAndroidSupportSupportV42102Library UP-TO-DATE
:app:prepareDebugDependencies
:app:compileDebugAidl UP-TO-DATE
:app:compileDebugRenderscript UP-TO-DATE
:app:generateDebugBuildConfig UP-TO-DATE
:app:generateDebugAssets UP-TO-DATE
:app:mergeDebugAssets UP-TO-DATE
:app:generateDebugResValues UP-TO-DATE
:app:generateDebugResources UP-TO-DATE
:app:mergeDebugResources
:app:processDebugManifest UP-TO-DATE
:app:processDebugResources
:app:generateDebugSources
:app:compileDebugJava
:app:preDexDebug
The system cannot find the path specified.
The system cannot find the path specified.
FAILED
The system cannot find the path specified.
The system cannot find the path specified.
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':app:preDexDebug'.
> com.android.ide.common.internal.LoggedErrorException: Failed to run command:
E:\Android\AndroidStudio\sdk\build-tools\21.1.1\dx.bat --dex --output E:\Android\AndroidStudio\WorkLocation\MyApplication\app\build\intermediates\pre-dexed\debug\classes-0f52de9bbc91bb9956813aaf2c6f0ff9d0160fa0.jar E:\Android\AndroidStudio\WorkLocation\MyApplication\app\build\intermediates\exploded-aar\com.android.support\appcompat-v7\21.0.2\classes.jar
Error Code: 1
Output: The system cannot find the path specified.
Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 24.154 secs
**Failed to complete Gradle execution
Cause:**
Does anyone know how to fix this?

Related

Android Studio Gradle build error- Task :app:packageInstantRunResourcesDebug FAILED

I am new to android studio and Gradle. I have a project where I am loading a large SQLite database (from assets folder). When I press run and select an emulator, android studio starts on the build and executes gradle tasks. I am getting an error on one of these tasks which says:
Error:Execution failed for task ':app:packageInstantRunResourcesDebug'.
> org.gradle.tooling.BuildException (no error message)
and in the complete error output in console it says this:
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:packageInstantRunResourcesDebug'.
> org.gradle.tooling.BuildException (no error message)
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or
--debug option to get more log output.
* Get more help at https://help.gradle.org
BUILD FAILED in 21s
I don't know if this is due to the large database. This is the stack trace of the tasks being built:
Executing tasks: [:app:assembleDebug]
:app:buildInfoDebugLoader
:app:preBuild UP-TO-DATE
:app:preDebugBuild UP-TO-DATE
:app:compileDebugAidl UP-TO-DATE
:app:compileDebugRenderscript UP-TO-DATE
:app:checkDebugManifest UP-TO-DATE
:app:generateDebugBuildConfig UP-TO-DATE
:app:prepareLintJar UP-TO-DATE
:app:generateDebugResValues UP-TO-DATE
:app:generateDebugResources UP-TO-DATE
:app:mergeDebugResources UP-TO-DATE
:app:createDebugCompatibleScreenManifests UP-TO-DATE
:app:processDebugManifest UP-TO-DATE
:app:splitsDiscoveryTaskDebug UP-TO-DATE
:app:processDebugResources UP-TO-DATE
:app:generateDebugSources
:app:javaPreCompileDebug UP-TO-DATE
:app:compileDebugJavaWithJavac UP-TO-DATE
:app:mergeDebugShaders UP-TO-DATE
:app:compileDebugShaders UP-TO-DATE
:app:generateDebugAssets UP-TO-DATE
:app:mergeDebugAssets UP-TO-DATE
:app:packageInstantRunResourcesDebug FAILED
:app:buildInfoGeneratorDebug
You need to disable Instant Run feature. Instruction for latest stable Android Studio:
File -> Settings -> Build, Execution, Deployment -> Instant Run -> [Remove checkbox] ""Enable Instant Run to hot sap code...""

Android Studio on Mac OS X, Gradle complaining about org.bouncycastle.asn1.ASN1Primitive

Recently migrated (or still trying to) from Eclipse ADT to Android Studio, here's what Gradle says when I hit `Run' (full trace below):
* What went wrong:
Execution failed for task ':app:packageDebug'.
> class org.bouncycastle.asn1.ASN1Primitive overrides final method equals.(Ljava/lang/Object;)Z
I've seen: Android Studio Bouncy castle issue (newbie), Problems launching error in Android Studio when packageDebug at Max OS X and similar SO posts that all point out to a bouncy castle JAR (bcprov-jdk15on-1.48.jar) that should be removed from the classpath. However I have no such JAR file there and it, in fact, Gradle itself seems to download it because the only place where I found it was:
/Applications/Android Studio.app/Contents/gradle/m2repository/org/bouncycastle/bcprov-jdk15on/
Trying to delete the file there, Gradle complains that a referenced library is missing.
Just how do I fix this?
Complete trace:
Executing tasks: [:app:assembleDebug]
Configuration on demand is an incubating feature.
:app:preBuild UP-TO-DATE
:app:preDebugBuild UP-TO-DATE
:app:checkDebugManifest
:app:preDebugAndroidTestBuild UP-TO-DATE
:app:preReleaseBuild UP-TO-DATE
:app:prepareComAndroidSupportMultidex101Library UP-TO-DATE
:app:prepareDebugDependencies
:app:compileDebugAidl UP-TO-DATE
:app:compileDebugRenderscript UP-TO-DATE
:app:generateDebugBuildConfig UP-TO-DATE
:app:generateDebugAssets UP-TO-DATE
:app:mergeDebugAssets UP-TO-DATE
:app:generateDebugResValues UP-TO-DATE
:app:generateDebugResources UP-TO-DATE
:app:mergeDebugResources UP-TO-DATE
:app:processDebugManifest UP-TO-DATE
:app:processDebugResources UP-TO-DATE
:app:generateDebugSources UP-TO-DATE
:app:compileDebugJavaWithJavac UP-TO-DATE
:app:compileDebugNdk UP-TO-DATE
:app:compileDebugSources UP-TO-DATE
:app:transformClassesWithJarMergingForDebug UP-TO-DATE
:app:collectDebugMultiDexComponents
:app:transformClassesWithMultidexlistForDebug UP-TO-DATE
:app:transformClassesWithDexForDebug UP-TO-DATE
:app:mergeDebugJniLibFolders UP-TO-DATE
:app:transformNative_libsWithMergeJniLibsForDebug UP-TO-DATE
:app:processDebugJavaRes UP-TO-DATE
:app:transformResourcesWithMergeJavaResForDebug UP-TO-DATE
:app:validateDebugSigning
:app:packageDebug FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:packageDebug'.
> class org.bouncycastle.asn1.ASN1Primitive overrides final method equals.(Ljava/lang/Object;)Z
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 0.479 secs

Error: Execution failed for task ':app:preDexDebug'

i've just installed the latest version of Android Studio Bundle with SDK
but i couldn't run even its "hello world" default simple program and when ever i tried to run program it just keep saying Execution failed for task ':app:preDexDebug'.
and here is the complete gradle console log:
Executing tasks: [:app:assembleDebug]
Configuration on demand is an incubating feature. :app:preBuild
UP-TO-DATE :app:preDebugBuild UP-TO-DATE :app:checkDebugManifest
:app:preReleaseBuild UP-TO-DATE
:app:prepareComAndroidSupportAppcompatV72211Library UP-TO-DATE
:app:prepareComAndroidSupportSupportV42211Library UP-TO-DATE
:app:prepareDebugDependencies :app:compileDebugAidl UP-TO-DATE
:app:compileDebugRenderscript UP-TO-DATE :app:generateDebugBuildConfig
UP-TO-DATE :app:generateDebugAssets UP-TO-DATE :app:mergeDebugAssets
UP-TO-DATE :app:generateDebugResValues UP-TO-DATE
:app:generateDebugResources UP-TO-DATE :app:mergeDebugResources
UP-TO-DATE :app:processDebugManifest UP-TO-DATE
:app:processDebugResources UP-TO-DATE :app:generateDebugSources
UP-TO-DATE :app:processDebugJavaRes UP-TO-DATE :app:compileDebugJava
UP-TO-DATE :app:compileDebugNdk UP-TO-DATE :app:compileDebugSources
UP-TO-DATE :app:preDexDebug FAILED
FAILURE: Build failed with an exception.
What went wrong: Execution failed for task ':app:preDexDebug'.
com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command
'C:\Program Files\Java\jdk1.8.0_40\bin\java.exe'' finished with
non-zero exit value 1
Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 4.734 secs
i tried with jdk version 7 and jdk 8 (32bit-win8)
i know there are similar topic and questions but none of them counldn't solve my problem

Android studio is not running my project [duplicate]

I have just installed Android studio on a win 7 and wanted to compile the first sample code but the compiling fails
Executing tasks: [:app:assembleDebug]
Configuration on demand is an incubating feature.
:app:preBuil
:app:compileDebugNdk UP-TO-DATE
:app:preDebugBuild
:app:checkDebugManifest
:app:preReleaseBuild
:app:prepareComAndroidSupportAppcompatV72102Library UP-TO-DATE
:app:prepareComAndroidSupportSupportV42102Library UP-TO-DATE
:app:prepareDebugDependencies
:app:compileDebugAidl UP-TO-DATE
:app:compileDebugRenderscript UP-TO-DATE
:app:generateDebugBuildConfig UP-TO-DATE
:app:generateDebugAssets UP-TO-DATE
:app:mergeDebugAssets UP-TO-DATE
:app:generateDebugResValues UP-TO-DATE
:app:generateDebugResources UP-TO-DATE
:app:mergeDebugResources UP-TO-DATE
:app:processDebugManifest UP-TO-DATE
:app:processDebugResources UP-TO-DATE
:app:generateDebugSources UP-TO-DATE
:app:compileDebugJava UP-TO-DATE
:app:preDexDebug
Den angivne sti blev ikke fundet. (The specified path was not found.)
FAILED
Den angivne sti blev ikke fundet. (The specified path was not found.)
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:preDexDebug'.
> com.android.ide.common.internal.LoggedErrorException: Failed to run command:
C:\Users\Sigmac\AppData\Local\Android\sdk\build-tools\21.1.1\dx.bat --dex --output
C:\Users\Sigmac\AndroidStudioProjects\Voting\app\build\intermediates\pre-dexed\debug
\classes-b6f615fe9376219a5b11445078329964f51dafd9.jar C:\Users\Sigmac
\AndroidStudioProjects\Voting\app\build\intermediates\exploded-aar\com.android.support
\appcompat-v7\21.0.2\classes.jar
Error Code:
1
Output:
Den angivne sti blev ikke fundet. (The specified path was not found.)
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option
to get more log output.
BUILD FAILED
Total time: 30.911 secs
Den angivne sti blev ikke fundet. (The specified path was not found.)
I have tested that this eksist:
C:\Users\Sigmac\AppData\Local\Android\sdk\build-tools\21.1.1\dx.bat
This folder eksist but is emty
C:\Users\Sigmac\AndroidStudioProjects\Voting\app\build\intermediates\pre-dexed\debug\
and this eksist
C:\Users\Sigmac\AndroidStudioProjects\Voting\app\build\intermediates\exploded-aar\com.android.support\appcompat-v7\21.0.2\classes.jar
I have google and search this site but cant finde a solution to this
--stacktrace, --info or --debug don't change the result
I have tryed directly from cmd whit same result
and I have tryed "" the path
Can any point me to a solution?
This is bug https://code.google.com/p/android/issues/detail?id=82099 which should be fixed in the 24.0.1 release of the SDK, which is available now.
The bug is that an internal script that finds the distribution of Java isn't working correctly on 32-bit Windows systems.

Android Studio - Gradle build failed Error:Execution failed for task ':app:dexDebug'

I have an odd problem with AS. I have two OSX computers. A simple app builds on one of them but not the other. The two computers are almost identical.
Here are the specs of the two computers:
*OSX 10.8.5 - both fresh installed earlier this year. Not upgraded from older version of OSX.
*JDK 1.8.0_05
*Android Studio 0.8.1 - both fresh installed
*Latest Android SDK. The Android Studio SDK Manager looks exactly the same on both machines.
Here is how I build a test project:
Install fresh install of AS 0.8.0 for OSX
Upgrade to 0.8.1
Update SDKs
Start AS
Select New Project On "Configure your new project page", press Next button
On "Select form factors" page, press Next button
On "Add and activity" page, select Blank Activity and press Next button
On "Choose options" page, press Finish
Let AS build new project
Close Tip of the Day
Press Run button
As you can see, this is letting AS build the most basic template.
On one computer the build fails. On the other computer it succeeds and I can run the project in the emulator. On both computers I can Sync with Gradle and the Gradle build finishes.
On one computer, the build fails when click Run. I have compared the gradle.build files and, of course they are the same. They were both built by AS.
I am assuming something has been installed on the failing computer that prevents the build. How can I "reset" the failing computer? Would uninstalling JDK help? I have deleted AS many times and that does not help. I am not sure how to uninstall the various SDK components.
Here is the error messages I get when I Run on the failing computer:
Build fails with following output:
Information:Gradle tasks [:app:assembleDebug]
:app:preBuild
:app:compileDebugNdk
:app:preDebugBuild
:app:checkDebugManifest
:app:prepareDebugDependencies
:app:compileDebugAidl UP-TO-DATE
:app:compileDebugRenderscript UP-TO-DATE
:app:generateDebugBuildConfig UP-TO-DATE
:app:generateDebugAssets UP-TO-DATE
:app:mergeDebugAssets UP-TO-DATE
:app:generateDebugResValues UP-TO-DATE
:app:generateDebugResources UP-TO-DATE
:app:mergeDebugResources UP-TO-DATE
:app:processDebugManifest UP-TO-DATE
:app:processDebugResources UP-TO-DATE
:app:generateDebugSources UP-TO-DATE
:app:compileDebugJava
:app:preDexDebug
:app:dexDebug
2014-07-07 21:30:45.482 java[19889:1603] Connection with distnoted server was invalidated
2014-07-07 21:30:45.542 java[19889:4103] Connection with distnoted server was invalidated
Error:Execution failed for task ':app:dexDebug'.
com.android.ide.common.internal.LoggedErrorException: Failed to run command:
/Applications/Android Studio.app/sdk/build-tools/android-4.4W/dx --dex --num-threads=4 --output /Users/clark/AndroidStudioProjects/MyApplication/app/build/intermediates/dex/debug /Users/clark/AndroidStudioProjects/MyApplication/app/build/intermediates/classes/debug /Users/clark/AndroidStudioProjects/MyApplication/app/build/intermediates/dependency-cache/debug
Error Code:
1
Output:
2014-07-07 21:30:45.482 java[19889:1603] Connection with distnoted server was invalidated
2014-07-07 21:30:45.542 java[19889:4103] Connection with distnoted server was invalidated
Information:BUILD FAILED
Information:Total time: 1.514 secs
Information:1 error
Information:0 warnings
Information:See complete output in console
Gradle Console shows following error:
Executing tasks: [:app:generateDebugSources]
Configuration on demand is an incubating feature.
:app:preBuild
:app:preDebugBuild
:app:checkDebugManifest
:app:prepareDebugDependencies
:app:compileDebugAidl
:app:compileDebugRenderscript
:app:generateDebugBuildConfig
:app:generateDebugAssets UP-TO-DATE
:app:mergeDebugAssets
:app:generateDebugResValues
:app:generateDebugResources
:app:mergeDebugResources
:app:processDebugManifest
:app:processDebugResources
:app:generateDebugSources
BUILD SUCCESSFUL
Total time: 4.441 secs
Executing tasks: [:app:assembleDebug]
Configuration on demand is an incubating feature.
:app:preBuild
:app:compileDebugNdk
:app:preDebugBuild
:app:checkDebugManifest
:app:prepareDebugDependencies
:app:compileDebugAidl UP-TO-DATE
:app:compileDebugRenderscript UP-TO-DATE
:app:generateDebugBuildConfig UP-TO-DATE
:app:generateDebugAssets UP-TO-DATE
:app:mergeDebugAssets UP-TO-DATE
:app:generateDebugResValues UP-TO-DATE
:app:generateDebugResources UP-TO-DATE
:app:mergeDebugResources UP-TO-DATE
:app:processDebugManifest UP-TO-DATE
:app:processDebugResources UP-TO-DATE
:app:generateDebugSources UP-TO-DATE
:app:compileDebugJava
:app:preDexDebug
:app:dexDebug
2014-07-07 21:30:45.482 java[19889:1603] Connection with distnoted server was invalidated
2014-07-07 21:30:45.542 java[19889:4103] Connection with distnoted server was invalidated
FAILED
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':app:dexDebug'.
com.android.ide.common.internal.LoggedErrorException: Failed to run command:
/Applications/Android Studio.app/sdk/build-tools/android-4.4W/dx --dex --num-threads=4 --output /Users/clark/AndroidStudioProjects/MyApplication/app/build/intermediates/dex/debug /Users/clark/AndroidStudioProjects/MyApplication/app/build/intermediates/classes/debug /Users/clark/AndroidStudioProjects/MyApplication/app/build/intermediates/dependency-cache/debug
Error Code:
1
Output:
2014-07-07 21:30:45.482 java[19889:1603] Connection with distnoted server was invalidated
2014-07-07 21:30:45.542 java[19889:4103] Connection with distnoted server was invalidated
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 1.514 secs

Categories

Resources