question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Plugin with id 'com.google.gms.google-services' not found.

See original GitHub issue

Hi there. I am attempting to build my Android project through GitLab CI/CD. It builds fine on Windows but not on this Linux image. Specifically, I receive this error:

FAILURE: Build failed with an exception.

* Where:
Script '/builds/project/frontend/node_modules/nativescript-plugin-firebase/platforms/android/include.gradle' line: 95

* What went wrong:
A problem occurred evaluating script.
> Plugin with id 'com.google.gms.google-services' not found.

Here is the configuration I am using:

frontend_android_build:
  stage: build
  image: node:10
  variables:
    ANDROID_COMPILE_SDK: "28"
    ANDROID_BUILD_TOOLS: "28.0.3"
    ANDROID_SDK_TOOLS:   "4333796"  
  before_script:
    - apt-get --quiet update --yes
    - apt-get --quiet install --yes wget tar unzip g++ lib32stdc++6 lib32z1 lib32ncurses5
    - apt-get --quiet install --yes openjdk-8-jdk 
    - wget --quiet --output-document=android-sdk.zip https://dl.google.com/android/repository/sdk-tools-linux-${ANDROID_SDK_TOOLS}.zip
    - unzip -d android-sdk-linux android-sdk.zip
    - android-sdk-linux/tools/bin/sdkmanager --update
    - echo y | android-sdk-linux/tools/bin/sdkmanager "tools" >/dev/null
    - echo y | android-sdk-linux/tools/bin/sdkmanager "platform-tools" >/dev/null
    - echo y | android-sdk-linux/tools/bin/sdkmanager "platforms;android-${ANDROID_COMPILE_SDK}" >/dev/null
    - echo y | android-sdk-linux/tools/bin/sdkmanager "build-tools;${ANDROID_BUILD_TOOLS}" >/dev/null
    - echo y | android-sdk-linux/tools/bin/sdkmanager "extras;android;m2repository" >/dev/null
    - echo y | android-sdk-linux/tools/bin/sdkmanager "extras;google;m2repository" >/dev/null
    - export ANDROID_HOME=$PWD/android-sdk-linux
    - export PATH=$PATH:$PWD/android-sdk-linux/platform-tools/
    # temporarily disable checking for EPIPE error and use yes to accept all licenses
    - set +o pipefail
    - yes | android-sdk-linux/tools/bin/sdkmanager --licenses > /dev/null
    - set -o pipefail
    - npm install nativescript -g --unsafe-perm
    - tns doctor
  script:
    - cd frontend
    - tns install
    - tns build android

I know that my CI configuration is not the responsibility or problem of the maintainers of this repository, I am just looking for help if anyone is able to offer it. I appreciate any help at all.

I am slowly narrowing down the issue and have noticed the following difference between the working and non-working builds:

Working:

Project successfully prepared (android)

Configure firebase

Copy D:\...\project\frontend\App_Resources\Android\google-services.json to D:\...\project\frontend\platforms\android\app\google-services.json.

Building project...

Non-Working:

Project successfully prepared (android)
Building project...

The “Configure firebase” and copying of google-services.json just never seems to happen. I imagine this has something to do with gradle and post-install scripts.

Full build logs:

$ tns doctor
No issues were detected.
Your ANDROID_HOME environment variable is set and points to correct directory.
Your adb from the Android SDK is correctly installed.
The Android SDK is installed.
A compatible Android SDK for compilation is found.
Javac is installed and is configured properly.
The Java Development Kit (JDK) is installed and is configured properly.
Local builds for iOS can be executed only on a macOS system. To build for iOS on a different operating system, you can use the NativeScript cloud infrastructure.
Component nativescript has 6.3.3 version and is up to date.
$ cd frontend
$ tns install
Copying template files...
Platform ios successfully added. v6.2.0
Copying template files...
Platform android successfully added. v6.1.2
$ tns build android
Preparing project...
Hash: fbb1865cc07704f795a3
Version: webpack 4.30.0
Time: 15030ms
Built at: 01/20/2020 11:59:48 PM
              Asset       Size   Chunks             Chunk Names
          bundle.js    269 KiB   bundle  [emitted]  bundle
       package.json  112 bytes           [emitted]  
         runtime.js   13.9 KiB  runtime  [emitted]  runtime
tns-java-classes.js    0 bytes           [emitted]  
          vendor.js   18.3 MiB   vendor  [emitted]  vendor
Entrypoint bundle = runtime.js vendor.js bundle.js
[../$$_lazy_route_resource lazy recursive] ../$$_lazy_route_resource lazy namespace object 160 bytes {bundle} [built]
[./app.scss] 20 KiB {bundle} [built]
[./app/app-routing.module.tns.ts] 1.07 KiB {bundle} [built]
[./app/app.component.html] 819 bytes {bundle} [built]
[./app/app.component.tns.ts] 3.2 KiB {bundle} [built]
[./app/app.module.tns.ts] 2.78 KiB {bundle} [built]
...
[./main.tns.ts] 1.99 KiB {bundle} [built]
    + 639 hidden modules

Webpack compilation complete.
Downloading https://services.gradle.org/distributions/gradle-5.4.1-bin.zip
..................................................
Unzipping /root/.gradle/wrapper/dists/gradle-5.4.1-bin/e75iq110yv9r9wt1a6619x2xm/gradle-5.4.1-bin.zip to /root/.gradle/wrapper/dists/gradle-5.4.1-bin/e75iq110yv9r9wt1a6619x2xm
Set executable permissions for: /root/.gradle/wrapper/dists/gradle-5.4.1-bin/e75iq110yv9r9wt1a6619x2xm/gradle-5.4.1/bin/gradle
Built aar for nativescript-plugin-firebase
Project successfully prepared (android)
Building project...
Gradle build...
Downloading https://services.gradle.org/distributions/gradle-5.4.1-all.zip
..................................................
Unzipping /root/.gradle/wrapper/dists/gradle-5.4.1-all/3221gyojl5jsh0helicew7rwx/gradle-5.4.1-all.zip to /root/.gradle/wrapper/dists/gradle-5.4.1-all/3221gyojl5jsh0helicew7rwx
Set executable permissions for: /root/.gradle/wrapper/dists/gradle-5.4.1-all/3221gyojl5jsh0helicew7rwx/gradle-5.4.1/bin/gradle
	 + setting applicationId

FAILURE: Build failed with an exception.

* Where:
Script '/builds/project/frontend/node_modules/nativescript-plugin-firebase/platforms/android/include.gradle' line: 95

* What went wrong:
A problem occurred evaluating script.
> Plugin with id 'com.google.gms.google-services' not found.

* 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 37s
Command ./gradlew failed with exit code 1
ERROR: Job failed: exit code 1

Unfortunately I cannot provide my repo source code since this is for a school project and is closed source until I graduate; however I can provide any configurations needed. Like I said though, it builds just fine and runs fine on Windows, and MacOS too. This seems like a Linux/Docker problem. Thanks for any advice!

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5

github_iconTop GitHub Comments

2reactions
jasonhiscommented, Feb 11, 2020

#278 This is old issue.

Remove node_modules and platform.

yarn install
tns build android
1reaction
MitchTalmadgecommented, Mar 10, 2020

I solved this by adding the following line to my configuration, after npm install and before tns install:

(cd node_modules/nativescript-plugin-firebase && npm run setup)

Basically you navigate into the nativescript-plugin-firebase directory created during npm install and then run the setup script manually.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Plugin with id 'com.google.gms.google-services' not found
Had the same problem. Fixed by adding the dependency classpath 'com.google.gms:google-services:3.0.0'. to the root build.gradle .
Read more >
Plugin with id 'com.google.gms.google-services' not found.
My issue is identical to #278 but that was 5 years ago so maybe its different. I did try the things mentioned in...
Read more >
Plugin with id 'com google gms google services' not found
error with Plugin with id ' com google gms google services ' not found in android studio-~-~~-~~~-~~-~-Please watch: "ዳኘ ዋለ ለብልበው ...
Read more >
Plugin with id 'com.google.gms.google-services' not found
Android : Plugin with id ' com.google.gms.google-services ' not found [ Beautify Your Computer : https://www.hows.tech/p/recommended.html ] ...
Read more >
Failed to sync project with apply plugin: 'com.google.gms ...
Failed to sync project with apply plugin: 'com.google.gms.google-services' ... be using a third-party plugin which is not compatible with the other plugins ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found