Android deployment to Google Play store

android

#1

Hi,

I am unable to deploy to the play store. I have followed the docs and used the example play store plugin https://github.com/Triple-T/gradle-play-publisher#usage for deployment.

It works when I run the task from the command line and see the apk uploaded to the alpha channel.
The build runs fine and it is a green build but the deployment task in not triggered.

Any ideas will be helpful.

Thanks


#2

Is this a public project? If so can you paste the build URL?

Also keep in mind that if you are running the build via SSH (for debugging purposes) you will not be able to do the deployment phase. The Deployment phase is not run during SSH builds.


#3

I am sorry, it is not a public project. I am not running the build via SSH. The deployment phase is not run at all. It runs up till the test phase. Then gets the artifacts and stops .

This is my circle.yml-

general:
    artifacts:
        - /home/ubuntu/app/build/outputs/apk/

machine:
    environment:
        ANDROID_HOME: /usr/local/android-sdk-linux

dependencies:
  pre:
    - echo y | android update sdk --no-ui --all --filter "tools,platform-tools,android-23"
    - echo y | android update sdk --no-ui --all --filter "build-tools-23.0.2"

test:
    override:
       - ./gradlew build -x test -PpreDexEnable=false -Pcom.android.build.threadPoolSize=1 -Dorg.gradle.parallel=false -Dorg.gradle.jvmargs="-Xms512m -Xmx512m"

deployment:
    alpha:
        branch: develop
        commands:
           - ./gradlew publishApkProductionRelease

#4

Are you on this branch?


#5

A subdirectory in that branch. Is that the problem?
If so. How do I specify the directory in deployment?


#6

When you say branch:develop you are telling CircleCI to only run the deployments from that branch. So if you want to deploy from multiple branches you need to list them all.

Most people only deploy from a master branch (to production) and maybe a staging branch to staging, but you can certainly deploy from others.


#7

In the circle.yml , we can specify the build directory using the key ‘build_dir’. Can I do something similar for the deployment phase as well?


#8

Sorry for any confusion. This has nothing to do with the directories – this is regarding the name of the branch on GitHub.


#9

Ok, this the right branch I am trying to deploy from, I am still trying to figure it out. Since it was not deploying I was thinking that it may be because the project is not the root directory.


#10

No, that should not matter, as long as you are on the right branch (in this case develop) then ./gradlew publishApkProductionRelease should be running in the deployment phase. Does this run?


#11

No, it does not run in deployment phase. I don’t get any error or indication that it has run or failed. It runs on my local machine and deploys the apk.


#12

Can you give me the build URL


#13

@levlaz . Sure. Would I be able to send you a private message or email?


#14

You can just paste it here, since its not public nobody but CircleCI admins can see it.

Otherwise, feel free to PM me as well. :slight_smile:

Click on my username and select “Message”


#15

There you go… https://circleci.com/gh/honest/beauty-android/77 :slightly_smiling:


#16

So in that build the branch is called “develop” but the circle.yml says:

deployment:
    alpha:
        branch: beauty-android
        commands:
           - ./gradlew publishApkProductionRelease

Which translates to "only deploy when the branch is called “beauty-android”


#17

@levlaz I changed the branch name and it works now. Thanks for your help.


#18