phonegap / phonegap-docs

PhoneGap Documentation
http://docs.phonegap.com
Apache License 2.0
121 stars 246 forks source link

iOS custom build fails as per the docs #284

Open pzanitti opened 6 years ago

pzanitti commented 6 years ago

The docs naturally state that the config.xml widget id has to be changed to something unique.

https://github.com/phonegap/phonegap-docs/blob/983383514a537e9a339ca661830ac35199c2fbd5/docs/3-references/developer-app/6-custom-build/ios-custom-build.html.md#L29

But there is also a ./google-services.json file that references the id.

https://github.com/phonegap/phonegap-app-developer/blob/83417c7fb083ebc2ec7df8441806ad444866e0d8/google-services.json#L13

If you try to build without changing that attribute, you will get

  • What went wrong: Execution failed for task ':processDebugGoogleServices'. No matching client found for package name 'my.unique.phonegap.app'

However even when I change it and make my custom build (phonegap run android --device), it never connects to my phonegap serve, it gets stuck at DOWNLOADING.... Same phone, same computer, the App Store version works perfectly.

pzanitti commented 6 years ago

The right way is to replace ./google-services.json with your own version of that file (obtained from FCM). So there are actually two things you have to customize before you can build:

  1. Change the widget id.
  2. Replace ./google-services.json with your own.

I don't know the consequences of editing the reference in ./google-services.json. Of course if you don't have your own Firebase account you won't be able to roll out your own ./google-services.json.

Sorry if this is already explained in the custom build docs, I couldn't find it.

pzanitti commented 6 years ago

However even when I change it and make my custom build (phonegap run android --device), it never connects to my phonegap serve, it gets stuck at DOWNLOADING.... Same phone, same computer, the App Store version works perfectly.

This actually seems to be a bug https://github.com/phonegap/phonegap-app-developer/issues/523

purplecabbage commented 5 years ago

Is this still happening @pzanitti ?

pzanitti commented 5 years ago

I haven't tested again in a while but it shouldn't. The startup bug was fixed.

However the Custom Build docs don't mention that when you change the widget it you also need to roll in your own ./google-services.json or it will break, like my second post mentions.

https://github.com/phonegap/phonegap-docs/blob/983383514a537e9a339ca661830ac35199c2fbd5/docs/3-references/developer-app/6-custom-build/ios-custom-build.html.md#L29