iOS/cocoapods duplicate interface definition for ProtocolBuffers class - ios

I have 4 projects in my workspace, 3 static libraries and 1 app. And I use protocolBuffers for 1 lib project and app project, the pod setting like below:
workspace 'MyApp.xcworkspace'
project 'MyApp/MyApp.xcodeproj'
target 'MyApp' do
platform :ios, '7.0'
project 'MyApp/MyApp.xcodeproj'
pod 'AFNetworking', "~> 3.0"
pod 'HTMLReader', "~> 0.9.4"
pod 'FCModel', "~> 0.9.0"
pod 'CocoaLumberjack', "~> 2.0.0"
pod 'CocoaAsyncSocket'
pod 'ProtocolBuffers', "~> 1.9.10"
pod 'FXBlurView', "1.6.4"
pod 'NJKWebViewProgress', "0.2.3"
pod 'SDWebImage', "3.7.5"
pod 'PureLayout', "3.0.1"
pod 'SpinKit', "1.2.0"
pod 'TPKeyboardAvoiding', "1.2.11"
pod 'JDStatusBarNotification', "1.5.3"
pod 'MSDynamicsDrawerViewController'
end
target 'UIFoundation' do
platform :ios, '7.0'
project 'UIFoundation/UIFoundation.xcodeproj'
end
target 'DataFoundation' do
platform :ios, '7.0'
project 'DataFoundation/DataFoundation.xcodeproj'
pod 'ProtocolBuffers', "~> 1.9.10"
end
target 'CommonFoundation' do
platform :ios, '7.0'
project 'CommonFoundation/CommonFoundation.xcodeproj'
pod 'AFNetworking', "~> 3.0"
pod 'RNCryptor', "~> 3.0.1"
pod 'HTMLReader', "~> 0.9.4"
pod 'FCModel', "~> 0.9.0"
pod 'CocoaLumberjack', "~> 2.0.0"
pod 'CocoaAsyncSocket'
end
The 'pod install' response success without any warning or error, but the Xcode response error 'duplicate interface definition for ProtocolBuffers class' when I build my projects:
Anyone who knows what is the problem of my setting? Below is my work environment:
cocoapods version: 1.0.1
ProtocolBuffers version: 1.9.10
Xcode version: 7.3;
MAC system version: 10.11.5
p.s.: I've build success with the same projects and pod file before 2 month ago, I did not change any settings for. On today morning, I got some error messages from terminal when I run 'pod install' in my project, so I've update the 'HomeBrew', 'ruby', 'gems', 'cocoaPods' for my MAC.

maybe you should check link binary with libraries section for possible duplicate pod framework.Also using "pod deintegrate" to sterilize project from cocoapod files and creating it from scratch may help you

Related

Unable to find host target(s) for Extension

Report
What did you do?
I tried to run the pod install command
What did you expect to happen?
Install all pod dependencies correctly like the 1.1.1 version do.
What happened instead?
[!] Unable to find host target(s) for myExtension1, myExtension2. Please add the host targets for the embedded targets to the Podfile.
Certain kinds of targets require a host target. A host target is a "parent" target which embeds a "child" target. These are example types of targets that need a host target:
- Framework
- App Extension
- Watch OS 1 Extension
- Messages Extension (except when used with a Messages Application)
CocoaPods Environment
Stack
CocoaPods : 1.2.1
Ruby : ruby 2.2.5p319 (2016-04-26 revision 54774) [x86_64-darwin15]
RubyGems : 2.4.5.1
Host : Mac OS X 10.12.5 (16F73)
Xcode : 8.3.3 (8E3004b)
Git : git version 2.13.0
Ruby lib dir : /Users/dogo/.rbenv/versions/2.2.5/lib
Repositories : master - https://github.com/CocoaPods/Specs.git # 08682dc5b65d664048f43d7886a018856c692b63
Installation Source
Executable Path: /Users/dogo/.rbenv/versions/2.2.5/bin/pod
Plugins
claide-plugins : 0.9.2
cocoapods-deintegrate : 1.0.1
cocoapods-plugins : 1.0.0
cocoapods-search : 1.0.0
cocoapods-stats : 1.0.0
cocoapods-trunk : 1.2.0
cocoapods-try : 1.1.0
slather : 2.4.2
Podfile
source 'https://github.com/CocoaPods/Specs.git'
project 'MyProject', 'DebugProduction' => :release , 'Integrated' => :release , 'Mock' => :release, 'DebugMock' => :debug
platform :ios, '8.0'
inhibit_all_warnings!
def all_pods
pod 'AFNetworkActivityLogger'
pod 'AFNetworking'
pod 'AMPopTip', '~> 1.0.0'
pod 'BBBadgeBarButtonItem', '~> 1.2'
pod 'Bricks', '~> 0.1.2'
pod 'bricks-Mantle', '~> 0.1.0'
pod 'CocoaLumberjack', '~> 2.2.0'
pod 'Crashlytics'
pod 'CustomIOSAlertView'
pod 'Fabric'
pod 'FBSDKCoreKit', '4.16.0'
pod 'FBSDKLoginKit', '4.16.0'
pod 'FBSDKShareKit', '4.16.0'
pod 'FDKeychain', '~> 1.0.0'
pod 'FSCalendar'
pod 'GoogleAnalytics', '~> 3.17.0'
pod 'GoogleConversionTracking', '~> 3.4.0'
pod 'GoogleMaps', '2.3.1'
pod 'HockeySDK', '4.1.6'
pod 'JVFloatLabeledTextField'
pod 'LGPlusButtonsView'
pod 'MaryPopin', '1.4.2'
pod 'MBProgressHUD'
pod 'MGSwipeTableCell'
pod 'MMWHaleImageCropper', '~> 0.1'
pod 'NSStringMask', '1.2'
pod 'ObjectiveSugar', '~> 1.1.0'
pod 'PromiseKit', '~> 1.7.0'
pod 'Realm', '~> 2.3.0'
pod 'REFrostedViewController', '~> 2.4'
pod 'RegExCategories', '~> 1.0'
pod 'SMXMLDocument', '~> 1.1'
pod 'SpotlightHandler', :git => 'https://github.com/renatosarro/SpotlightHandler'
pod 'SRMonthPicker', '~> 0.2.10'
pod 'TLInputsChainHelper', :git => 'https://github.com/thiagolioy/TLInputsChainHelper.git'
pod 'TLJsonFactory'
pod 'UITintedButton'
pod 'XMLDictionary', '1.4'
pod 'ZBarSDK'
pod 'ZSWTaggedString', '~> 1.1'
pod 'ZSWTappableLabel', '1.3'
end
target :MyProject do
all_pods
end
target :'MyProject-cal' do
all_pods
end
target :MyProjectExtension do
pod 'GoogleAnalytics', '~> 3.17.0'
end
target :MyProject2 do
all_pods
end
target :'MyProject2-cal' do
all_pods
end
target :MyProjectExtension2 do
pod 'GoogleAnalytics', '~> 3.17.0'
end
target :MyProjectTests do
inherit! :search_paths
pod 'Expecta'
pod 'OCMock'
pod 'Specta', '1.0.5'
pod 'TLJsonFactory'
end
The problem is not in the podfile, but in the project!
To fix:
Go to XCode
Select your HOST target.
Open the target's 'General' page
In the 'Embedded Binaries' section, make sure your EXTENSION target is present.
In your Podfile you should have:
target 'HostApp' do
....
target 'YourExtension' do
....
end
end
This happened to me because I had a target for an extension that was de-activated (removed as a dependency for the main target) in my Podfile.
Removing the target fixed it.
For me to solve he issue I had to remove the appex of the extension from the host app's Embedded binaries and add it again (because the issue happened after solving merge conflicts)
Then I ran "pod install", and it worked
you have to add extension to both Build Phases -> Dependencies and Build Phases -> Embed App Extensions for you Main app target

Swift Eureka error inside library after installation

I just did install Eurika library from xmartslab
I already googled this problem, unfortunally found nothing
As usual added it to my Podfile:
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
use_frameworks!
target 'Project' do
pod 'Alamofire', '~> 3.0'
pod 'SDWebImage', '~>3.7'
pod 'ObjectMapper', '~> 1.1'
pod 'Eureka', '~> 1.5'
pod 'SDWebImage', '~>3.7'
end
After installation I got a bunch of errors:
What can cause this problem. Could it be any incompatibility with other libraries?
I suppose you are using Xcode 7.2 or older. You will have to upgrade to Xcode 7.3 or change your Podfile to pod 'Eureka', '~> 1.4.1'

ERROR ITMS-90205 The bundle contains disallowed nested bundles podfile

I am getting the following error when deploying to AppStore
ERROR ITMS-90205 The bundle contains disallowed nested bundles podfile
Both my App and Today Extension use Swift pods.
Here's my Podfile:
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
use_frameworks!
target 'MyApp' do
pod 'Fabric'
pod 'Crashlytics'
pod 'Alamofire', '~> 3.0'
pod 'Eureka', '~> 1.0'
pod 'NSString-HTML', '~> 0.0'
pod 'TSMessages', :git => 'https://github.com/KrauseFx/TSMessages.git'
pod 'MCSMKeychainItem'
pod 'HTProgressHUD', '~> 0.2.1'
pod 'DZNEmptyDataSet'
pod 'TOWebViewController', '~> 2.0.5'
pod 'SimulatorStatusMagic', :configurations => ['Debug']
end
target 'MyAppTodayExtension' do
pod 'Alamofire', '~> 3.0'
pod 'NSString-HTML', '~> 0.0'
pod 'MCSMKeychainItem'
end
What am I doing wrong?
UPDATE: After installing a custom Run Script build phase for my Today Extension that removes the Frameworks directory, I am able to upload to App Store.
cd "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/"
if [[ -d "Frameworks" ]]; then
rm -fr Frameworks
fi
But is there another way that is supported by CocoaPods?
Try downgrading cocoapods to 0.38.2 version. I had that problem and I fixed by downgrading.
https://github.com/CocoaPods/CocoaPods/issues/4203

Cocoapods Test Issue - Duplicate "one of the two will be used. which one is undefined."

I've been trying to solve this issue for a couple days and haven't found a solution. Whenever I try to run a test I receive the error shown below that there are duplicate classes.
I tried these answers but I'm still receiving the duplicate error and my tests won't run
Cocoapods Warning - CocoaPods did not set the base configuration of your project because because your project already has a custom config set
My pod file looks like this:
platform :ios, "8.0"
def project_pods
pod "Braintree"
pod "AFNetworking", "~> 3.0"
pod "MBProgressHUD"
pod "ActionSheetPicker-3.0", "~> 2.0.1"
pod "SCLAlertView-Objective-C", "~> 0.7"
pod "GoogleMaps"
pod "MPSHorizontalMenu"
pod "Fabric"
pod "Crashlytics"
pod "RateView"
pod "QBImagePickerController"
pod "GLCalendarView", "~> 1.0.0"
pod "Heap"
pod "AWSS3"
end
target “iOS_project” do
project_pods
end
target “iOS_projectTests” do
project_pods
end
This is what the error looks like and it is for every cocoapod class:
Class GMSAutocompleteResultsViewController is implemented in both /Users/john/Library/Developer/CoreSimulator/Devices/27CF0470-07AC-4575-8907-A27EE9B357A7/data/Containers/Bundle/Application/7AFB0886-9ED1-464D-8B02-067CDD07511D/iOS_project.app/iOS_project and /Users/john/Library/Developer/Xcode/DerivedData/iOS_projectTests-hezbkjqviaiitthcrrnwetvcojcb/Build/Products/Debug-iphonesimulator/iOS_projectTests.xctest/iOS_projectTests. One of the two will be used. Which one is undefined.
All of the pods are Objective C and I am using a bridging header
Reformat your podfile like this:
platform :ios, "8.0"
def project_pods
pod "Braintree"
pod "AFNetworking", "~> 3.0"
pod "MBProgressHUD"
pod "ActionSheetPicker-3.0", "~> 2.0.1"
pod "SCLAlertView-Objective-C", "~> 0.7"
pod "GoogleMaps"
pod "MPSHorizontalMenu"
pod "Fabric"
pod "Crashlytics"
pod "RateView"
pod "QBImagePickerController"
pod "GLCalendarView", "~> 1.0.0"
pod "Heap"
pod "AWSS3"
target "iOS_projectTests" do
inherit! :search_paths
end
end
target "iOS_project" do
project_pods
end
Source: CocoaPods issue #4626
The error indicates that '
GMSAutocompleteResultsViewController' is integrated two time and only one is used from it
If you are not using unit testing case target for now you can remove that portion from the podfile and check again by pod install or pod update
Remove this portion from your podfile
target “iOS_projectTests” do
project_pods
end
For swift it will be good if you set use_frameworks! below the platform version
so your top portion can be like
platform :ios, "8.0"
use_frameworks!
so your new podfile can look like this
platform :ios, "8.0"
use_frameworks!
def project_pods
pod "Braintree"
pod "AFNetworking", "~> 3.0"
pod "MBProgressHUD"
pod "ActionSheetPicker-3.0", "~> 2.0.1"
pod "SCLAlertView-Objective-C", "~> 0.7"
pod "GoogleMaps"
pod "MPSHorizontalMenu"
pod "Fabric"
pod "Crashlytics"
pod "RateView"
pod "QBImagePickerController"
pod "GLCalendarView", "~> 1.0.0"
pod "Heap"
pod "AWSS3"
end
target “iOS_project” do
project_pods
end
target “iOS_projectTests” do
project_pods
end
Hope this helps, if it still shows the error you may put pods directly on the target instead of putting in def at top
Note: For the Google map you can also directly import the framework like import GoogleMaps instead of adding google maps in the bridging header
now, modify Podfile by commenting use_frameworks! ,like below:
platform :ios, '8.0'
#use_frameworks!
target 'ShiBa' do
pod 'SDWebImage'
pod 'AFNetworking'
pod 'MBProgressHUD'
pod 'MJRefresh', '3.1.0'
pod 'UMengAnalytics'
pod 'YYModel'
pod 'AMapLocation'
pod 'pop'
end

Building errors after updating CocoaPods libraries

I'm working on a legacy iOS project as a newbie. After I updated the CocoaPods and libraries, I've got these weird errors after building the project which never happen before.
error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: can't locate file for: -lPods-Model
error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: file: -lPods-Model is not an object file (not allowed in a library)
And here is my Podfile:
platform :ios, '7.0'
link_with ['DianaViewModels']
pod 'AVOSCloud', '~> 3.0'
pod 'PixateFreestyle'
target :Model do
link_with ['DianaModels']
pod 'ReactiveCocoa', '~> 2.2'
pod 'TMCache', '~> 1.2'
pod 'SSKeychain', '~> 1.2'
pod 'Mantle', '~> 1.3'
pod 'AFNetworking', '~> 1.0'
end
target :Test do
link_with ['DianaTests']
pod 'Kiwi', '~> 2.2'
end
target :View do
link_with ['Diana']
pod 'SVPullToRefresh', '~> 0.4'
pod 'MBProgressHUD', '~> 0.7'
pod 'SWTableViewCell', '~> 0.1'
pod 'MTMigration'
pod 'Masonry'
pod 'TTTAttributedLabel'
pod 'NJKWebViewProgress'
target :ViewDebug do
link_with [
'DianaDev',
'DianaViews'
]
pod 'Reveal-iOS-SDK'
end
end
By the way, I'm using the CocoaPods plugin in the Xcode. But a lot error are output when I check the Install Docs during integration:
Error opening xar archive: /var/folders/3x/mgl299js6k13tlrspqv21n340000gn/T/Model-ReactiveCocoa.xar
Are there some wrong configurations in my CocoaPods or Build Setting in Xcode6.3? Thanks for your help!
ADDED:
Here's my Link Binary With Libraries in the Build Phases. Does the red item mean something is wrong? It looks like this is the cause.

Resources