ionic-team / legacy-ionic-cloud

JavaScript Client for legacy Ionic Cloud services. See Ionic Pro for our new take on the ionic development lifecycle
Apache License 2.0
65 stars 26 forks source link

Fail to compile on Ionic Cloud with cordova-plugin-fcm #198

Open connois opened 7 years ago

connois commented 7 years ago

Hello,

I'm having troubles compiling my Ionic 2 app on Ionic Cloud for platform iOS and Android when adding the cordova-plugin-fcm plugin.

It fails with the following error on iOS :

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

and this one on Android :

Error: cordova-plugin-fcm: You have installed platform android but file 'google-services.json' was not found in your Cordova project root folder.

I have of course correctly created my project on Firebase and downloaded both GoogleService-Info.plist and google-services.json and placed them in the root of my Ionic project.

It just seems that the command "ionic package build ios --profile dev" does not copy thoses files and therefore trigger this failure to compile.

Is there a config file were I have to add thoses 2 files so they get copied onto the Ionic Cloud ? Any idea how I can fix this ?

Any help would be really appreciated !

Thanks

Arnaud Connois

didinj commented 7 years ago

Any solution for this issue?

janpio commented 7 years ago

Ionic Package only uploads www and a few selected files and recreates your project on the server to build it.

The Cordova plugin should take care of creating and placing these files. Unfortunately this is not trivial and many don't take care of this but require manual steps (like creating files in the project root).

ron-gonzalez commented 6 years ago

Hi All I found a possible solution to this problem but I need help for finish the it.

Introduction .

  1. Local build is OK
  2. Running on emulator OK
  3. Cloud build fails with error ("cordova-plugin-fcm: You have installed platform android but file 'google-services.json' was not found in your Cordova project root folder.");

Cause This is caused because ionic framework do not upload files in root directory ! (this is the main problem)

Possible Solution I copied the files GoogleService-Info.plist and google-services.json to the same foder that the plugin script , so an Chunk data error appears. Is because the catch function do this [ process.stdout.write(err);] err is a binary data not a string or buffer. simply change it to process.stdout.write('error' + err);

so I do the ionic package build command, and checked the error is the same in ionic cloud, this means that ionic do not upload the local plugin script, instead this installs from repository . So I think that the solution should be a fork of the project with that corrections.

what do you think about this ? withch solutions did you find for your projects ?

Thanks and best regards!

ron-gonzalez commented 6 years ago

Finally i Find the Solution to get working.

I moved the development to Ionic Pro and connected to Ionic GIT So I did a commit / push in GIT of the firebase files. After this procedure, GoogleService-Info.plist and google-services.json where uploaded to ionic cloud, so all compiled Fine !

I think that the main problem is that in free mode, we can not upload this files from project root folder.

Best regards, Roni

janpio commented 6 years ago

How did you build the app in the cloud before moving to Ionic Pro? What command did you use?

ron-gonzalez commented 6 years ago

Before moving to pro and with cordova-plugin-fcm plugin was impossible to compile in cloud for me. Only local builds were successfully.

But if your question is generic about how to compile in cloud you should use command ionic package build android --profile YOUR_APP_PROFILE You can find a full explanation here ionic package