Reputation: 12222
I have an android project. and it has 2 flavors whit names GooglePlay and Cafebazzar.
when using the Android Studio, I see assembleRelease and assembleCafeBazzar and assembleGooglePlay.
when I use ./gradlew -q tasks --all in jenkins, I Can't see assembleRelease in my tasks.
just I see assemble.
I use Jenkins to build the project. how can see assembleRelease in Jenkins?
+ ./gradlew -q tasks --all
------------------------------------------------------------
Tasks runnable from root project
------------------------------------------------------------
Android tasks
-------------
app:sourceSets - Prints out all the source sets defined in this project.
core:sourceSets - Prints out all the source sets defined in this project.
skeleton:sourceSets - Prints out all the source sets defined in this project.
Build tasks
-----------
app:assemble - Assembles all variants of all applications and secondary packages.
core:assemble - Assembles all variants of all applications and secondary packages.
skeleton:assemble - Assembles all variants of all applications and secondary packages.
app:assembleAndroidTest - Assembles all the Test applications.
core:assembleAndroidTest - Assembles all the Test applications.
skeleton:assembleAndroidTest - Assembles all the Test applications.
app:build - Assembles and tests this project.
core:build - Assembles and tests this project.
skeleton:build - Assembles and tests this project.
app:buildDependents - Assembles and tests this project and all projects that depend on it.
core:buildDependents - Assembles and tests this project and all projects that depend on it.
skeleton:buildDependents - Assembles and tests this project and all projects that depend on it.
app:buildNeeded - Assembles and tests this project and all projects it depends on.
core:buildNeeded - Assembles and tests this project and all projects it depends on.
skeleton:buildNeeded - Assembles and tests this project and all projects it depends on.
app:clean - Deletes the build directory.
core:clean - Deletes the build directory.
skeleton:clean - Deletes the build directory.
app:cleanBuildCache - Deletes the build cache directory.
core:cleanBuildCache - Deletes the build cache directory.
skeleton:cleanBuildCache - Deletes the build cache directory.
Upvotes: 2
Views: 3549
Reputation: 354
I have the same issue, when i check out my project "assembleRelease" is not available as a task. When i open the project in Android Studio and select "sync with gradle" there is some activity, afterwards i can execute "gradlew assembleRelease" from the command line.
I have no idea what exactly "sync with gradle" does. It seems there was a command that did something similar once, but it seems to be no longer available.
Edit: It seems that the file local.properties is created by running "sync with gradle files". I created a sample to reproduce the issue in googles issuetracker and it seems that this file makes the difference between assembleRelease being available or not.
Edit2: Fastlane is now running, i copy the local.properties file into the build directory during the setup. According to a comment on my similar question Gradle task assembleRelease not found in CI build, works with Android Studio it is because ANDROID_HOME is not set.
Upvotes: 1