Closed deliverymanager closed 4 years ago
Did someone else test the plugin with other plugins that use pods? Thank you
For anyone else with the same problem a very tiring workaround when you are trying to install other plugins all together that require pods like: "cordova-plugin-googleplus", "onesignal-cordova-plugin", "cordova-plugin-facebook4"
The main problem is that all these three plugins plugins use pods and they all try to create a new pod target but with the same name! This give a multiple targets error during plugin add.
So they workaround that I have found is:
First replace the platforms/ios/Podfile to become empty each time I add a plugin that uses a pod
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '11.0'
Then install the plugin
Finally replace the podifile so that it contains all the pods for all the plugins used.
source 'https://github.com/CocoaPods/Specs.git' platform :ios, '11.0' use_frameworks! target 'Franky\'s BURGERS' do project 'Franky\'s BURGERS.xcodeproj' pod 'GoogleSignIn', '~> 4.4.0' pod 'GoogleUtilities', '~> 6.3.0' pod 'OneSignal', '2.11.0' pod 'FBSDKCoreKit', '5.7.0' pod 'FBSDKLoginKit', '5.7.0' pod 'FBSDKShareKit', '5.7.0' end
-Finally, run inside the platforms/ios "pod install --verbose".
After that I am able to build!
The main problem is that all these three plugins plugins use pods and they all try to create a new pod target but with the same name! This give a multiple targets error during plugin add.
could you provide a PR to solve this?
No this is just an ugly workaround. The main issue is that the podfile is not edited correclty by none of those 3 plugins. So I had to edit it manually each time I add a plugin.
The main issue is that the podfile is not edited correclty by none of those 3 plugins.
It's what I mean, could you provide a PR to then "let the plugin edit correctly the podfile"?
I will try!
Coolio, thx @deliverymanager !
For anyone else with the same problem a very tiring workaround when you are trying to install other plugins all together that require pods like: "cordova-plugin-googleplus", "onesignal-cordova-plugin", "cordova-plugin-facebook4"
The main problem is that all these three plugins plugins use pods and they all try to create a new pod target but with the same name! This give a multiple targets error during plugin add.
So they workaround that I have found is:
- First replace the platforms/ios/Podfile to become empty each time I add a plugin that uses a pod
source 'https://github.com/CocoaPods/Specs.git' platform :ios, '11.0'
- Then install the plugin
- Finally replace the podifile so that it contains all the pods for all the plugins used.
source 'https://github.com/CocoaPods/Specs.git' platform :ios, '11.0' use_frameworks! target 'Franky\'s BURGERS' do project 'Franky\'s BURGERS.xcodeproj' pod 'GoogleSignIn', '~> 4.4.0' pod 'GoogleUtilities', '~> 6.3.0' pod 'OneSignal', '2.11.0' pod 'FBSDKCoreKit', '5.7.0' pod 'FBSDKLoginKit', '5.7.0' pod 'FBSDKShareKit', '5.7.0' end
-Finally, run inside the platforms/ios "pod install --verbose".
After that I am able to build!
Strange. I get the exact same error, but when I check the file everything shows correctly.
In your case are you adding multiple plugins?
After much search I concluded that the real problem the podfile is not edited correctly when we have multiple plugins is the app name. If the app contains an apostrophe (') then it breaks. It also breaks when we have special chars that are replace by underscore.
The naming of the target is handled by the cordova-ios.
@deliverymanager it also breaks with app names that only contain letters, no spaces or special chars.
In my case I have tried it with an app name eg: "Flower Shop" which just contains an empty space. But the prod file breaks and is not edited correctly when build with "Betty's Shop"
OK after all the fuzz, what I ended up doing to resolve is to give a friendly name, single string. Then inside xCode before building, I corrected the Display Name to the actual one.
EDIT: This method fails when you try to upload on Apple Store, due to signing error that is cause by the change in the app name inside xCode. So dead end.
I think this error does not have to do with facebook cordova plugin. It is a mishandling of app name at the cordova-ios.
Finally. The only robust solution I found was to name the project with an id that is in English and then use a plugin cordova transations to name the app in the language I wanted in the first place. This way the podfile is edited correctly and there is no need for any special workaround besides the translations.
In case someone uses other modules that they are editing the Podfile too, then this happens inside the podfile. The target 'Sample Project' do etc is declared twice, leading to the error Analyzing dependencies [!] The target
Sample Project
is declared multiple times for the projectSample Project.xcodeproj
.NOTE: I am using all the latest versions