Brand new capacitor app requires google-services.json
See original GitHub issueSummary: After creating a new ionic app and adding in capacitor to it, the app will not build in android studio because it requires google-services.json (a firebase config file).
Steps to Reproduce: ionic start test tabs --type=angular cd test ionic build npm install --save @capacitor/cli @capacitor/core npm uninstall --save cordova-plugin-splashscreen npx cap init Test com.example.test npx cap add android npx cap open android
Expected Results The app should build and run in android studio without needing a google-services.json file.
Actual Results
File google-services.json is missing. The Google Services Plugin cannot function without it.
Searched Location:
C:\code\test\android\app\src\nullnull\debug\google-services.json
C:\code\test\android\app\src\debug\nullnull\google-services.json
C:\code\test\android\app\src\nullnull\google-services.json
C:\code\test\android\app\src\debug\google-services.json
C:\code\test\android\app\src\nullnullDebug\google-services.json
C:\code\test\android\app\google-services.json
Ionic:
ionic (Ionic CLI) : 4.0.6 (C:\Users\Joe\AppData\Roaming\npm\node_modules\ionic) Ionic Framework : @ionic/angular 4.0.0-beta.2 @angular-devkit/core : 0.7.3 @angular-devkit/schematics : 0.7.3 @angular/cli : 6.1.3 @ionic/ng-toolkit : 1.0.6 @ionic/schematics-angular : 1.0.4
System:
NodeJS : v8.11.3 (C:\Program Files (x86)\nodejs\node.exe) npm : 5.5.1 OS : Windows 10
Capacitor: 1.0.0-beta.4
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:8 (3 by maintainers)
For people facing this, the PR will only affect new apps as the change is on the template. You can replace the current apply with this in the build.gradle if you don’t use push but plan to do it in the future
If don’t plan on using it, remove it as @daniel-lucas-silva said
remove apply plugin: ‘com.google.gms.google-services’ implementation ‘com.google.firebase:firebase-messaging:17.1.0’ classpath ‘com.google.gms:google-services:4.0.1’
from android/build.gradle and android/app/build.gradle
i want to know why cap is adding firebase to the project