Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in iOS Build #3

Open
themagicclicks opened this issue Mar 2, 2017 · 12 comments
Open

Error in iOS Build #3

themagicclicks opened this issue Mar 2, 2017 · 12 comments

Comments

@themagicclicks
Copy link

The Android version of my app with this plugin compiled perfectly and Notification is working well, but the iOS build is throwing an archive failure error as below

** ARCHIVE FAILED **

The following build commands failed:
CopyPlistFile /Users/phonegap/Library/Developer/Xcode/DerivedData/CafeDelMarMusic-donlpwiribrhdbaoqrxwkabvsaxn/Build/Intermediates/ArchiveIntermediates/CafeDelMarMusic/InstallationBuildProductsLocation/Applications/CafeDelMarMusic.app/GoogleService-Info.plist CafeDelMarMusic/Plugins/cordova-plugin-fcm-config/GoogleService-Info.plist
(1 failure)
Error code 65 for command: xcodebuild with args: -xcconfig,/private/tmp/gimlet/2381572/project/cordova/build-release.xcconfig,-workspace,CafeDelMarMusic.xcworkspace,-scheme,CafeDelMarMusic,-configuration,Release,-destination,generic/platform=iOS,-archivePath,CafeDelMarMusic.xcarchive,archive,CONFIGURATION_BUILD_DIR=/private/tmp/gimlet/2381572/project/build/device,SHARED_PRECOMPS_DIR=/private/tmp/gimlet/2381572/project/build/sharedpch

Anybody with an idea on this please?

@themagicclicks
Copy link
Author

Removing this plugin and copying the plist and json files for Google services in the root along with config.xml makes the Android build fail now, which works perfectly "with" this plugin. The iOS build is successful and seems to have copied a plist file but probably not the one supplied, else the Android build should have picked that up too.

CopyPlistFile /Users/phonegap/Library/Developer/Xcode/DerivedData/CafeDelMarMusic-donlpwiribrhdbaoqrxwkabvsaxn/Build/Intermediates/ArchiveIntermediates/CafeDelMarMusic/InstallationBuildProductsLocation/Applications/CafeDelMarMusic.app/GoogleService-Info.plist CafeDelMarMusic/Resources/GoogleService-Info.plist

@themagicclicks
Copy link
Author

For anyone who's facing a similar problem, the resolution I found is utterly strange but it works, this seems to be some sort of file write problem, and every time I build for iOS on PGB with the fcm-config plugin excluded from config.xml it builds correctly, and then I include the plugin back and re-upload and build again, and it works, and the app is receiving notification tests from FCM Console both in-app and in notification tray perfectly!
So every time I need to rebuild the app on PGB, I exclude this plugin and build and then simply re-include this plugin and build and it works!!!

@ucci
Copy link

ucci commented Mar 30, 2017

I faced a similar issue. I'd like to share with anyone else that might be interested.

I tried to build on Adobe Phonegap Build for ios, but I got a error as bellow

error: failed to remove /Users/phonegap/Library/Developer/Xcode/DerivedData/Default-xxxx/Build/Intermediates/ArchiveIntermediates/Default/InstallationBuildProductsLocation/Applications/Default.app/GoogleService-Info.plist: “GoogleService-Info.plist” couldn’t be removed.

I wrote the config.xml like bellow:

<plugin name="cordova-plugin-fcm" version="2.1.1" />
<plugin source="git" spec="https://github.com/xxxx/cordova-plugin-fcm-config.git" />

and, I've modified the file like bellow:

<plugin source="git" spec="https://github.com/xxx/cordova-plugin-fcm-config.git" />
<plugin name="cordova-plugin-fcm" version="2.1.1" />

After that, The result showed that my app have been compiled on PGB perfectly.

@stetro
Copy link
Owner

stetro commented Mar 31, 2017

Hey @ucci thanks for sharing your experience!

But is the cordova-plugin-fcm-config plugin actually needed anymore?
Because since 2.1.1 the cordova-plugin-fcm has the following feature:

'google-services.json' and 'GoogleService-Info.plist' are added automatically from Cordova project root to platform folders (Source)

@themagicclicks
Copy link
Author

@stetro no I have tried that but in PhoneGap build, since nothing other than only the config.xml file outside the www folder is considered legal by the build program, the plist file is not copied, I have tried keeping it inside www too, in Android build it always worked, but failed in iOS build where for some reason the build always copies a plist file to root using the CopyPlist function by default, and hence the conflict with FCM-config. I have also tried setting the preference of ios to 8, but it seems like it follows the same random pattern even now,

  1. I upload once with the fcm-config plugin commented from the congif, build is without error
  2. then I wait a bit, uncomment the fcm-plugin in config and upload again, and then try building the app, and it then compiles.

Now there's something more random happening, with Developer Certificate and Provisioning Profile for development it used to be step 1 and step 2, now after updating with Distribution Certificates and Profiles, it is clearly random. Take x number of failed builds with the same error message of failing in ARCHIVE where CopyPlist function failed to copy the Google Services Plist, and then suddenly builds without error.

@anibalsanchez
Copy link

In my case, PGB builds Android apk but fails with iOS ipa, and the order of declarations doesn't affect the result.

This is the error:

** ARCHIVE FAILED **


The following build commands failed:
	CopyPlistFile /Users/phonegap/Library/Developer/Xcode/DerivedData/MyApp-dyjajjpkgiixpvcgvsihqplvmyuu/Build/Intermediates/ArchiveIntermediates/MyApp/InstallationBuildProductsLocation/Applications/MyApp.app/GoogleService-Info.plist MyApp/Plugins/SlimApp-Boilerplate-plugin-fcm-config/GoogleService-Info.plist
(1 failure)
Error code 65 for command: xcodebuild with args: -xcconfig,/private/tmp/gimlet/2455518/project/cordova/build-release.xcconfig,-workspace,MyApp.xcworkspace,-scheme,MyApp,-configuration,Release,-destination,generic/platform=iOS,-archivePath,MyApp.xcarchive,archive,CONFIGURATION_BUILD_DIR=/private/tmp/gimlet/2455518/project/build/device,SHARED_PRECOMPS_DIR=/private/tmp/gimlet/2455518/project/build/sharedpch

@ucci
Copy link

ucci commented Apr 20, 2017

@anibalsanchez,:
In my experience, if my app shows the error on PGB, I press Rebuild button again and again (up to about 10 times, I hope), and then suddenly builds without error.
Yes, it is a very strange thing, but you will just try it.

@anibalsanchez
Copy link

We can report it to find a solution.

@stetro
Copy link
Owner

stetro commented Apr 21, 2017

I'm sorry, but I cannot help here in any way - since I'm only using it for local cordova builds.

@gogul-wabco
Copy link

I solved this issue by manually removing Duplicate GoogleService-Info.plist Under
Build Phases -->Copy bundle resources.

screen shot 2017-09-20 at 3 36 45 pm

@yocheved-check-in
Copy link

thank you!!!!!
you saved my day!!!!!

@nfriacowboy
Copy link

I solved this issue by manually removing Duplicate GoogleService-Info.plist Under
Build Phases -->Copy bundle resources.

screen shot 2017-09-20 at 3 36 45 pm

Easy and simple is just that 🕺

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants