4

I'm maintaining a project that uses last cocoapods 1.10.0, with Firebase and Admob installed. It uses cocoapods-binary 0.4.4 to pre-compile some pods and increase build speed. As you can see below in the podfile.lock it's using the last versions of firebase and Admob, but it was giving me problems with the new Admob so It was necessary for me to put :binary => false in admob and firebase pods to avoid that problems. That line means that you don't want to pre-compile those pods.

Without writing :binary => false in Firebase, I can successfully do import FirebaseAnalytics but when I do :binary => false in firebase, then, I'm getting No such module 'FirebaseAnalytics'

I already searched for questions with No such module 'FirebaseAnalytics' here in Stack Overflow and tried all the solutions, but those questions are not related with using cocoapods-binary and :binary => false and after trying all the proposed solutions in those questions, none of them worked. For example tried this https://stackoverflow.com/a/44486792/479886 and did not work.

How can I solve this error?

podfile:

plugin 'cocoapods-binary'

platform :ios, '10.0'
use_frameworks!
inhibit_all_warnings!

all_binary!
enable_bitcode_for_prebuilt_frameworks!

#source 'https://github.com/CocoaPods/Specs.git'

def xcode_tool_pods
    pod 'SwiftLint', '<= 0.20.1' # SwiftLint, para limpieza de código
    pod 'SwiftGen', '~> 5.0' # Generador de código a partir de Assets, .strings, colores...
end

def firebase_pods
    pod 'Firebase/Core', :binary => false # Firebase Core, it includes Analytics
    pod 'Firebase/Messaging', :binary => false # Cloud Messaging
    pod 'Firebase/InAppMessaging', :binary => false # In App Messaging
end

def ads_pods
    pod 'Google-Mobile-Ads-SDK', '7.69.0', :binary => false, :configurations => ['Debug Ads', 'Release Ads'] # Google Ad Mob
    pod 'AdColony', '4.1.4', :configurations => ['Debug Ads', 'Release Ads'] # AdColony
    pod 'FBAudienceNetwork', '5.9.0', :configurations => ['Debug Ads', 'Release Ads'] # Facebook Audience Network
    pod 'StartAppSDK', '4.5.0', :binary => false, :configurations => ['Debug Ads', 'Release Ads'] # startapp
end

target 'Capo' do

    # Xcode Tools
    xcode_tool_pods

    pod 'SwiftyBeaver', '~> 1.9.1' # Logging
    pod 'SnapKit', '~> 5.0.1' # Autolayout
    pod 'FileKit', '~> 5.2.0' # archivos
    pod 'SQLite.swift', '~> 0.12.2' # SQLite
    pod 'Alamofire', '~> 5.1.0' # Networking
    pod 'SwiftLocation', '~> 4.2.0' # Location Manager
    pod 'SwiftyJSON', '~> 5.0.0' # JSON Utility
    pod 'UIColor_Hex_Swift', '~> 5.1.0' # Hex Colors
    pod 'ReachabilitySwift', '~> 5.0.0' # Reachability
    pod 'DeviceKit', '~> 3.2.0' # Device Info
    pod 'SwiftDate', '~> 6.1.0' # Date Utils
    pod 'FeedKit', '~> 9.1.2' # RSS Feed Parser
    pod 'Toast-Swift', '~> 5.0.1' # Toast messages in views
    pod 'HDAugmentedReality', '~> 3.0.0' # AR
    pod 'FSCalendar', '~> 2.8.1' # Calendar
    pod 'Haptica', '~> 3.0.2' # Haptic feedback generator
    pod 'CleverTap-iOS-SDK', '~> 3.8.0' # CleverTap 
    
    # Firebase
    firebase_pods
    
    # Ads
    ads_pods
  
    
end

# add Pods that you want to forze using swift 3, example: swift_3_pods = ['SwiftLocation']
swift_4_pods = ['HDAugmentedReality']

post_install do |installer|
    installer.pods_project.build_configurations.each do |config|
        config.build_settings['CODE_SIGNING_ALLOWED'] = 'NO'
        config.build_settings['CODE_SIGNING_REQUIRED'] = 'NO'
    end
    installer.pods_project.targets.each do |target|
        target.build_configurations.each do |config|
            config.build_settings['OTHER_SWIFT_FLAGS'] = ['$(inherited)', '-Onone']
            config.build_settings['SWIFT_OPTIMIZATION_LEVEL'] = '-Owholemodule'
            config.build_settings['DEBUG_INFORMATION_FORMAT'] = 'dwarf'
            
            # the new xcode version requires a minimum deployment target of 9, so if the pods have less than 9, I set 9
#            if Gem::Version.new('9.0') > Gem::Version.new(config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'])
#                config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '9.0'
#            end
        end
        
        if swift_4_pods.include? target.name
            target.build_configurations.each do |config|
                config.build_settings['SWIFT_VERSION'] = '4.2'
            end
        end
    end
end

podfile.lock

PODS:
  - AdColony (4.1.4)
  - Alamofire (5.1.0)
  - CleverTap-iOS-SDK (3.8.2):
    - SDWebImage (~> 5.1)
  - DeviceKit (3.2.0)
  - FBAudienceNetwork (5.9.0):
    - FBSDKCoreKit/Basics (>= 5.6.0)
  - FBSDKCoreKit/Basics (8.2.0)
  - FeedKit (9.1.2)
  - FileKit (5.2.0)
  - Firebase/Analytics (7.2.0):
    - Firebase/Core
  - Firebase/Core (7.2.0):
    - Firebase/CoreOnly
    - FirebaseAnalytics (= 7.2.0)
  - Firebase/CoreOnly (7.2.0):
    - FirebaseCore (= 7.2.0)
  - Firebase/InAppMessaging (7.2.0):
    - Firebase/CoreOnly
    - FirebaseInAppMessaging (~> 7.2.0-beta)
  - Firebase/Messaging (7.2.0):
    - Firebase/CoreOnly
    - FirebaseMessaging (~> 7.2.0)
  - FirebaseABTesting (7.2.0):
    - FirebaseCore (~> 7.0)
  - FirebaseAnalytics (7.2.0):
    - FirebaseCore (~> 7.0)
    - FirebaseInstallations (~> 7.0)
    - GoogleAppMeasurement (= 7.2.0)
    - GoogleUtilities/AppDelegateSwizzler (~> 7.0)
    - GoogleUtilities/MethodSwizzler (~> 7.0)
    - GoogleUtilities/Network (~> 7.0)
    - "GoogleUtilities/NSData+zlib (~> 7.0)"
    - nanopb (~> 2.30906.0)
  - FirebaseCore (7.2.0):
    - FirebaseCoreDiagnostics (~> 7.0)
    - GoogleUtilities/Environment (~> 7.0)
    - GoogleUtilities/Logger (~> 7.0)
  - FirebaseCoreDiagnostics (7.2.0):
    - GoogleDataTransport (~> 8.0)
    - GoogleUtilities/Environment (~> 7.0)
    - GoogleUtilities/Logger (~> 7.0)
    - nanopb (~> 2.30906.0)
  - FirebaseInAppMessaging (7.2.0-beta):
    - FirebaseABTesting (~> 7.0)
    - FirebaseCore (~> 7.0)
    - FirebaseInstallations (~> 7.0)
    - GoogleUtilities/Environment (~> 7.0)
    - nanopb (~> 2.30906.0)
  - FirebaseInstallations (7.2.0):
    - FirebaseCore (~> 7.0)
    - GoogleUtilities/Environment (~> 7.0)
    - GoogleUtilities/UserDefaults (~> 7.0)
    - PromisesObjC (~> 1.2)
  - FirebaseInstanceID (7.2.0):
    - FirebaseCore (~> 7.0)
    - FirebaseInstallations (~> 7.0)
    - GoogleUtilities/Environment (~> 7.0)
    - GoogleUtilities/UserDefaults (~> 7.0)
  - FirebaseMessaging (7.2.0):
    - FirebaseCore (~> 7.0)
    - FirebaseInstanceID (~> 7.0)
    - GoogleUtilities/AppDelegateSwizzler (~> 7.0)
    - GoogleUtilities/Environment (~> 7.0)
    - GoogleUtilities/Reachability (~> 7.0)
    - GoogleUtilities/UserDefaults (~> 7.0)
  - FSCalendar (2.8.2)
  - Google-Mobile-Ads-SDK (7.69.0):
    - GoogleAppMeasurement (~> 7.0)
    - GoogleUserMessagingPlatform (~> 1.1)
  - GoogleAppMeasurement (7.2.0):
    - GoogleUtilities/AppDelegateSwizzler (~> 7.0)
    - GoogleUtilities/MethodSwizzler (~> 7.0)
    - GoogleUtilities/Network (~> 7.0)
    - "GoogleUtilities/NSData+zlib (~> 7.0)"
    - nanopb (~> 2.30906.0)
  - GoogleDataTransport (8.0.1):
    - nanopb (~> 2.30906.0)
  - GoogleUserMessagingPlatform (1.4.0)
  - GoogleUtilities/AppDelegateSwizzler (7.1.1):
    - GoogleUtilities/Environment
    - GoogleUtilities/Logger
    - GoogleUtilities/Network
  - GoogleUtilities/Environment (7.1.1):
    - PromisesObjC (~> 1.2)
  - GoogleUtilities/Logger (7.1.1):
    - GoogleUtilities/Environment
  - GoogleUtilities/MethodSwizzler (7.1.1):
    - GoogleUtilities/Logger
  - GoogleUtilities/Network (7.1.1):
    - GoogleUtilities/Logger
    - "GoogleUtilities/NSData+zlib"
    - GoogleUtilities/Reachability
  - "GoogleUtilities/NSData+zlib (7.1.1)"
  - GoogleUtilities/Reachability (7.1.1):
    - GoogleUtilities/Logger
  - GoogleUtilities/UserDefaults (7.1.1):
    - GoogleUtilities/Logger
  - Haptica (3.0.2)
  - HDAugmentedReality (3.0.0)
  - nanopb (2.30906.0):
    - nanopb/decode (= 2.30906.0)
    - nanopb/encode (= 2.30906.0)
  - nanopb/decode (2.30906.0)
  - nanopb/encode (2.30906.0)
  - NWPusher (0.7.5)
  - PromisesObjC (1.2.11)
  - ReachabilitySwift (5.0.0)
  - SDWebImage (5.10.0):
    - SDWebImage/Core (= 5.10.0)
  - SDWebImage/Core (5.10.0)
  - SnapKit (5.0.1)
  - SQLite.swift (0.12.2):
    - SQLite.swift/standard (= 0.12.2)
  - SQLite.swift/standard (0.12.2)
  - StartAppSDK (4.5.0)
  - SwiftDate (6.1.0)
  - SwiftGen (5.3.0)
  - SwiftLint (0.20.1)
  - SwiftLocation (4.2.0)
  - SwiftyBeaver (1.9.3)
  - SwiftyJSON (5.0.0)
  - Toast-Swift (5.0.1)
  - UIColor_Hex_Swift (5.1.0)

DEPENDENCIES:
  - AdColony (= 4.1.4)
  - Alamofire (~> 5.1.0)
  - CleverTap-iOS-SDK (~> 3.8.0)
  - DeviceKit (~> 3.2.0)
  - FBAudienceNetwork (= 5.9.0)
  - FeedKit (~> 9.1.2)
  - FileKit (~> 5.2.0)
  - Firebase/Analytics
  - Firebase/Core
  - Firebase/InAppMessaging
  - Firebase/Messaging
  - FSCalendar (~> 2.8.1)
  - Google-Mobile-Ads-SDK (= 7.69.0)
  - Haptica (~> 3.0.2)
  - HDAugmentedReality (~> 3.0.0)
  - NWPusher
  - ReachabilitySwift (~> 5.0.0)
  - SnapKit (~> 5.0.1)
  - SQLite.swift (~> 0.12.2)
  - StartAppSDK (= 4.5.0)
  - SwiftDate (~> 6.1.0)
  - SwiftGen (~> 5.0)
  - SwiftLint (<= 0.20.1)
  - SwiftLocation (~> 4.2.0)
  - SwiftyBeaver (~> 1.9.1)
  - SwiftyJSON (~> 5.0.0)
  - Toast-Swift (~> 5.0.1)
  - UIColor_Hex_Swift (~> 5.1.0)

SPEC REPOS:
  trunk:
    - AdColony
    - Alamofire
    - CleverTap-iOS-SDK
    - DeviceKit
    - FBAudienceNetwork
    - FBSDKCoreKit
    - FeedKit
    - FileKit
    - Firebase
    - FirebaseABTesting
    - FirebaseAnalytics
    - FirebaseCore
    - FirebaseCoreDiagnostics
    - FirebaseInAppMessaging
    - FirebaseInstallations
    - FirebaseInstanceID
    - FirebaseMessaging
    - FSCalendar
    - Google-Mobile-Ads-SDK
    - GoogleAppMeasurement
    - GoogleDataTransport
    - GoogleUserMessagingPlatform
    - GoogleUtilities
    - Haptica
    - HDAugmentedReality
    - nanopb
    - NWPusher
    - PromisesObjC
    - ReachabilitySwift
    - SDWebImage
    - SnapKit
    - SQLite.swift
    - StartAppSDK
    - SwiftDate
    - SwiftGen
    - SwiftLint
    - SwiftLocation
    - SwiftyBeaver
    - SwiftyJSON
    - Toast-Swift
    - UIColor_Hex_Swift

SPEC CHECKSUMS:
  AdColony: fc02f429d6c4591567c7ae1426ebfcecb704b11f
  Alamofire: 9d5c5f602928e512395b30950c5984eca840093c
  CleverTap-iOS-SDK: e3fe181d9d2f4537c8389a55db8d568c69104a68
  DeviceKit: d081659419cce07c0b5239dbc9fb39ed7413c7fe
  FBAudienceNetwork: 648648b13d8ea3d39676542dece2b04dbe867497
  FBSDKCoreKit: 4afd6ff53d8133a433dbcda44451c9498f8c6ce4
  FeedKit: 71653273ab08e618cd6fd1301ca08fc02dca6a9e
  FileKit: 10bfd8a3023a0b09f24c9f49546cbbddf43fd464
  Firebase: 456eeacc158d8c58586b7871619a81bb9f27d4ae
  FirebaseABTesting: 55ed7b94464eee98180d91131f3c85e554ae243d
  FirebaseAnalytics: 2673264e482b428df13786b59165ebf420881d7a
  FirebaseCore: c959e8a598f83125c01c1700d9161b236ab3833c
  FirebaseCoreDiagnostics: 2d508e12e77e9691ca67d1669b91ee80f0985b29
  FirebaseInAppMessaging: 6a136aee1c49a12d8f63d8eb73c0799188f1a9ca
  FirebaseInstallations: 9ab3a9a6522e687f59ff9bcfd92949ac85073f3c
  FirebaseInstanceID: 68d2fa458c0c6adfde0007ffe35b51a37b163dec
  FirebaseMessaging: 7091222bfac24ca89c569c3c59e58390311e487f
  FSCalendar: e6a2eb9c571bf0719ed797ef807e08426753c241
  Google-Mobile-Ads-SDK: 2f288748a42920d1c744946a460896a95b0e9110
  GoogleAppMeasurement: 57a0df93dc2feb5176b1bac06012dbd725191ba5
  GoogleDataTransport: e4085e6762f36a6141738f46b0153473ce57fb18
  GoogleUserMessagingPlatform: b168e8c46cd8f92aa3e34b584c4ca78a411ce367
  GoogleUtilities: 3dc4ff0d5e4840e2fa8eef0889620e8c33d4218c
  Haptica: dc206651beeca25ab4744c633fbf0ae4d1e86baf
  HDAugmentedReality: ff518e9c08704261b4226ffa820464aa5a9b1626
  nanopb: 1bf24dd71191072e120b83dd02d08f3da0d65e53
  NWPusher: 9b29a44754d88cb02c28a1e9bc8750845506123e
  PromisesObjC: 8c196f5a328c2cba3e74624585467a557dcb482f
  ReachabilitySwift: 985039c6f7b23a1da463388634119492ff86c825
  SDWebImage: 9169792e9eec3e45bba2a0c02f74bf8bd922d1ee
  SnapKit: 97b92857e3df3a0c71833cce143274bf6ef8e5eb
  SQLite.swift: d2b4642190917051ce6bd1d49aab565fe794eea3
  StartAppSDK: d4680feb85ffb81d42b247f1a68affb56625ba7e
  SwiftDate: fa2bb3962056bb44047b4b85a30044e5eae30b03
  SwiftGen: 4379bd3640b0a212a0f6ea3c494adba385513d10
  SwiftLint: f60095dc173a3f3ec505bb34f5229c3dfd779a54
  SwiftLocation: 609ac8859f2c5d48a6cadd2a58c63b1dae02dc25
  SwiftyBeaver: 2e8acd6fc90c6d0a27055867a290794926d57c02
  SwiftyJSON: 36413e04c44ee145039d332b4f4e2d3e8d6c4db7
  Toast-Swift: 9b6a70f28b3bf0b96c40d46c0c4b9d6639846711
  UIColor_Hex_Swift: 8be7432edacb7fa91c78aa05ef3c30b66e4f9415

PODFILE CHECKSUM: 49701bf530550be2c8076ba6ab46c4f64813049b

COCOAPODS: 1.10.0
halfer
  • 19,824
  • 17
  • 99
  • 186
NullPointerException
  • 36,107
  • 79
  • 222
  • 382

1 Answers1

1

I've had similar problems and developed my own utility Rugby. You can find more info on the repository page.

In your case just try to exclude one pod:

pod install && rugby --exclude Firebase

Feel free to contact me if you have any issues.

SwiftyFinch
  • 445
  • 2
  • 12