gradles mustRunAfter doesnt seem to work - android

I defined a task in gradle:
task makePretty(type: Delete) {
println "Make it pretty!"
}
I want it to run after the android assemble and added this:
makePretty.mustRunAfter assemble
Unfortunally the task seems to be executed first everytime i start an gradle assemble.
me#my_mac: ~/sources/xxx-Android 🍊 ./gradlew assembleTest
Parallel execution is an incubating feature.
Make it pretty!
Gradle Tasks executed:
:MyProject:compileDebugNdk UP-TO-DATE
:MyProject:preBuild UP-TO-DATE
:MyProject:preDebugBuild UP-TO-DATE
:MyProject:preRcBuild UP-TO-DATE
:MyProject:preReleaseBuild UP-TO-DATE
:MyProject:preTestBuild UP-TO-DATE
:MyProject:prepareComAndroidSupportAppcompatV71901Library UP-TO-DATE
:MyProject:prepareDebugDependencies
:MyProject:compileDebugAidl UP-TO-DATE
:MyProject:compileDebugRenderscript UP-TO-DATE
:MyProject:generateDebugBuildConfig UP-TO-DATE
:MyProject:mergeDebugAssets UP-TO-DATE
:MyProject:mergeDebugResources UP-TO-DATE
:MyProject:processDebugManifest UP-TO-DATE
:MyProject:processDebugResources UP-TO-DATE
:MyProject:generateDebugSources UP-TO-DATE
:MyProject:compileDebugJava UP-TO-DATE
:MyProject:preDexDebug UP-TO-DATE
:MyProject:dexDebug UP-TO-DATE
:MyProject:processDebugJavaRes UP-TO-DATE
:MyProject:validateDebugSigning
:MyProject:packageDebug UP-TO-DATE
:MyProject:zipalignDebug UP-TO-DATE
:MyProject:assembleDebug UP-TO-DATE
My gradle wrapper is on version 1.9.
What am i doing wrong? Am I doing wrong? How can i fix it?

Looks like you're doing your println in the configuration lifecycle. Might be there's more of an expected behaviour if you slap on these '<<'

Related

Can Gradle build Instrumentation tests without running them?

TL:DR
I am looking for a way to make sure our Instrumentation testing suite compiles, but without actually running it. Is it possible to achieve that using the Android plugin for Gradle?
I looked over official documentation and I don't see anything other than a Gradle command that compiles and then runs tests together.
The reason I am looking for this is we want to be able to run a build on every Pull Request but running the suite takes way too long. Yet we want to make sure the instrumentation suite at least compiles with all the code changes so it can run in its time.
Thanks for your help
Can be achieved, gradle is running everything as task, I hope you are executing:
./gradlew test
and you can see output as
Incremental java compilation is an incubating feature.
:app:preBuild UP-TO-DATE
:app:preDebugBuild UP-TO-DATE
:app:checkDebugManifest
:app:preReleaseBuild UP-TO-DATE
:app:prepareComAndroidSupportAnimatedVectorDrawable2501Library
:app:prepareComAndroidSupportAppcompatV72501Library
:app:prepareComAndroidSupportDesign2501Library
:app:prepareComAndroidSupportRecyclerviewV72501Library
:app:prepareComAndroidSupportSupportCompat2501Library
:app:prepareComAndroidSupportSupportCoreUi2501Library
:app:prepareComAndroidSupportSupportCoreUtils2501Library
:app:prepareComAndroidSupportSupportFragment2501Library
:app:prepareComAndroidSupportSupportMediaCompat2501Library
:app:prepareComAndroidSupportSupportV42501Library
:app:prepareComAndroidSupportSupportVectorDrawable2501Library
:app:prepareComAndroidSupportTransition2501Library
:app:prepareDebugDependencies
:app:compileDebugAidl
:app:compileDebugRenderscript
:app:generateDebugBuildConfig
:app:generateDebugResValues
:app:generateDebugResources
:app:mergeDebugResources
:app:processDebugManifest
:app:processDebugResources
:app:generateDebugSources
:app:incrementalDebugJavaCompilationSafeguard
:app:compileDebugJavaWithJavac
:app:compileDebugJavaWithJavac - is not incremental (e.g. outputs have changed, no previous execution, etc.).
:app:incrementalDebugUnitTestJavaCompilationSafeguard UP-TO-DATE
:app:preDebugUnitTestBuild UP-TO-DATE
:app:prepareDebugUnitTestDependencies
:app:compileDebugUnitTestJavaWithJavac
:app:processDebugJavaRes UP-TO-DATE
:app:processDebugUnitTestJavaRes UP-TO-DATE
:app:compileDebugUnitTestSources
:app:mockableAndroidJar
:app:assembleDebugUnitTest
:app:testDebugUnitTest
:app:checkReleaseManifest
:app:prepareReleaseDependencies
:app:compileReleaseAidl
:app:compileReleaseRenderscript
:app:generateReleaseBuildConfig
:app:generateReleaseResValues
:app:generateReleaseResources
:app:mergeReleaseResources
:app:processReleaseManifest
:app:processReleaseResources
:app:generateReleaseSources
:app:incrementalReleaseJavaCompilationSafeguard
:app:compileReleaseJavaWithJavac
:app:compileReleaseJavaWithJavac - is not incremental (e.g. outputs have changed, no previous execution, etc.).
:app:incrementalReleaseUnitTestJavaCompilationSafeguard UP-TO-DATE
:app:preReleaseUnitTestBuild UP-TO-DATE
:app:prepareReleaseUnitTestDependencies
:app:compileReleaseUnitTestJavaWithJavac
:app:processReleaseJavaRes UP-TO-DATE
:app:processReleaseUnitTestJavaRes UP-TO-DATE
:app:compileReleaseUnitTestSources
:app:assembleReleaseUnitTest
:app:testReleaseUnitTest
:app:test
BUILD SUCCESSFUL
which is tasks call hierarchy, means task "test" is dependent on all or one above task i.e. "app:testReleaseUnitTest". so you can call upto "assembleReleaseUnitTest"
./gradlew assembleReleaseUnitTest
Found the Gradle task to achieve this:
$ ./gradlew compileDebugAndroidTestJavaWithJavac
Above task will compile Instrumented tests without actually running them.

Custom linting lib in android

My team and I develop Android apps and have decided on coding guidelines that all should follow. I therefore started implementing custom lint rules as per the following links:
Post written by Matt Compton
Git Repo
The problem that I'm having is actually implementing these lint rules on a project basis. When I run ./gradlew clean build test install , as specified the rules apply and all is well. However when I build the aar library with ./gradlew aarWrapper:assemble and add it to my libs folder the linting does not work.
I added the following to my build.gradle file to add the library
repositories {
flatDir {
dirs 'libs'
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile(name: 'aarWrapper-debug', ext: 'aar')
}
I'm not sure what I'm missing but when I run ./gradlew lint it runs the linter but not with my custom rules... Any help, tips or advice is greatly appreciated.
EDIT 1
Here is the terminal output when running gradle.
:app:preBuild UP-TO-DATE
:app:preDebugBuild UP-TO-DATE
:app:checkDebugManifest
:app:preReleaseBuild UP-TO-DATE
:app:prepareAarWrapperDebugLibrary UP-TO-DATE
:app:prepareComAndroidSupportAnimatedVectorDrawable2421Library UP-TO-DATE
:app:prepareComAndroidSupportAppcompatV72421Library UP-TO-DATE
:app:prepareComAndroidSupportDesign2421Library UP-TO-DATE
:app:prepareComAndroidSupportRecyclerviewV72421Library UP-TO-DATE
:app:prepareComAndroidSupportSupportCompat2421Library UP-TO-DATE
:app:prepareComAndroidSupportSupportCoreUi2421Library UP-TO-DATE
:app:prepareComAndroidSupportSupportCoreUtils2421Library UP-TO-DATE
:app:prepareComAndroidSupportSupportFragment2421Library UP-TO-DATE
:app:prepareComAndroidSupportSupportMediaCompat2421Library UP-TO-DATE
:app:prepareComAndroidSupportSupportV42421Library UP-TO-DATE
:app:prepareComAndroidSupportSupportVectorDrawable2421Library UP-TO-DATE
:app:prepareComAndroidVolleyVolley100Library UP-TO-DATE
:app:prepareComCrashlyticsSdkAndroidAnswers138Library UP-TO-DATE
:app:prepareComCrashlyticsSdkAndroidBeta121Library UP-TO-DATE
:app:prepareComCrashlyticsSdkAndroidCrashlytics261Library UP-TO-DATE
:app:prepareComCrashlyticsSdkAndroidCrashlyticsCore2310Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesBase961Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesBasement961Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesLocation961Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesMaps961Library UP-TO-DATE
:app:prepareComGoogleAndroidGmsPlayServicesTasks961Library UP-TO-DATE
:app:prepareIoFabricSdkAndroidFabric1312Library UP-TO-DATE
:app:prepareDebugDependencies
:app:compileDebugAidl UP-TO-DATE
:app:compileDebugRenderscript UP-TO-DATE
:app:generateDebugBuildConfig 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:incrementalDebugJavaCompilationSafeguard UP-TO-DATE
:app:compileDebugJavaWithJavac UP-TO-DATE
:app:compileDebugNdk UP-TO-DATE
:app:compileDebugSources UP-TO-DATE
:app:mergeDebugShaders UP-TO-DATE
:app:compileDebugShaders UP-TO-DATE
:app:generateDebugAssets UP-TO-DATE
:app:mergeDebugAssets 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:validateSigningDebug
:app:packageDebug
:app:assembleDebug
BUILD SUCCESSFUL
Total time: 7.881 secs
EDIT 2
Forked project: https://github.com/apertomove/linette
build.gradle: https://github.com/apertomove/linette/blob/apertomove-linette/build.gradle
EDIT 3
In addition to the links above I found this post written by Jason Atwood. We too have a CI server running jenkins in which we can run our checks and inform developers of errors based off of our lint rules. This works great, however, it is one step to far. It would be much more valuable and time save to run lint checks from the library when running our projects out of Android Studio, instead of committing our code only to find out that our project breaks rules.
I have written a post on how to add and integrate custom lint rules to your android app, you can have a look. It also has links to github repos showing how its done in an android project.
Link to post
The easiest way for me was to set ANDROID_LINT_JARS path in the gradlew file and point it to the custom lint jar which is checked in to VCS system, so that you can run it locally as well before pushing the code.
Hope it helps.
#hopeman copy the jar file to the /.android/lint folder. Android will pick your custom lint rules.

Observed package id 'add-ons;addon-google_apis-google-19' in inconsistent location

Today I wanted to generate an APK from my app but i got the following error:
Observed package id 'add-ons;addon-google_apis-google-19' in inconsistent location
Full error report:
Information:Gradle tasks [:MyApp:assembleRelease]
Observed package id 'add-ons;addon-google_apis-google-19' in inconsistent location 'C:\Users\MyUser\AppData\Local\Android\sdk\add-ons\addon-google_apis-google-19-1' (Expected 'C:\Users\MyUser\AppData\Local\Android\sdk\add-ons\addon-google_apis-google-19')
:MyApp:preBuild UP-TO-DATE
:MyApp:preReleaseBuild UP-TO-DATE
:MyApp:checkReleaseManifest
:MyApp:preDebugBuild UP-TO-DATE
:MyAppEssentialsLib:preBuild UP-TO-DATE
:MyAppEssentialsLib:preReleaseBuild UP-TO-DATE
:MyAppEssentialsLib:compileReleaseNdk UP-TO-DATE
:MyAppEssentialsLib:compileLint
:MyAppEssentialsLib:copyReleaseLint UP-TO-DATE
:MyAppEssentialsLib:checkReleaseManifest
:MyAppEssentialsLib:preDebugAndroidTestBuild UP-TO-DATE
:MyAppEssentialsLib:preDebugBuild UP-TO-DATE
:MyAppEssentialsLib:preDebugUnitTestBuild UP-TO-DATE
:MyAppEssentialsLib:preReleaseUnitTestBuild UP-TO-DATE
:MyAppEssentialsLib:prepareComAndroidSupportAnimatedVectorDrawable2330Library UP-TO-DATE
:MyAppEssentialsLib:prepareComAndroidSupportAppcompatV72330Library UP-TO-DATE
:MyAppEssentialsLib:prepareComAndroidSupportDesign2330Library UP-TO-DATE
:MyAppEssentialsLib:prepareComAndroidSupportRecyclerviewV72330Library UP-TO-DATE
:MyAppEssentialsLib:prepareComAndroidSupportSupportV132330Library UP-TO-DATE
:MyAppEssentialsLib:prepareComAndroidSupportSupportV42330Library UP-TO-DATE
:MyAppEssentialsLib:prepareComAndroidSupportSupportVectorDrawable2330Library UP-TO-DATE
:MyAppEssentialsLib:prepareComFacebookAndroidFacebookAndroidSdk460Library UP-TO-DATE
:MyAppEssentialsLib:prepareComGithubAfollestadMaterialDialogsCore0856Library UP-TO-DATE
:MyAppEssentialsLib:prepareComGithubJkwiecienEasyImage109Library UP-TO-DATE
:MyAppEssentialsLib:prepareComGoogleAndroidGmsPlayServicesBase840Library UP-TO-DATE
:MyAppEssentialsLib:prepareComGoogleAndroidGmsPlayServicesBasement840Library UP-TO-DATE
:MyAppEssentialsLib:prepareComGoogleAndroidGmsPlayServicesGcm840Library UP-TO-DATE
:MyAppEssentialsLib:prepareComGoogleAndroidGmsPlayServicesLocation840Library UP-TO-DATE
:MyAppEssentialsLib:prepareComGoogleAndroidGmsPlayServicesMaps840Library UP-TO-DATE
:MyAppEssentialsLib:prepareComGoogleAndroidGmsPlayServicesMeasurement840Library UP-TO-DATE
:MyAppEssentialsLib:prepareDeHdodenhofCircleimageview200Library UP-TO-DATE
:MyAppEssentialsLib:prepareMeZhanghaiAndroidMaterialprogressbarLibrary114Library UP-TO-DATE
:MyAppEssentialsLib:prepareReleaseDependencies
:MyAppEssentialsLib:compileReleaseAidl UP-TO-DATE
:MyAppEssentialsLib:compileReleaseRenderscript UP-TO-DATE
:MyAppEssentialsLib:generateReleaseBuildConfig UP-TO-DATE
:MyAppEssentialsLib:generateReleaseAssets UP-TO-DATE
:MyAppEssentialsLib:mergeReleaseAssets UP-TO-DATE
:MyAppEssentialsLib:generateReleaseResValues UP-TO-DATE
:MyAppEssentialsLib:generateReleaseResources UP-TO-DATE
:MyAppEssentialsLib:mergeReleaseResources UP-TO-DATE
:MyAppEssentialsLib:processReleaseManifest UP-TO-DATE
:MyAppEssentialsLib:processReleaseResources UP-TO-DATE
:MyAppEssentialsLib:generateReleaseSources UP-TO-DATE
:MyAppEssentialsLib:compileReleaseJavaWithJavac UP-TO-DATE
:MyAppEssentialsLib:extractReleaseAnnotations UP-TO-DATE
:MyAppEssentialsLib:mergeReleaseProguardFiles UP-TO-DATE
:MyAppEssentialsLib:packageReleaseRenderscript UP-TO-DATE
:MyAppEssentialsLib:packageReleaseResources UP-TO-DATE
:MyAppEssentialsLib:processReleaseJavaRes UP-TO-DATE
:MyAppEssentialsLib:transformResourcesWithMergeJavaResForRelease UP-TO-DATE
:MyAppEssentialsLib:transformClassesAndResourcesWithSyncLibJarsForRelease UP-TO-DATE
:MyAppEssentialsLib:mergeReleaseJniLibFolders UP-TO-DATE
:MyAppEssentialsLib:transformNative_libsWithMergeJniLibsForRelease UP-TO-DATE
:MyAppEssentialsLib:transformNative_libsWithSyncJniLibsForRelease UP-TO-DATE
:MyAppEssentialsLib:bundleRelease UP-TO-DATE
:MyApp:prepareComAndroidSupportAnimatedVectorDrawable2330Library UP-TO-DATE
:MyApp:prepareComAndroidSupportAppcompatV72330Library UP-TO-DATE
:MyApp:prepareComAndroidSupportDesign2330Library UP-TO-DATE
:MyApp:prepareComAndroidSupportRecyclerviewV72330Library UP-TO-DATE
:MyApp:prepareComAndroidSupportSupportV132330Library UP-TO-DATE
:MyApp:prepareComAndroidSupportSupportV42330Library UP-TO-DATE
:MyApp:prepareComAndroidSupportSupportVectorDrawable2330Library UP-TO-DATE
:MyApp:prepareComFacebookAndroidFacebookAndroidSdk460Library UP-TO-DATE
:MyApp:prepareComGithubAfollestadMaterialDialogsCore0856Library UP-TO-DATE
:MyApp:prepareComGithubJkwiecienEasyImage109Library UP-TO-DATE
:MyApp:prepareComGoogleAndroidGmsPlayServicesBase840Library UP-TO-DATE
:MyApp:prepareComGoogleAndroidGmsPlayServicesBasement840Library UP-TO-DATE
:MyApp:prepareComGoogleAndroidGmsPlayServicesGcm840Library UP-TO-DATE
:MyApp:prepareComGoogleAndroidGmsPlayServicesLocation840Library UP-TO-DATE
:MyApp:prepareComGoogleAndroidGmsPlayServicesMaps840Library UP-TO-DATE
:MyApp:prepareComGoogleAndroidGmsPlayServicesMeasurement840Library UP-TO-DATE
:MyApp:prepareDeHdodenhofCircleimageview200Library UP-TO-DATE
:MyApp:prepareMeZhanghaiAndroidMaterialprogressbarLibrary114Library UP-TO-DATE
:MyApp:prepareReleaseDependencies
:MyApp:compileReleaseAidl UP-TO-DATE
:MyApp:compileReleaseRenderscript UP-TO-DATE
:MyApp:generateReleaseBuildConfig UP-TO-DATE
:MyApp:generateReleaseAssets UP-TO-DATE
:MyApp:mergeReleaseAssets UP-TO-DATE
:MyApp:generateReleaseResValues UP-TO-DATE
:MyApp:processReleaseGoogleServices
:MyApp:generateReleaseResources
:MyApp:mergeReleaseResources UP-TO-DATE
:MyApp:processReleaseManifest UP-TO-DATE
:MyApp:processReleaseResources UP-TO-DATE
:MyApp:generateReleaseSources UP-TO-DATE
:MyApp:compileReleaseJavaWithJavac UP-TO-DATE
:MyApp:compileReleaseNdk UP-TO-DATE
:MyApp:compileReleaseSources UP-TO-DATE
:MyApp:lintVitalRelease
:MyApp:prePackageMarkerForRelease
:MyApp:transformClassesWithDexForRelease UP-TO-DATE
:MyApp:mergeReleaseJniLibFolders UP-TO-DATE
:MyApp:transformNative_libsWithMergeJniLibsForRelease UP-TO-DATE
:MyApp:processReleaseJavaRes UP-TO-DATE
:MyApp:transformResourcesWithMergeJavaResForRelease UP-TO-DATE
:MyApp:validateExternalOverrideSigning
:MyApp:packageRelease UP-TO-DATE
:MyApp:zipalignRelease
Unable to open 'C:\Users\MyApp-release.apk' as zip archive
Error:Execution failed for task ':MyApp:zipalignRelease'.
> Process 'command 'C:\Users\MyUser\AppData\Local\Android\sdk\build-tools\23.0.2\zipalign.exe'' finished with non-zero exit value 1
I only get this error if i want to build an APK, I can run my app in debug mode.
I have searched the interwebz bout didnt found any solution, only some google forums but not anything that I could use for solution.
Maybe the the apk generation is not failing because of this, but the message don't really contians any other issues, as far as I see.
Please advice me if you can.
This is caused by upgrading SDK which has some changes in package names. Since this is just a warning, it could safely be ignored.
Anyway, to remove the warning,remove all Android SDK Build Tools 19.x. It should only show Android SDK Buld Tools 19.1 afterward. Install that version
back, and you should be good to go.
Source: https://code.google.com/p/android/issues/detail?id=199518

Keep product flavors from effecting build times in Android Studio

My app currently has 5 different product flavors. The reasons aren't really that important are in my control, but essentially we need this many product flavors to target different testing servers that have different testing data.
prod {
applicationId "com.us.android"
}
stage {
applicationId "com.us.android.stage"
}
qa {
applicationId "com.us.android.qa"
}
dev {
applicationId "com.us.android.dev"
}
legacy {
applicationId "com.us.android.legacy"
}
The issue I'm running into is whenever I create a new build all of the product flavors are built. So for my project to build it takes about 50 seconds, if I were to comment out all, but the build I care about that time goes down to about 10 seconds. That said commenting them out is great if it were just me, but if I accidentally commit the commented out version, that's going to cause more problems when we try to build elsewhere.
My question is, is there is any clean way I can make it so that in the local development only the build I need is built, but I can still build the other branches as needed?
We are using Jenkins which, I figure seems like it could help us get these builds where we don't need to worry about them, but I'm not sure how.
Edit: Here are some logs, because that might help.
This is when we have all the product flavors but, the build variant set to stageDebug:
Executing tasks: [:us:assembleStageDebug]
Parallel execution with configuration on demand is an incubating feature.
:api:compileJava
:datePickerLibrary:compileLint
:us:preBuild UP-TO-DATE
:us:preStageDebugBuild UP-TO-DATE
:datePickerLibrary:copyReleaseLint UP-TO-DATE
:us:checkStageDebugManifest
:datePickerLibrary:preBuild UP-TO-DATE
:datePickerLibrary:preReleaseBuild UP-TO-DATE
:datePickerLibrary:checkReleaseManifest
:us:preDevDebugBuild UP-TO-DATE
:datePickerLibrary:preDebugAndroidTestBuild
:us:preDevReleaseBuild UP-TO-DATE
:datePickerLibrary:preDebugAndroidTestBuild UP-TO-DATE
:datePickerLibrary:preDebugBuild UP-TO-DATE
:us:preProdDebugBuild UP-TO-DATE
:datePickerLibrary:preDebugUnitTestBuild UP-TO-DATE
:us:preProdReleaseBuild UP-TO-DATE
:datePickerLibrary:preReleaseUnitTestBuild UP-TO-DATE
:us:preQaDebugBuild UP-TO-DATE
:datePickerLibrary:prepareComAndroidSupportSupportV132100Library
:us:preQaReleaseBuild UP-TO-DATE
:us:preStageReleaseBuild UP-TO-DATE
:us:prelegacyDebugBuild UP-TO-DATE
:us:prelegacyReleaseBuild UP-TO-DATE
:datePickerLibrary:prepareComAndroidSupportSupportV132100Library UP-TO-DATE
:datePickerLibrary:prepareComAndroidSupportSupportV42100Library
:us:generateStageDebugBuildConfig UP-TO-DATE
:datePickerLibrary:prepareReleaseDependencies UP-TO-DATE
:us:generateStageDebugResValues
:datePickerLibrary:compileReleaseAidl UP-TO-DATE
:api:processResources UP-TO-DATE
:datePickerLibrary:prepareComAndroidSupportSupportV42100Library UP-TO-DATE
:us:processStageDebugGoogleServices
File google-services.json is missing from module root folder. The Google Quickstart Plugin cannot function without it.
:api:classes
:us:generateStageDebugAssets UP-TO-DATE
:api:classes UP-TO-DATE
:api:compileJava UP-TO-DATE
:api:jar
:us:processStageDebugJavaRes UP-TO-DATE
:datePickerLibrary:compileReleaseRenderscript
:us:compileStageDebugNdk UP-TO-DATE
:us:newRelicInstrumentTask UP-TO-DATE
:datePickerLibrary:generateReleaseBuildConfig UP-TO-DATE
:datePickerLibrary:generateReleaseAssets UP-TO-DATE
:datePickerLibrary:mergeReleaseAssets UP-TO-DATE
:datePickerLibrary:compileReleaseRenderscript UP-TO-DATE
[newrelic.info] Detected cached instrumentation.
:datePickerLibrary:generateReleaseResValues UP-TO-DATE
:datePickerLibrary:generateReleaseResources UP-TO-DATE
:datePickerLibrary:mergeReleaseResources UP-TO-DATE
:datePickerLibrary:processReleaseManifest UP-TO-DATE
:datePickerLibrary:processReleaseResources UP-TO-DATE
:datePickerLibrary:generateReleaseSources UP-TO-DATE
:datePickerLibrary:processReleaseJavaRes UP-TO-DATE
:datePickerLibrary:compileReleaseJavaWithJavac UP-TO-DATE
:datePickerLibrary:extractReleaseAnnotations UP-TO-DATE
:datePickerLibrary:mergeReleaseProguardFiles UP-TO-DATE
:datePickerLibrary:packageReleaseJar UP-TO-DATE
:datePickerLibrary:compileReleaseNdk UP-TO-DATE
:datePickerLibrary:packageReleaseJniLibs UP-TO-DATE
:datePickerLibrary:packageReleaseLocalJar UP-TO-DATE
:datePickerLibrary:packageReleaseRenderscript UP-TO-DATE
:datePickerLibrary:packageReleaseResources
:api:jar UP-TO-DATE
:us:validateDebugSigning
:datePickerLibrary:bundleRelease
:us:validateDebugSigning UP-TO-DATE
:us:prepareAndroidClientDatePickerLibraryUnspecifiedLibrary UP-TO-DATE
:us:prepareComAndroidSupportAppcompatV72221Library UP-TO-DATE
:us:prepareComAndroidSupportCardviewV72221Library UP-TO-DATE
:us:prepareComAndroidSupportDesign2221Library UP-TO-DATE
:us:prepareComAndroidSupportMultidex101Library UP-TO-DATE
:us:prepareComAndroidSupportRecyclerviewV72221Library UP-TO-DATE
:us:prepareComAndroidSupportSupportV132221Library UP-TO-DATE
:us:prepareComAndroidSupportSupportV42301Library UP-TO-DATE
:us:prepareComFacebookAndroidFacebookAndroidSdk3230Library UP-TO-DATE
:us:prepareComGoogleAndroidGmsPlayServicesAnalytics750Library UP-TO-DATE
:us:prepareComGoogleAndroidGmsPlayServicesAppinvite750Library UP-TO-DATE
:us:prepareComGoogleAndroidGmsPlayServicesBase750Library UP-TO-DATE
:us:prepareComGoogleAndroidGmsPlayServicesGcm750Library UP-TO-DATE
:us:prepareComGoogleAndroidGmsPlayServicesLocation750Library UP-TO-DATE
:us:prepareComGoogleAndroidGmsPlayServicesMaps750Library UP-TO-DATE
:us:prepareComInstabugLibraryInstabugcore17Library UP-TO-DATE
:us:prepareComInstabugLibraryInstabugsupport17Library UP-TO-DATE
:us:prepareComMixpanelAndroidMixpanelAndroid462Library UP-TO-DATE
:us:prepareComRengwuxianMaterialedittextLibrary214Library UP-TO-DATE
:us:prepareComRoomoramaCaldroid220Library UP-TO-DATE
:us:prepareComZendeskSdk1322Library UP-TO-DATE
:us:prepareUkCoChrisjenxCalligraphy201Library UP-TO-DATE
:us:prepareStageDebugDependencies
:us:compileStageDebugAidl UP-TO-DATE
:us:compileStageDebugRenderscript UP-TO-DATE
:us:generateStageDebugResources
:us:mergeStageDebugResources UP-TO-DATE
:us:jrebelPinStageDebugResids UP-TO-DATE
:us:mergeStageDebugAssets UP-TO-DATE
:us:processStageDebugManifest UP-TO-DATE
:us:processStageDebugResources UP-TO-DATE
:us:generateStageDebugSources UP-TO-DATE
:us:compileStageDebugJavaWithJavac UP-TO-DATE
:us:compileStageDebugSources UP-TO-DATE
:us:generateStageDebugJrebelLayout
:us:preDexStageDebug UP-TO-DATE
:us:dexStageDebug UP-TO-DATE
:us:newRelicDeinstrumentTask
[newrelic.info] Deinstrumenting...
:us:jrebelPostProcessStageDebugResids UP-TO-DATE
:us:packageStageDebug UP-TO-DATE
:us:zipalignStageDebug UP-TO-DATE
:us:assembleStageDebug
BUILD SUCCESSFUL
Total time: 34.308 secs
This is when we only have the desired stage product flavor:
Executing tasks: [:urbansitter:assembleStageDebug]
Parallel execution with configuration on demand is an incubating feature.
:api:compileJava
:datePickerLibrary:compileLint
:us:preBuild UP-TO-DATE
:us:preStageDebugBuild UP-TO-DATE
:datePickerLibrary:copyReleaseLint
:us:checkStageDebugManifest UP-TO-DATE
:datePickerLibrary:preBuild UP-TO-DATE
:us:preStageReleaseBuild UP-TO-DATE
:datePickerLibrary:preReleaseBuild UP-TO-DATE
:us:generateStageDebugBuildConfig
:datePickerLibrary:checkReleaseManifest
:datePickerLibrary:preDebugAndroidTestBuild UP-TO-DATE
:datePickerLibrary:preDebugBuild UP-TO-DATE
:datePickerLibrary:preDebugUnitTestBuild UP-TO-DATE
:us:generateStageDebugResValues
:us:generateStageDebugBuildConfig UP-TO-DATE
:datePickerLibrary:preReleaseUnitTestBuild
:us:processStageDebugGoogleServices UP-TO-DATE
File google-services.json is missing from module root folder. The Google Quickstart Plugin cannot function without it.
:datePickerLibrary:prepareComAndroidSupportSupportV132100Library
:us:generateStageDebugAssets UP-TO-DATE
:us:processStageDebugJavaRes UP-TO-DATE
:datePickerLibrary:prepareComAndroidSupportSupportV132100Library UP-TO-DATE
:us:compileStageDebugNdk
:datePickerLibrary:prepareComAndroidSupportSupportV42100Library UP-TO-DATE
:us:newRelicInstrumentTask UP-TO-DATE
:us:compileStageDebugNdk UP-TO-DATE
:api:processResources UP-TO-DATE
[newrelic.info] Detected cached instrumentation.
:datePickerLibrary:prepareReleaseDependencies
:api:classes UP-TO-DATE
:api:jar
:datePickerLibrary:compileReleaseAidl UP-TO-DATE
:datePickerLibrary:compileReleaseRenderscript UP-TO-DATE
:datePickerLibrary:prepareReleaseDependencies UP-TO-DATE
:datePickerLibrary:generateReleaseBuildConfig UP-TO-DATE
:datePickerLibrary:generateReleaseAssets UP-TO-DATE
:datePickerLibrary:mergeReleaseAssets UP-TO-DATE
:datePickerLibrary:generateReleaseResValues UP-TO-DATE
:datePickerLibrary:generateReleaseResources UP-TO-DATE
:datePickerLibrary:mergeReleaseResources
:us:validateDebugSigning UP-TO-DATE
:datePickerLibrary:processReleaseManifest UP-TO-DATE
:datePickerLibrary:processReleaseResources UP-TO-DATE
:datePickerLibrary:generateReleaseSources UP-TO-DATE
:datePickerLibrary:processReleaseJavaRes UP-TO-DATE
:datePickerLibrary:compileReleaseJavaWithJavac UP-TO-DATE
:datePickerLibrary:extractReleaseAnnotations UP-TO-DATE
:datePickerLibrary:mergeReleaseProguardFiles UP-TO-DATE
:datePickerLibrary:packageReleaseJar UP-TO-DATE
:datePickerLibrary:compileReleaseNdk UP-TO-DATE
:datePickerLibrary:packageReleaseJniLibs UP-TO-DATE
:datePickerLibrary:packageReleaseLocalJar UP-TO-DATE
:datePickerLibrary:packageReleaseRenderscript UP-TO-DATE
:datePickerLibrary:packageReleaseResources UP-TO-DATE
:datePickerLibrary:bundleRelease UP-TO-DATE
:us:prepareAndroidClientDatePickerLibraryUnspecifiedLibrary UP-TO-DATE
:us:prepareComAndroidSupportAppcompatV72221Library UP-TO-DATE
:us:prepareComAndroidSupportCardviewV72221Library UP-TO-DATE
:us:prepareComAndroidSupportDesign2221Library UP-TO-DATE
:us:prepareComAndroidSupportMultidex101Library UP-TO-DATE
:us:prepareComAndroidSupportRecyclerviewV72221Library UP-TO-DATE
:us:prepareComAndroidSupportSupportV132221Library UP-TO-DATE
:us:prepareComAndroidSupportSupportV42301Library UP-TO-DATE
:us:prepareComFacebookAndroidFacebookAndroidSdk3230Library UP-TO-DATE
:us:prepareComGoogleAndroidGmsPlayServicesAnalytics750Library UP-TO-DATE
:us:prepareComGoogleAndroidGmsPlayServicesAppinvite750Library UP-TO-DATE
:us:prepareComGoogleAndroidGmsPlayServicesBase750Library UP-TO-DATE
:us:prepareComGoogleAndroidGmsPlayServicesGcm750Library UP-TO-DATE
:us:prepareComGoogleAndroidGmsPlayServicesLocation750Library UP-TO-DATE
:us:prepareComGoogleAndroidGmsPlayServicesMaps750Library UP-TO-DATE
:us:prepareComInstabugLibraryInstabugcore17Library UP-TO-DATE
:us:prepareComInstabugLibraryInstabugsupport17Library UP-TO-DATE
:us:prepareComMixpanelAndroidMixpanelAndroid462Library UP-TO-DATE
:us:prepareComRengwuxianMaterialedittextLibrary214Library UP-TO-DATE
:us:prepareComRoomoramaCaldroid220Library UP-TO-DATE
:us:prepareComZendeskSdk1322Library UP-TO-DATE
:us:prepareUkCoChrisjenxCalligraphy201Library UP-TO-DATE
:us:prepareStageDebugDependencies
:us:compileStageDebugAidl UP-TO-DATE
:us:compileStageDebugRenderscript UP-TO-DATE
:us:generateStageDebugResources
:us:mergeStageDebugResources UP-TO-DATE
:us:jrebelPinStageDebugResids UP-TO-DATE
:us:mergeStageDebugAssets UP-TO-DATE
:us:processStageDebugManifest UP-TO-DATE
:us:processStageDebugResources UP-TO-DATE
:us:generateStageDebugSources UP-TO-DATE
:us:compileStageDebugJavaWithJavac UP-TO-DATE
:us:compileStageDebugSources UP-TO-DATE
:us:generateStageDebugJrebelLayout
:us:preDexStageDebug UP-TO-DATE
:us:dexStageDebug UP-TO-DATE
:us:newRelicDeinstrumentTask
[newrelic.info] Deinstrumenting...
:us:jrebelPostProcessStageDebugResids UP-TO-DATE
:us:packageStageDebug UP-TO-DATE
:us:zipalignStageDebug UP-TO-DATE
:us:assembleStageDebug
BUILD SUCCESSFUL
Total time: 8.54 secs
I attached the build logs from both
By using assembleRelease it will build all flavor combinations. assemble will even build all 10 cominations, including all debug ones.
Now you don't specify how you build your project. In case of jenkins, assembleReleaseis probably the way to go, building all your combinations.
For your local builds, just use gradle assembleProdRelease or gradle assembleDevDebug to just build the needed flavor.
By specifying multiple targets you can just build a subset on jenkins, too. e.g.
gradle assembleDevRelease assembleProdRelease [...]
Also, Android Studio has a built-in support for selecting the flavor you want to build. By clicking on Build Variants you can select the variant you want to run with the default run configuration. To switch between flavors you would just select the one you need.

Android Studio Gradle :app:preDexDebug never finishes

I have an issue and despite of a lot of googling, i couldn't find any informations about it.
So I have Windows 7 and had Android Studio 1.1 RC Beta and after modifying my code regarding work with a database i got failure install_failed_dexopt
I tried to clean and then to rebuild my project and since that moment Gradle Executing Tasks never finishes if i run my project. I saw into the Gradle logs and here it is
Executing tasks:
[:app:assembleDebug]
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 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
I waited ~30 minutes and nothing after that.
If i try to stop it, it also never stops, i see only
Stopping - Gradle: Executing Tasks[:app:assembleDebug]
and nothing else
I tried to unistall Android Studio, installed also 1.0.1, I tried to run "hello world" application - is always the same. It would be great if someone have any idea about it, thank you!
So it seemed to be a problem with sdk. At first I didn't notice, that even if I install Android Studio and sdk into another folder path to sdk was always the same and it was something wrong with that sdk directorie.

Categories

Resources