segmentio / analytics-ios

The hassle-free way to integrate analytics into any iOS application.
https://segment.com/libraries/ios
MIT License
398 stars 333 forks source link

duplicate definition of category 'SEGApplicationProtocol' on interface 'UIApplication' #970

Closed airowe closed 3 years ago

airowe commented 3 years ago

This message is the only indicator something is wrong when attempting to build me app in CircleCI (I can build manually through xcode). Any ideas on what could be causing this? Potentially conflicting cocoapods?

source 'https://cdn.cocoapods.org/'
platform :ios, '11.0'
use_frameworks!
inhibit_all_warnings!

pod 'ActiveLabel'
pod 'Alamofire', '~> 5.0.5'
pod 'Analytics', '~> 4.1.1'
pod 'Apollo', '~> 0.25.1'
pod 'CenterAlignedCollectionViewFlowLayout'
pod 'Firebase/Crashlytics'
pod 'Firebase/Analytics'
pod 'FBSDKCoreKit/Swift', '~> 6.2.0'
pod 'FBSDKLoginKit/Swift', '~> 6.2.0'
pod 'GoogleSignIn'
pod 'Iterable-iOS-SDK', '6.2.9'
pod 'MaterialComponents/TextFields'
pod 'MaterialComponents/Snackbar'
pod 'MBProgressHUD', '~> 1.2.0'
pod 'NewRelicAgent', '~> 6.10.0'
pod 'ObjectMapper', '3.5.2'
pod 'PhoneNumberKit', '~> 3.2.0'
pod 'SDWebImage', '~> 3.7.6'
pod 'SwiftLint'
pod 'XCGLogger', '~> 7.0.1'

target 'Target' do
  inherit! :complete
  pod 'Reveal-SDK', :configurations => [
        'Debug-Localhost',
        'Debug-Production',
        'Debug-Staging'
      ]
  post_install do |installer|
    installer.pods_project.targets.each do |target|
      target.build_configurations.each do |config|
        config.build_settings.delete 'IPHONEOS_DEPLOYMENT_TARGET'
      end
    end
  end
end

target 'Tests' do
  inherit! :complete
end

target 'UITests' do
  inherit! :complete
end
migs647 commented 3 years ago

Is CircleCI set up with Xcode 12.x or 11.x? Do you have caching enabled on CircleCI?

airowe commented 3 years ago

Is CircleCI set up with Xcode 12.x or 11.x? Do you have caching enabled on CircleCI?

11.x, but I can update it if needed. Yes, caching is enabled.

bsneed commented 3 years ago

Please post the actual error message output if you can.

gyulavoros commented 3 years ago

We had similar issues. We use Carthage, and I bumped into the following:

I'm wondering why Analytics is still a target for Carthage: Carthage/Build/.analytics-ios.version

{
  "commitish" : "4.1.2",
  "iOS" : [
    {
      "name" : "Analytics",
      "hash" : "6a59db87a3be5811335ea20c9cc935fe6f9562b0a3a457831cb345856afad444",
      "linking" : "dynamic"
    },
    {
      "name" : "Segment",
      "hash" : "b3ba842433810a2b17dd20bd3491dc36bb26d792647796cbc526805a8f78a6b9",
      "linking" : "dynamic"
    }
  ]
}
bsneed commented 3 years ago

Hmm, not sure why it'd still show as a target. Could it be an artifact of the rename that once cleaned up is ok? Closing this for now. Please reopen if necessary.