1

I'm new to jenkins server and would like to ask some help and directions for this, I currently have an application that is working and building properly with firebase app distribution function it works locally and can distribute my app I followed their setup with this https://firebase.google.com/docs/app-distribution/android/distribute-gradle?authuser=0#authenticate_using_a_service_account.

The problem is I wanted to automate the distribution of my application in jenkins,I already successfully build an apk using jenkins but this error occured when i put the task appDistributionUpload on the Gradle Wrapper task.

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:appDistributionUploadAngelDebug'.
> Could not find credentials. To authenticate, you have a few options: 
  1. Set the `serviceCredentialsFile` property in your gradle plugin
  2. Set a refresh token with the FIREBASE_TOKEN environment variable
  3. Log in with the Firebase CLI
  4. Set service credentials with the GOOGLE_APPLICATION_CREDENTIALS environment variable

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 2m 57s
211 actionable tasks: 209 executed, 2 up-to-date
Build step 'Invoke Gradle script' changed build result to FAILURE
Build step 'Invoke Gradle script' marked build as failure
Archiving artifacts
Finished: FAILURE

Is there a way i can add the GOOGLE_APPLICATION_CREDENTIALS on my Gradle Wrapper or How I can Set service credentials on my enivironment variable? thanks

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
user3262438
  • 73
  • 1
  • 8

1 Answers1

1

So you probably didn't commit your App Distribution credentials file. Check your .gitignore file.

If you didn't commit the file, you did a good thing actually, because it is not recommended. However, you must provide this file anyway on your Jenkins environment.

You can write this file in an environment variable.

Josh
  • 1,316
  • 10
  • 26
  • Hi, Thanks for replying to my question, May I ask how can I write the file in the Environtment variable on jenkins? I tried the https://plugins.jenkins.io/envinject/ and https://plugins.jenkins.io/build-env-propagator/ to add my GOOGLE_APPLICATION_CREDENTIALS=$HOME/.jenkins/credkey.json but to no avail please help me. – user3262438 May 07 '20 at 05:05