Whenever I try to clean my project, Build -> Clean Project, in Android Studio 2.1, it executes the following command. Here's the output of Gradle console:
Executing tasks: [clean, :app:generateDebugSources, :app:generateDebugAndroidTestSources, :app:mockableAndroidJar, :app:prepareDebugUnitTestDependencies]
Configuration on demand is an incubating feature.
Incremental java compilation is an incubating feature.
:clean
:app:clean
:app:preBuild UP-TO-DATE
:app:preDebugBuild UP-TO-DATE
:app:checkDebugManifest
:app:preReleaseBuild UP-TO-DATE
:app:prepareComAndroidSupportAnimatedVectorDrawable2340Library
:app:prepareComAndroidSupportAppcompatV72340Library
:app:prepareComAndroidSupportSupportV42340Library
:app:prepareComAndroidSupportSupportVectorDrawable2340Library
:app:prepareDebugDependencies
:app:compileDebugAidl
:app:compileDebugRenderscript
:app:generateDebugBuildConfig
:app:mergeDebugShaders
:app:compileDebugShaders
:app:generateDebugAssets
:app:mergeDebugAssets
:app:generateDebugResValues UP-TO-DATE
:app:generateDebugResources
:app:mergeDebugResources
:app:processDebugManifest
:app:processDebugResources
:app:generateDebugSources
:app:preDebugAndroidTestBuild UP-TO-DATE
:app:prepareDebugAndroidTestDependencies
:app:compileDebugAndroidTestAidl
:app:processDebugAndroidTestManifest
:app:compileDebugAndroidTestRenderscript
:app:generateDebugAndroidTestBuildConfig
:app:mergeDebugAndroidTestShaders
:app:compileDebugAndroidTestShaders
:app:generateDebugAndroidTestAssets
:app:mergeDebugAndroidTestAssets
:app:generateDebugAndroidTestResValues UP-TO-DATE
:app:generateDebugAndroidTestResources
:app:mergeDebugAndroidTestResources
:app:processDebugAndroidTestResources
:app:generateDebugAndroidTestSources
:app:mockableAndroidJar
:app:preDebugUnitTestBuild UP-TO-DATE
:app:prepareDebugUnitTestDependencies
BUILD SUCCESSFUL
Total time: 15.678 secs
Now I only want to clean the project, not to rebuild it. I've found one solution to do this by going into the Gradle Window and selecting clean manually but is there a better solution to do this because my solution feels like a hack.
Gradle Window Clean app screenshot And do you have any idea, why is Android Studio behaving like this?
This is the normal way Android studio clean projects. First they clean the project it has mentioned on the top of the Gradle Build message.
:clean
:app:clean
Related
I have just set up a new computer with Android Studio and imported my project from bitbucket.
Problem is that I am now getting this error when trying to build the project:
Information:Gradle tasks [:app:clean, :app:generateDebugSources,
:app:generateDebugAndroidTestSources, :app:mockableAndroidJar,
:app:prepareDebugUnitTestDependencies, :app:assembleDebug] :app:clean
:app:preBuild UP-TO-DATE :app:preDebugBuild UP-TO-DATE
:app:checkDebugManifest :app:preReleaseBuild UP-TO-DATE
:app:prepareChAcraAcra470Library
:app:prepareComAndroidSupportAnimatedVectorDrawable2420Library
:app:prepareComAndroidSupportAppcompatV72420Library
:app:prepareComAndroidSupportDesign2420Library
:app:prepareComAndroidSupportRecyclerviewV72420Library
:app:prepareComAndroidSupportSupportCompat2420Library
:app:prepareComAndroidSupportSupportCoreUi2420Library
:app:prepareComAndroidSupportSupportCoreUtils2420Library
:app:prepareComAndroidSupportSupportFragment2420Library
:app:prepareComAndroidSupportSupportMediaCompat2420Library
:app:prepareComAndroidSupportSupportV132420Library
:app:prepareComAndroidSupportSupportV42420Library
:app:prepareComAndroidSupportSupportVectorDrawable2420Library
:app:prepareComGoogleAndroidGmsPlayServicesBase940Library
:app:prepareComGoogleAndroidGmsPlayServicesBasement940Library
:app:prepareComGoogleAndroidGmsPlayServicesTasks940Library
:app:prepareComGoogleAndroidGmsPlayServicesVision940Library
:app:prepareComJourneyappsZxingAndroidEmbedded320Library
:app:prepareDebugDependencies :app:compileDebugAidl
:app:compileDebugRenderscript :app:generateDebugBuildConfig
:app:mergeDebugShaders :app:compileDebugShaders
:app:generateDebugAssets :app:mergeDebugAssets
:app:generateDebugResValues UP-TO-DATE :app:generateDebugResources
:app:mergeDebugResources :app:processDebugManifest
:app:processDebugResources :app:generateDebugSources
:app:preDebugAndroidTestBuild UP-TO-DATE
:app:prepareDebugAndroidTestDependencies
:app:compileDebugAndroidTestAidl :app:processDebugAndroidTestManifest
:app:compileDebugAndroidTestRenderscript
:app:generateDebugAndroidTestBuildConfig
:app:mergeDebugAndroidTestShaders :app:compileDebugAndroidTestShaders
:app:generateDebugAndroidTestAssets :app:mergeDebugAndroidTestAssets
:app:generateDebugAndroidTestResValues UP-TO-DATE
:app:generateDebugAndroidTestResources
:app:mergeDebugAndroidTestResources
:app:processDebugAndroidTestResources
:app:generateDebugAndroidTestSources :app:mockableAndroidJar
UP-TO-DATE :app:preDebugUnitTestBuild UP-TO-DATE
:app:prepareDebugUnitTestDependencies
:app:incrementalDebugJavaCompilationSafeguard
:app:compileDebugJavaWithJavac :app:compileDebugJavaWithJavac - is not
incremental (e.g. outputs have changed, no previous execution, etc.).
Note: Some input files use or override a deprecated API. Note:
Recompile with -Xlint:deprecation for details. Note: Some input files
use unchecked or unsafe operations. Note: Recompile with
-Xlint:unchecked for details. :app:compileDebugNdk UP-TO-DATE :app:compileDebugSources :app:buildInfoDebugLoader
:app:transformClassesWithExtractJarsForDebug
:app:transformClassesWithInstantRunVerifierForDebug
:app:transformClassesWithJavaResourcesVerifierForDebug UP-TO-DATE
:app:mergeDebugJniLibFolders
:app:transformNative_libsWithMergeJniLibsForDebug
:app:processDebugJavaRes UP-TO-DATE
:app:transformResourcesWithMergeJavaResForDebug
:app:transformResourcesAndNative_libsWithJavaResourcesVerifierForDebug
UP-TO-DATE :app:transformClassesWithInstantRunForDebug
:app:transformClasses_enhancedWithInstant+reloadDexForDebug UP-TO-DATE
:app:incrementalDebugTasks :app:prePackageMarkerForDebug
:app:fastDeployDebugExtractor :app:generateDebugInstantRunAppInfo
:app:coldswapKickerDebug
:app:transformClassesWithInstantRunSlicerForDebug
:app:transformClassesWithDexForDebug Error:Uncaught translation error:
com.android.dx.cf.code.SimException: local 0001: invalid Error:1
error; aborting Error:Execution failed for task
':app:transformClassesWithDexForDebug'.
com.android.build.api.transform.TransformException: java.lang.RuntimeException:
com.android.ide.common.process.ProcessException:
java.util.concurrent.ExecutionException:
com.android.ide.common.process.ProcessException: Return code 1 for dex
process Information:BUILD FAILED Information:Total time: 1 mins 38.347
secs Information:3 errors Information:0 warnings Information:See
complete output in console
And here is the output from the Gradle Console window:
Executing tasks: [:app:clean, :app:generateDebugSources,
:app:generateDebugAndroidTestSources, :app:mockableAndroidJar,
:app:prepareDebugUnitTestDependencies, :app:assembleDebug]
Configuration on demand is an incubating feature. Incremental java
compilation is an incubating feature. :app:clean :app:preBuild
UP-TO-DATE :app:preDebugBuild UP-TO-DATE :app:checkDebugManifest
:app:preReleaseBuild UP-TO-DATE :app:prepareChAcraAcra470Library
:app:prepareComAndroidSupportAnimatedVectorDrawable2420Library
:app:prepareComAndroidSupportAppcompatV72420Library
:app:prepareComAndroidSupportDesign2420Library
:app:prepareComAndroidSupportRecyclerviewV72420Library
:app:prepareComAndroidSupportSupportCompat2420Library
:app:prepareComAndroidSupportSupportCoreUi2420Library
:app:prepareComAndroidSupportSupportCoreUtils2420Library
:app:prepareComAndroidSupportSupportFragment2420Library
:app:prepareComAndroidSupportSupportMediaCompat2420Library
:app:prepareComAndroidSupportSupportV132420Library
:app:prepareComAndroidSupportSupportV42420Library
:app:prepareComAndroidSupportSupportVectorDrawable2420Library
:app:prepareComGoogleAndroidGmsPlayServicesBase940Library
:app:prepareComGoogleAndroidGmsPlayServicesBasement940Library
:app:prepareComGoogleAndroidGmsPlayServicesTasks940Library
:app:prepareComGoogleAndroidGmsPlayServicesVision940Library
:app:prepareComJourneyappsZxingAndroidEmbedded320Library
:app:prepareDebugDependencies :app:compileDebugAidl
:app:compileDebugRenderscript :app:generateDebugBuildConfig
:app:mergeDebugShaders :app:compileDebugShaders
:app:generateDebugAssets :app:mergeDebugAssets
:app:generateDebugResValues UP-TO-DATE :app:generateDebugResources
:app:mergeDebugResources :app:processDebugManifest
:app:processDebugResources :app:generateDebugSources
:app:preDebugAndroidTestBuild UP-TO-DATE
:app:prepareDebugAndroidTestDependencies
:app:compileDebugAndroidTestAidl :app:processDebugAndroidTestManifest
:app:compileDebugAndroidTestRenderscript
:app:generateDebugAndroidTestBuildConfig
:app:mergeDebugAndroidTestShaders :app:compileDebugAndroidTestShaders
:app:generateDebugAndroidTestAssets :app:mergeDebugAndroidTestAssets
:app:generateDebugAndroidTestResValues UP-TO-DATE
:app:generateDebugAndroidTestResources
:app:mergeDebugAndroidTestResources
:app:processDebugAndroidTestResources
:app:generateDebugAndroidTestSources :app:mockableAndroidJar
UP-TO-DATE :app:preDebugUnitTestBuild UP-TO-DATE
:app:prepareDebugUnitTestDependencies
:app:incrementalDebugJavaCompilationSafeguard
:app:compileDebugJavaWithJavac :app:compileDebugJavaWithJavac - is not
incremental (e.g. outputs have changed, no previous execution, etc.).
Note: Some input files use or override a deprecated API. Note:
Recompile with -Xlint:deprecation for details. Note: Some input files
use unchecked or unsafe operations. Note: Recompile with
-Xlint:unchecked for details.
:app:compileDebugNdk UP-TO-DATE :app:compileDebugSources
:app:buildInfoDebugLoader :app:transformClassesWithExtractJarsForDebug
:app:transformClassesWithInstantRunVerifierForDebug
:app:transformClassesWithJavaResourcesVerifierForDebug UP-TO-DATE
:app:mergeDebugJniLibFolders
:app:transformNative_libsWithMergeJniLibsForDebug
:app:processDebugJavaRes UP-TO-DATE
:app:transformResourcesWithMergeJavaResForDebug
:app:transformResourcesAndNative_libsWithJavaResourcesVerifierForDebug
UP-TO-DATE :app:transformClassesWithInstantRunForDebug
:app:transformClasses_enhancedWithInstant+reloadDexForDebug UP-TO-DATE
:app:incrementalDebugTasks :app:prePackageMarkerForDebug
:app:fastDeployDebugExtractor :app:generateDebugInstantRunAppInfo
:app:coldswapKickerDebug
:app:transformClassesWithInstantRunSlicerForDebug
:app:transformClassesWithDexForDebug AGPBI:
{"kind":"error","text":"Uncaught translation error:
com.android.dx.cf.code.SimException: local 0001:
invalid","sources":[{}]} AGPBI: {"kind":"error","text":"1 error;
aborting","sources":[{}]}
FAILED
FAILURE: Build failed with an exception.
What went wrong: Execution failed for task ':app:transformClassesWithDexForDebug'.
com.android.build.api.transform.TransformException: java.lang.RuntimeException:
com.android.ide.common.process.ProcessException:
java.util.concurrent.ExecutionException:
com.android.ide.common.process.ProcessException: Return code 1 for dex
process
Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
To investigate, I have created the Camera2Basic sample project that comes with Android Studio and that builds fine, so maybe this is a problem with a setting within my project rather than a general configuration/setup problem?
What I've already tried (with no luck):
Added org.gradle.jvmargs=-Xmx2048m to my gradle.properties file.
Setting minifyEnabled false in my app build.gradle file (in the release and in the debug blocks).
This suggestion.
File > Invalidate Cahces / Restart...
NB - Similar question here - but with a different error number and, currently, no answers.
Update:
Having removed a third party library (nxpnfclib.jar) from my app, my project now builds and runs fine. But if I then try re-adding the jar, the problem comes back.
Update #2:
I have created one of the sample Android Studio projects (Camera2Basic) and added the nxpnfclib.jar library. The same problem occurs. So this is clearly a problem with the nxpnfclib.jar library. (I have, today, emailed NXP about this latest issue with their library, so I will update this page with their solution - unless they update it, of course.)
I am using:
Windows 7 (64-bit)
Android Studio v2.1.3 (as a fresh install)
JDK 1.8.0_102
Gradle version 2.14.1
Android plugin version 2.1.3
This what I did to fix in my scenario:
At the project level on android studio updated the build.gradle like this:
buildscript {
ext.kotlin_version = '1.2.31
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.0'
}
Then on the gradle-wrapper.properties this:
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip
Executing tasks: [:app:clean, :app:generateDebugSources,
:app:generateDebugAndroidTestSources,
:app:prepareDebugUnitTestDependencies, :app:mockableAndroidJar,
:app:assembleDebug]
Parallel execution with configuration on demand is an incubating
feature. Incremental java compilation is an incubating feature.
:app:clean :app:preBuild UP-TO-DATE :app:preDebugBuild UP-TO-DATE
:app:checkDebugManifest :app:preReleaseBuild UP-TO-DATE
:app:prepareAsiaIvityAndroidMarqueeview115Library
:app:prepareComAndraskindlerParallaxviewpagerParallaxviewpager031Library
:app:prepareComAndroidSupportAnimatedVectorDrawable2321Library
:app:prepareComAndroidSupportAppcompatV72321Library
:app:prepareComAndroidSupportMultidex101Library
:app:prepareComAndroidSupportRecyclerviewV72321Library
:app:prepareComAndroidSupportSupportV42321Library
:app:prepareComAndroidSupportSupportVectorDrawable2321Library
:app:prepareComGithubTecheryProgresshintLibrary023Library
:app:prepareComGithubTecheryProgresshintLibraryAddition023Library
:app:prepareComH6ah4iAndroidWidgetVerticalseekbarVerticalseekbar051Library
:app:prepareComOgaclejapanSmarttablayoutLibrary160Library
:app:prepareComToxicBakeryViewpagerTransformsViewPagerTransforms1232Library
:app:prepareDebugDependencies :app:compileDebugAidl
:app:compileDebugRenderscript :app:generateDebugBuildConfig
:app:mergeDebugShaders :app:compileDebugShaders
:app:generateDebugAssets :app:mergeDebugAssets
:app:generateDebugResValues UP-TO-DATE :app:generateDebugResources
:app:mergeDebugResources :app:processDebugManifest
:app:processDebugResources :app:generateDebugSources
:app:preDebugAndroidTestBuild UP-TO-DATE
:app:prepareComAndroidSupportMultidexInstrumentation101Library
:app:prepareDebugAndroidTestDependencies
:app:compileDebugAndroidTestAidl :app:processDebugAndroidTestManifest
:app:compileDebugAndroidTestRenderscript
:app:generateDebugAndroidTestBuildConfig
:app:mergeDebugAndroidTestShaders :app:compileDebugAndroidTestShaders
:app:generateDebugAndroidTestAssets :app:mergeDebugAndroidTestAssets
:app:generateDebugAndroidTestResValues UP-TO-DATE
:app:generateDebugAndroidTestResources
:app:mergeDebugAndroidTestResources
:app:processDebugAndroidTestResources
:app:generateDebugAndroidTestSources :app:preDebugUnitTestBuild
UP-TO-DATE :app:prepareDebugUnitTestDependencies
:app:mockableAndroidJar UP-TO-DATE
:app:incrementalDebugJavaCompilationSafeguard
:app:compileDebugJavaWithJavac :app:compileDebugJavaWithJavac - is not
incremental (e.g. outputs have changed, no previous execution, etc.).
Note: Some input files use or override a deprecated API. Note:
Recompile with -Xlint:deprecation for details.
:app:compileDebugNdk UP-TO-DATE :app:compileDebugSources
:app:buildInfoDebugLoader :app:transformClassesWithExtractJarsForDebug
:app:transformClassesWithInstantRunVerifierForDebug
:app:transformClassesWithJavaResourcesVerifierForDebug UP-TO-DATE
:app:mergeDebugJniLibFolders
:app:transformNative_libsWithMergeJniLibsForDebug
:app:processDebugJavaRes UP-TO-DATE
:app:transformResourcesWithMergeJavaResForDebug
:app:transformResourcesAndNative_libsWithJavaResourcesVerifierForDebug
UP-TO-DATE :app:transformClassesWithInstantRunForDebug
:app:transformClasses_enhancedWithInstant+reloadDexForDebug
:app:incrementalDebugTasks :app:prePackageMarkerForDebug
:app:fastDeployDebugExtractor :app:generateDebugInstantRunAppInfo
:app:coldswapKickerDebug
:app:transformClassesWithInstantRunSlicerForDebug
:app:transformClassesWithDexForDebug To run dex in process, the Gradle
daemon needs a larger heap. It currently has approximately 11833 MB.
For faster builds, increase the maximum heap size for the Gradle
daemon to more than 13312 MB. To do this set
org.gradle.jvmargs=-Xmx13312M in the project gradle.properties. For
more information see
https://docs.gradle.org/current/userguide/build_environment.html
:app:validateDebugSigning :app:packageDebug :app:zipalignDebug
:app:fullDebugBuildInfoGenerator :app:assembleDebug
BUILD SUCCESSFUL
Total time: 7 mins 41.523 secs
The default Gradle Daemon VM memory allocation is 1 gigabyte — which is insufficient to support dexInProcess, so to take advantage you’ll need to set it to at least 2 gigabytes.
One thing you could do to speed up your builds is to increase the Gradle Daemon VM memory allocation.
In gradle.properties add the line org.gradle.jvmargs=-Xmx2048m.
Good read about Android Studio 2.1 feature Dex In Process:
https://medium.com/google-developers/faster-android-studio-builds-with-dex-in-process-5988ed8aa37e?_utm_source=1-2-2#.g4ba8piij
And also check out the video:
https://www.youtube.com/watch?v=-SY5nkNVUn0
Make your gradle offline.
Goto File -> Settings search for gradle and checked offline work .
My problem is solved.It was taking time because i have ubuntu and i was opening and running my project from external ntfs hard drive.I reformatted it as ext4 and followed the post given in comment section by Amit Vaghela , which reduced the build time from 7 min to 2 sec.
This is the link given by 'Amit Vaghela':
Building and running app via Gradle and Android Studio is slower than via Eclipse
I recently upgraded my Android Studio from 1.5 to 2.0. My app would build and run nicely on Android 1.5. Now, when I try run the app on my smartphone, it gives me this error:
Error:Execution failed for task ':app:transformClassesWithInstantRunForDebug'.
> 24
When opening my project on Android Studio 2.0, a message box appeared, telling me to upgrade my gradle to version 2, which I did. I am not sure why I am getting this error.
Here is the output I get as I try to run the app on my phone:
Executing tasks: [clean, :app:generateDebugSources, :app:mockableAndroidJar, :app:prepareDebugUnitTestDependencies, :app:generateDebugAndroidTestSources, :app:compileDebugSources, :app:compileDebugUnitTestSources, :app:compileDebugAndroidTestSources]
Configuration on demand is an incubating feature.
Incremental java compilation is an incubating feature.
:clean UP-TO-DATE
:app:clean
:app:preBuild UP-TO-DATE
:app:preDebugBuild UP-TO-DATE
:app:checkDebugManifest
:app:preReleaseBuild UP-TO-DATE
:app:prepareComAndroidSupportAnimatedVectorDrawable2321Library
:app:prepareComAndroidSupportAppcompatV72321Library
:app:prepareComAndroidSupportCardviewV72321Library
:app:prepareComAndroidSupportDesign2321Library
:app:prepareComAndroidSupportMediarouterV72300Library
:app:prepareComAndroidSupportRecyclerviewV72321Library
:app:prepareComAndroidSupportSupportV42321Library
:app:prepareComAndroidSupportSupportVectorDrawable2321Library
:app:prepareComGoogleAndroidGmsPlayServices840Library
:app:prepareComGoogleAndroidGmsPlayServicesAds840Library
:app:prepareComGoogleAndroidGmsPlayServicesAnalytics840Library
:app:prepareComGoogleAndroidGmsPlayServicesAppindexing840Library
:app:prepareComGoogleAndroidGmsPlayServicesAppinvite840Library
:app:prepareComGoogleAndroidGmsPlayServicesAppstate840Library
:app:prepareComGoogleAndroidGmsPlayServicesAuth840Library
:app:prepareComGoogleAndroidGmsPlayServicesBase840Library
:app:prepareComGoogleAndroidGmsPlayServicesBasement840Library
:app:prepareComGoogleAndroidGmsPlayServicesCast840Library
:app:prepareComGoogleAndroidGmsPlayServicesDrive840Library
:app:prepareComGoogleAndroidGmsPlayServicesFitness840Library
:app:prepareComGoogleAndroidGmsPlayServicesGames840Library
:app:prepareComGoogleAndroidGmsPlayServicesGcm840Library
:app:prepareComGoogleAndroidGmsPlayServicesIdentity840Library
:app:prepareComGoogleAndroidGmsPlayServicesLocation840Library
:app:prepareComGoogleAndroidGmsPlayServicesMaps840Library
:app:prepareComGoogleAndroidGmsPlayServicesMeasurement840Library
:app:prepareComGoogleAndroidGmsPlayServicesNearby840Library
:app:prepareComGoogleAndroidGmsPlayServicesPanorama840Library
:app:prepareComGoogleAndroidGmsPlayServicesPlus840Library
:app:prepareComGoogleAndroidGmsPlayServicesSafetynet840Library
:app:prepareComGoogleAndroidGmsPlayServicesVision840Library
:app:prepareComGoogleAndroidGmsPlayServicesWallet840Library
:app:prepareComGoogleAndroidGmsPlayServicesWearable840Library
:app:prepareDebugDependencies
:app:compileDebugAidl
:app:compileDebugRenderscript
:app:generateDebugBuildConfig
:app:generateDebugAssets UP-TO-DATE
:app:mergeDebugAssets
:app:generateDebugResValues UP-TO-DATE
:app:generateDebugResources
:app:mergeDebugResources
:app:processDebugManifest
:app:processDebugResources
:app:generateDebugSources
:app:mockableAndroidJar
:app:preDebugUnitTestBuild UP-TO-DATE
:app:prepareDebugUnitTestDependencies
:app:preDebugAndroidTestBuild UP-TO-DATE
:app:prepareDebugAndroidTestDependencies
:app:compileDebugAndroidTestAidl
:app:processDebugAndroidTestManifest
:app:compileDebugAndroidTestRenderscript
:app:generateDebugAndroidTestBuildConfig
:app:generateDebugAndroidTestAssets UP-TO-DATE
:app:mergeDebugAndroidTestAssets
:app:generateDebugAndroidTestResValues UP-TO-DATE
:app:generateDebugAndroidTestResources
:app:mergeDebugAndroidTestResources
:app:processDebugAndroidTestResources
:app:generateDebugAndroidTestSources
:app:compileDebugJavaWithJavac
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
:app:compileDebugNdk UP-TO-DATE
:app:compileDebugSources
:app:compileDebugUnitTestJavaWithJavac
:app:processDebugJavaRes UP-TO-DATE
:app:processDebugUnitTestJavaRes UP-TO-DATE
:app:compileDebugUnitTestSources
:app:compileDebugAndroidTestJavaWithJavac
:app:compileDebugAndroidTestNdk UP-TO-DATE
:app:compileDebugAndroidTestSources
BUILD SUCCESSFUL
Total time: 1 mins 31.987 secs
Executing tasks: [:app:clean, :app:generateDebugSources, :app:mockableAndroidJar, :app:prepareDebugUnitTestDependencies, :app:generateDebugAndroidTestSources, :app:assembleDebug]
Configuration on demand is an incubating feature.
Incremental java compilation is an incubating feature.
:app:clean
:app:preBuild UP-TO-DATE
:app:preDebugBuild UP-TO-DATE
:app:checkDebugManifest
:app:preReleaseBuild UP-TO-DATE
:app:prepareComAndroidSupportAnimatedVectorDrawable2321Library
:app:prepareComAndroidSupportAppcompatV72321Library
:app:prepareComAndroidSupportCardviewV72321Library
:app:prepareComAndroidSupportDesign2321Library
:app:prepareComAndroidSupportMediarouterV72300Library
:app:prepareComAndroidSupportRecyclerviewV72321Library
:app:prepareComAndroidSupportSupportV42321Library
:app:prepareComAndroidSupportSupportVectorDrawable2321Library
:app:prepareComGoogleAndroidGmsPlayServices840Library
:app:prepareComGoogleAndroidGmsPlayServicesAds840Library
:app:prepareComGoogleAndroidGmsPlayServicesAnalytics840Library
:app:prepareComGoogleAndroidGmsPlayServicesAppindexing840Library
:app:prepareComGoogleAndroidGmsPlayServicesAppinvite840Library
:app:prepareComGoogleAndroidGmsPlayServicesAppstate840Library
:app:prepareComGoogleAndroidGmsPlayServicesAuth840Library
:app:prepareComGoogleAndroidGmsPlayServicesBase840Library
:app:prepareComGoogleAndroidGmsPlayServicesBasement840Library
:app:prepareComGoogleAndroidGmsPlayServicesCast840Library
:app:prepareComGoogleAndroidGmsPlayServicesDrive840Library
:app:prepareComGoogleAndroidGmsPlayServicesFitness840Library
:app:prepareComGoogleAndroidGmsPlayServicesGames840Library
:app:prepareComGoogleAndroidGmsPlayServicesGcm840Library
:app:prepareComGoogleAndroidGmsPlayServicesIdentity840Library
:app:prepareComGoogleAndroidGmsPlayServicesLocation840Library
:app:prepareComGoogleAndroidGmsPlayServicesMaps840Library
:app:prepareComGoogleAndroidGmsPlayServicesMeasurement840Library
:app:prepareComGoogleAndroidGmsPlayServicesNearby840Library
:app:prepareComGoogleAndroidGmsPlayServicesPanorama840Library
:app:prepareComGoogleAndroidGmsPlayServicesPlus840Library
:app:prepareComGoogleAndroidGmsPlayServicesSafetynet840Library
:app:prepareComGoogleAndroidGmsPlayServicesVision840Library
:app:prepareComGoogleAndroidGmsPlayServicesWallet840Library
:app:prepareComGoogleAndroidGmsPlayServicesWearable840Library
:app:prepareDebugDependencies
:app:compileDebugAidl
:app:compileDebugRenderscript
:app:generateDebugBuildConfig
:app:generateDebugAssets UP-TO-DATE
:app:mergeDebugAssets
:app:generateDebugResValues UP-TO-DATE
:app:generateDebugResources
:app:mergeDebugResources
:app:processDebugManifest
:app:processDebugResources
:app:generateDebugSources
:app:mockableAndroidJar UP-TO-DATE
:app:preDebugUnitTestBuild UP-TO-DATE
:app:prepareDebugUnitTestDependencies
:app:preDebugAndroidTestBuild UP-TO-DATE
:app:prepareDebugAndroidTestDependencies
:app:compileDebugAndroidTestAidl
:app:processDebugAndroidTestManifest
:app:compileDebugAndroidTestRenderscript
:app:generateDebugAndroidTestBuildConfig
:app:generateDebugAndroidTestAssets UP-TO-DATE
:app:mergeDebugAndroidTestAssets
:app:generateDebugAndroidTestResValues UP-TO-DATE
:app:generateDebugAndroidTestResources
:app:mergeDebugAndroidTestResources
:app:processDebugAndroidTestResources
:app:generateDebugAndroidTestSources
:app:compileDebugJavaWithJavac
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
:app:compileDebugNdk UP-TO-DATE
:app:compileDebugSources
:app:buildInfoDebugLoader
:app:transformClassesWithExtractJarsForDebug
:app:transformClassesWithInstantRunVerifierForDebug
:app:transformClassesWithJavaResourcesVerifierForDebug
:app:mergeDebugJniLibFolders
:app:transformNative_libsWithMergeJniLibsForDebug
:app:processDebugJavaRes UP-TO-DATE
:app:transformResourcesWithMergeJavaResForDebug
:app:transformResourcesAndNative_libsWithJavaResourcesVerifierForDebug UP-TO-DATE
:app:transformClassesWithInstantRunForDebug FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:transformClassesWithInstantRunForDebug'.
> 24
* Try:
Try to disable the Instant Run option in Android Studio 2.0
This is helped me.
try to uncheck the instant run on settings.. search instant on the settings and youll see it. or maybe you havemt changed the path of your gradle to the new one?
Have you ever seen a message box like below when you build your project with Android Studio 2.0 ?
If not , watch out for this window which will possibly appear when you build your project with studio 2.0 then update it. that will change your Gradle-plugin version to 'com.android.tools.build:gradle:2.0.0' and Gradle-wrapper to distributionUrl=https\://services.gradle.org/distributions/gradle-2.10-all.zip or you can do it yourself .
Visit this to know more .
Delete build dir
Don't disable Instant Run! It is useful. Instead, try deleting the contents of your build directory, and then rebuilding.
appName/build and/or appName/app/build
Alternatively, clean build
A less brute force option to try is to clean the build.
Build -> Clean Project or Build -> Rebuild Project
I have downloaded the Google services sample from here and when I try to run it following the steps about the JSON, then an error pops out. The problem is that the console and the log, shows nothing about this error.
It looks like this.
I have no idea what am I doing wrong but, after this, I can't try to run it again, because the Run button is disabled.
Any idea to solve this?
UPDATE: This is the log in the Gradle Console:
Configuration on demand is an incubating feature.
:app:preDebugBuild UP-TO-DATE
:app:checkDebugManifest
:app:preReleaseBuild UP-TO-DATE
:app:prepareComAndroidSupportAppcompatV72211Library UP-TO-DATE
:app:prepareComAndroidSupportMediarouterV72200Library UP-TO-DATE
:app:prepareComAndroidSupportSupportV42211Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServices750Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAds750Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAnalytics750Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAppindexing750Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAppinvite750Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAppstate750Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesBase750Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesCast750Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesDrive750Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesFitness750Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesGames750Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesGcm750Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesIdentity750Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesLocation750Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesMaps750Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesNearby750Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesPanorama750Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesPlus750Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesSafetynet750Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesWallet750Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesWearable750Library 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:processDebugGoogleServices
No matching client found for package name 'gcm.play.android.samples.com.gcmquickstart'
:app:generateDebugResources
: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:compileDebugJavaWithJavac
:app:compileDebugNdk UP-TO-DATE
:app:compileDebugSources
:app:preDexDebug
:app:dexDebug
AGPBI: {"kind":"simple","text":"Picked up JAVA_TOOL_OPTIONS: -javaagent:/usr/share/java/jayatanaag.jar ","sources":[{}]}
:app:validateDebugSigning
:app:packageDebug
:app:zipalignDebug
:app:assembleDebug
BUILD SUCCESSFUL
Total time: 19.379 secs
This works for me:
In build.gradle(app) I have
applicationId "com.examples.Activities"
and in google-services.json I have
"package_name": "com.examples"
I changed
"package_name": "com.examples"
to
"package_name": "com.examples.Activities"
I was encountered the same problem.
How I solve it is to modify the file "build.gradle(Project: gcm)".
in file of build.gradle(Project: gcm)
buildscript {
...
dependencies {
classpath 'com.android.tools.build:gradle:2.0.0-alpha3'
classpath 'com.google.gms:google-services:1.3.0-beta1'// downgrade it version
}
}
Hope this would help you.
This must be because you are using different application id for different flavours.
I solved it by getting a google-services.json for my application ids.
For more details: google-services.json for different productFlavors
Official: https://developers.google.com/android/guides/google-services-plugin#adding_the_json_file
I am trying to integrated Facebook sign in to my application. If I added below lines to my build.gradle file for the application:
repositories {
mavenCentral()
}
in dependencies
compile 'com.facebook.android:facebook-android-sdk:4.2.0'
After that if I rebuild project it rebuilds it successfully. But when I try to run it takes long time to build and then shows dialog with text:
Failed to complete Gradle execution.
Casue:
Though the Message Gradle Build windows does not show any error. Here is the output of it
Information:Gradle tasks [:app:assembleDebug]
:app:preDebugBuild UP-TO-DATE
:app:checkDebugManifest
:app:preReleaseBuild UP-TO-DATE
:app:prepareComAndroidSupportAppcompatV72220Library UP-TO-DATE
:app:prepareComAndroidSupportDesign2220Library UP-TO-DATE
:app:prepareComAndroidSupportMediarouterV72200Library UP-TO-DATE
:app:prepareComAndroidSupportSupportV42220Library UP-TO-DATE
:app:prepareComFacebookAndroidFacebookAndroidSdk420Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServices750Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAds750Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAnalytics750Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAppindexing750Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAppinvite750Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesAppstate750Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesBase750Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesCast750Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesDrive750Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesFitness750Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesGames750Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesGcm750Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesIdentity750Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesLocation750Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesMaps750Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesNearby750Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesPanorama750Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesPlus750Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesSafetynet750Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesWallet750Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesWearable750Library UP-TO-DATE
:app:prepareTextvalidatorLibrary UP-TO-DATE
:app:prepareThreepioLibrary 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:processDebugGoogleServices
File google-services.json is missing from module root folder. The Google Quickstart Plugin cannot function without it.
:app:generateDebugResources
: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:compileDebugJavaWithJavac UP-TO-DATE
:app:compileDebugNdk UP-TO-DATE
:app:compileDebugSources UP-TO-DATE
:app:preDexDebug
:app:dexDebug
Information:0 errors
Information:0 warnings
Information:See complete output in console
I also modified the Gradle VM options as -XX:MaxHeapSize=256m -Xmx256m but still it gives the error.
If I remove the dependency it works fine. I am not sure why this happens.
Executing this command ./gradlew assembleDebug in my project directory showed the real culprit of the problem.
When I add facebook SDK dependency to my project it exceeds the limit of 64K methods in my dex file. Due to this the gradle build was failing.
I added multiDexEnabled = true into my build types in build.gradle file. And derive my custom application class from MultiDexApplication instead of Application.
This solved my issue.