Open viking2917 opened 6 years ago
@viking2917 my best guess would be the hooks that the cordova-plugin-openwith executes mess up stuff but I haven't tried to reproduce it yet.
Thanks @macdonst. I will take a look tomorrow and chase that angle, see what's up.
Weirdly, this scenario (I've done it many times with slight variations), will often build in Xcode, but not via CLI. Don't have a specific path to repro that but its what seems to happen....
OK @macdonst I think this is a case of operator error. When I take the above steps, only after
cd intentTest7
I run
sudo gem install cocoapods
It seems to work fine. I had thought my installation of cocoapods was global, but apparently it was not somehow. I'm fine to close this, sorry for the confusion.
So, the problem occurred for me again and I think I found the source of the issue. The OpenWith setup either mangles, or doesn't update, the linker flags in the Share Ext target. So it was missing the linker flags to the pods library.
I fixed this by selecting the Share Ext build target, going to 'Build Phases', then hitting + and 'Add Link Binary with Libraries', and added 'libPods-
I know little enough about Xcode to really know whether the Plugin should have added that library to the build phases because the other target was using it, or whether that's on the end developer (e.g. me) to do that. But it might warrant a note in the install guide, if one is using other plugins that require cocoapods.
Hat tip to this SO question for pointing me in the right direction. https://stackoverflow.com/questions/25538579/use-cocoapods-with-an-app-extension
plugin_not_installed error but i already install phonegap push plugin.
So, the problem occurred for me again and I think I found the source of the issue. The OpenWith setup either mangles, or doesn't update, the linker flags in the Share Ext target. So it was missing the linker flags to the pods library.
I fixed this by selecting the Share Ext build target, going to 'Build Phases', then hitting + and 'Add Link Binary with Libraries', and added 'libPods-.a ' to the list of libraries (it was the only one, there were none before in the Share Ext).
I know little enough about Xcode to really know whether the Plugin should have added that library to the build phases because the other target was using it, or whether that's on the end developer (e.g. me) to do that. But it might warrant a note in the install guide, if one is using other plugins that require cocoapods.
Hat tip to this SO question for pointing me in the right direction. https://stackoverflow.com/questions/25538579/use-cocoapods-with-an-app-extension
thanks for the info , but after following the steps , still no luck . when send picture to my app , still cause push-plugin onRegister event , and share intent not received still. Any one know how to fix this ? Thanks.
Expected Behaviour
It should be possible to add the Push plugin in combination with the OpenWith Share on IOS plugin (https://github.com/j3k0/cordova-plugin-openwith)
Actual Behaviour
Building with both plugins installed fails.
Reproduce Scenario (including but not limited to)
First add the OpenWith plugin (it introduces a second build target for the ios Share extension). 'ionic cordova build ios' works. Then add the push plugin, and build again, and it fails with what looks like a cocoapods-related error. (The app builds fine if I add just Push, I do have Cocoapods set up correctly I believe). Steps to reproduce below. (Note this is unrelated to the mistake of opening the .proj file instead of the .workspace file - I opened in the workspace file, and in any case this is a command line error.
I don't know definitively that Push is at fault, but as the error seems related to CocoaPods I think it may have to do with the build setup in the situation of multiple targets....
Am I doing something wrong?
Steps to Reproduce
Prior to the steps below, one must set up an App Group in the Apple Developer portal and ensure the app id, the developer cert and app groups all line up. You will get signing errors during compilation if that is not done correctly.
-> works
then
-> fails
(note: before building one must of course open Xcode and set developer Signing certs correctly)
The trouble seems to start with these messages: (the warnings are I think OK - I get them even in projects that build OK)
A complete dump of the output/logs is attached. buildfail.txt
Platform and Version (eg. Android 5.0 or iOS 9.2.1)
(Android) What device vendor (e.g. Samsung, HTC, Sony...)
Cordova CLI version and cordova platform version
8.0
Installed platforms: ios 4.5.4 Available platforms: android ~7.0.0 browser ~5.0.1 osx ~4.0.1 windows ~5.0.0 www ^3.12.0
Plugin version
phonegap-plugin-push 2.2.2 "PushPlugin"
Sample Push Data Payload
Sample Code that illustrates the problem
Logs taken while reproducing problem