Technology Blogs by SAP
Learn how to extend and personalize SAP applications. Follow the SAP technology blog for insights into SAP BTP, ABAP, SAP Analytics Cloud, SAP HANA, and more.
cancel
Showing results for 
Search instead for 
Did you mean: 
former_member190800
Contributor

Wanted to share a quick-fix for an issue that came up this morning, when converting an iOS app from using Maven, to using CocoaPods.

With Maven, or just using the SAP Mobile SDK generally, you've needed to set values for HEADER_SEARCH_PATHS, LIBRARY_SEARCH_PATHS, and "Other Linker Flags".  With CocoaPods, you no longer need to, since they are supplied by build-scripts.

With the newest version of CocoaPods, I got the following warning on pod install:

[!] The `SAPCRMOData [Debug]` target overrides the `OTHER_LDFLAGS` build setting defined in `Pods/Target Support Files/Pods-SAPCRMOData/Pods-SAPCRMOData.debug.xcconfig'. This can lead to problems with the CocoaPods installation

    - Use the `$(inherited)` flag, or

    - Remove the build settings from the target.

[!] The `SAPCRMOData [Release]` target overrides the `OTHER_LDFLAGS` build setting defined in `Pods/Target Support Files/Pods-SAPCRMOData/Pods-SAPCRMOData.release.xcconfig'. This can lead to problems with the CocoaPods installation

    - Use the `$(inherited)` flag, or

    - Remove the build settings from the target.

(OTHER_LDFLAGS == "Other Linker Flags")

The previous developer had set the -all_load and -ObjC flags in the project Build Settings, and they were stepping on the flags which would be set by the CocoaPods script at compile-time.  As a result, I was getting errors in my xCode console that looked like this:

ld: symbol(s) not found for architecture i386

I knew my libraries were all in the correct places, so I looked back at the CocoaPods warning.  Sure enough, when I replaced the -all_load & -ObjC linker flags with $(inherited), the field immediately updated with the following:

-ObjC -lAfariaSLL -lCache -lClientHubSLL -lClientLog -lConnectivity -lCoreServices -lDatavault -lE2ETrace -lE2ETrace2 -lHttpConvAuthFlows -lHttpConversation -lLogger -lMAFFormatters -lMAFLogViewer -lMAFLogger -lMAFLogonManagerNG -lMAFLogonUING -lMAFUIComponents -lMAFUIHelper -lMAFZipHelper -lMobilePlace -lODataAPI -lODataOffline -lODataOnline -lParser -lPerformanceLib -lRequest -lSupportability -lUsage -lXScriptParser -lc++ -lcrypto -lsqlcipher -lssl -lstdc++.6.0.9 -lz -framework CFNetwork -framework CoreData -framework CoreFoundation -framework MessageUI -framework MobileCoreServices -framework Security -framework SystemConfiguration

And, the project built correctly!