Home Cocoapods adding search paths for frameworks that aren't in the target
Reply: 0

Cocoapods adding search paths for frameworks that aren't in the target

user3280
1#
user3280 Published in May 28, 2018, 5:03 am

I have an Xcode project which contains a host app and a network extension. The host app uses Firebase; the network extension does not. But every time I run "pod install", some frameworks Firebase depends on are added to HEADER_SEARCH_PATHS and OTHER_CFLAGS. This results in build warnings for the network extension: "Linking against a dylib which is not safe for use in application extensions". Worse, the resulting app can't be uploaded to iTunes Connect because it thinks that these frameworks are being used by the extension, even though they are neither linked nor referenced there.

The changes being made to the xcconfig files in Pods/Target Support Files for the extension look like this:

@@ -1,8 +1,8 @@
 FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Crashlytics/iOS" "${PODS_ROOT}/Fabric/iOS"
 GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
-HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/Crashlytics" "${PODS_ROOT}/Headers/Public/Fabric" "${PODS_ROOT}/Headers/Public/Intercom" "${PODS_ROOT}/Headers/Public/SwiftLint"
+HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/Crashlytics" "${PODS_ROOT}/Headers/Public/Fabric" "${PODS_ROOT}/Headers/Public/Firebase" "${PODS_ROOT}/Headers/Public/FirebaseAnalytics" "${PODS_ROOT}/Headers/Public/FirebaseCore" "${PODS_ROOT}/Headers/Public/FirebaseInstanceID" "${PODS_ROOT}/Headers/Public/FirebaseMessaging" "${PODS_ROOT}/Headers/Public/Intercom" "${PODS_ROOT}/Headers/Public/SwiftLint"
 LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' '@executable_path/../../Frameworks'
-OTHER_CFLAGS = $(inherited)  -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/Crashlytics" -isystem "${PODS_ROOT}/Headers/Public/Fabric" -isystem "${PODS_ROOT}/Headers/Public/Intercom" -isystem "${PODS_ROOT}/Headers/Public/SwiftLint"
+OTHER_CFLAGS = $(inherited)  -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/Crashlytics" -isystem "${PODS_ROOT}/Headers/Public/Fabric" -isystem "${PODS_ROOT}/Headers/Public/Firebase" -isystem "${PODS_ROOT}/Headers/Public/FirebaseAnalytics" -isystem "${PODS_ROOT}/Headers/Public/FirebaseCore" -isystem "${PODS_ROOT}/Headers/Public/FirebaseInstanceID" -isystem "${PODS_ROOT}/Headers/Public/FirebaseMessaging" -isystem "${PODS_ROOT}/Headers/Public/Intercom" -isystem "${PODS_ROOT}/Headers/Public/SwiftLint"
 OTHER_LDFLAGS = $(inherited) -ObjC -l"c++" -l"z" -framework "Crashlytics" -framework "Fabric" -framework "Security" -framework "SystemConfiguration" -framework "UIKit"
 PODS_BUILD_DIR = $BUILD_DIR
 PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)

My podfile is below. What can I do to fix this?

platform :ios, '9.3'
use_frameworks!

def app_target_pods
  pod 'Firebase/Core'
  pod 'Firebase/Messaging'
  pod 'Crashlytics'
  pod 'Fabric'
  pod 'Intercom'
  pod 'SwiftLint'
  pod 'SwiftKeychainWrapper'
end

def extension_target_pods
    pod 'Crashlytics'
    pod 'Fabric'
end

target ’App Target' do
  app_target_pods
end

target ’Extension Target' do
  extension_target_pods
end
You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.305079 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO