fechanique / cordova-plugin-fcm

Google FCM Push Notifications Cordova Plugin
623 stars 995 forks source link

'GoogleService-Info.plist' was not found in your Cordova project root folder. #212

Open sansan88 opened 7 years ago

sansan88 commented 7 years ago

After building with Ionic2 I get this error:

Error: cordova-plugin-fcm: You have installed platform ios but file 'GoogleService-Info.plist' was not found in your Cordova project root folder.

The file is in the directory /platforms/ios and in the cordova root.

Cordova CLI: 6.4.0 Ionic Framework Version: 2.0.0-rc.5 Ionic CLI Version: 2.2.1 Ionic App Lib Version: 2.2.0 Ionic App Scripts Version: 1.0.0 ios-deploy version: Not installed ios-sim version: Not installed OS: Windows 10 Node Version: v6.9.1 Xcode version: Not installed

sansan88 commented 7 years ago

I have tried plugin version 2.1.0 and 2.1.1

kapilrc commented 7 years ago

i put the google-services.json in platform root folder (platforms/[android]/). It's working.

sansan88 commented 7 years ago

eventually this is an iOS only problem?

219

peterterbe commented 7 years ago

Nope, I was trying to build an android package in #219

anoop1304 commented 7 years ago

I have the same issue("Error: cordova-plugin-fcm: You have installed platform ios but file 'GoogleService-Info.plist' was not found in your Cordova project root folder.") on iOS when install this plugin. I have placed the GoogleService-Info.plist file in resources folder(Drag and drop in xcode) and in ios folder(directory/platform/ios). But I am still facing this issue.

Please help.

vargaendre commented 7 years ago

I had this very same issue when building with the latest version (2.1.1). I am using a hook which copies the required files into platforms/[platform] directory. This was working just fine. After the update I got the error, so I just copied the files to the root of my project. Then it works. Although I don't understand why this is necessary. I'd prefer the old way.

anoop1304 commented 7 years ago

Hello Vargaendre

I have installed this plugin in new project. I am still facing this issue. Here is the terminal log while installing the plugin:

"admins-Mac-mini-83:Fooduction anoopkumaryadav$ cordova plugin add cordova-plugin-fcm Fetching plugin "cordova-plugin-fcm" via npm Installing "cordova-plugin-fcm" for android ANDROID_HOME=/Users/anoopkumaryadav/Library/Android/sdk JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_92.jdk/Contents/Home Subproject Path: CordovaLib Starting a new Gradle Daemon for this build (subsequent builds will be faster). Incremental java compilation is an incubating feature. :clean :CordovaLib:clean

BUILD SUCCESSFUL

Total time: 31.942 secs Subproject Path: CordovaLib

    Cordova FCM plugin v2.1.1 installed
    For more details visit https://github.com/fechanique/cordova-plugin-fcm

Installing "cordova-plugin-fcm" for ios

    Cordova FCM plugin v2.1.1 installed
    For more details visit https://github.com/fechanique/cordova-plugin-fcm

cp: no such file or directory: /Users/anoopkumaryadav/Documents/Project For Test/Fooduction/resources/ios/icon/icon-40@3x.png

cp: no such file or directory: /Users/anoopkumaryadav/Documents/Project For Test/Fooduction/resources/ios/icon/icon-83.5@2x.png

Error: cordova-plugin-fcm: You have installed platform ios but file 'GoogleService-Info.plist' was not found in your Cordova project root folder. admins-Mac-mini-83:Fooduction anoopkumaryadav$ "

Team please help me.

sansan88 commented 7 years ago

Sorry @ihadeed , but I have still the same error.. :(

Error: cordova-plugin-fcm: You have installed platform ios but file 'GoogleService-Info.plist' was not found in your Cordova project root folder.

ricardojlrufino commented 7 years ago

I needed to manually add the file to the Resources folder in XCode selection_999 179 And select: GoogleService-Info.plist

abelabbesnabi commented 7 years ago

There is no issue in version 2.1.1, all I had to do is put both files: google-services.json and GoogleService-Info.plist in my application's root folder parallel to platforms folder.

VendettaNyx commented 7 years ago

@abelabbesnabi but how are you gonna get google-services.json for an ios? application in FCM?

mufniarz commented 7 years ago

Ionic Framework 1 I placed both the GoogleService-Info.plist and google-services.json into my main project folder and this error went away.

NOT into platforms or www, but the directory that contains these.

mufniarz commented 7 years ago

@VendettaNyx You don't get a google-services.json for iOS.

For iOS you need the GoogleService-Info.plist file. You can get/download both files by following this support documentation: https://support.google.com/firebase/answer/7015592

joesleiman commented 7 years ago

i put the files google-services.json and GoogleService-info.pplist in cordova root project and build ios but it not appear in platform ios ? why

seb-montana commented 7 years ago

Hi, I found solution... In your config.xml you have to replace : <resource-file src="GoogleService-Info.plist" /> by this <resource-file src="resources/GoogleService-Info.plist" /> and place your GoogleService-Info.plist in resources/ folder

BUILD SUCCEEDED Same thing for google-services.json. hope that help you, enjoy

mitzapellido commented 6 years ago

already done this but still not working

Hi, I found solution... In your config.xml you have to replace :

by this

and place your GoogleService-Info.plist in resources/ folder

BUILD SUCCEEDED Same thing for google-services.json. hope that help you, enjoy

ozuit commented 6 years ago

Just put google-services.json and GoogleService-Info.plist in folder running the command. (root project folder)

Murilo-Perrone commented 6 years ago

Even with latest component versions, it still did not work for me on ios. But I solved it by adding this in my config.xml:

<platform name="ios">
    <resource-file src="GoogleService-Info.plist" target="resources/GoogleService-Info.plist" />
</platform>

More info here and here.

Otherwise you can copy it manually into platforms/ios/MyApplicationName/Resources/Resources/GoogleService-Info.plist . The file was already there, but had only 6 lines, while it should have 40.

keshav00001 commented 6 years ago

I have added but getting same problem:(cordova-plugin-fcm: You have installed platform ios but file 'GoogleService-Info.plist' was not found in your Cordova project root folder.)

<platform name="ios">
    <resource-file src="GoogleService-Info.plist" target="resources/GoogleService-Info.plist" />
</platform>
Murilo-Perrone commented 6 years ago

keshav, just to clarify, first the GoogleService-Info.plist and google-services.json files should be obtained online (see fcm documentation) and manually placed by you in the root of your project. With that, your cordova project with fcm plugin should automatically copy them to the platforms/ios/MyApplicationName/Resources/ folder when building.

However, by some reason, inside the Resources folder there is another Resources folder were the GoogleService-Info.plist file should also be present, and it was there but with just 6 lines of code. This is what you can fix manually by replacing it. The manual fix will work for all subsequent builds, until you remove the cordova platform. Or you can try the permanent fix from config.xml .