Resolving AFNetworking and Mailgun-related compiler warnings

I’m trying to get rid of some annoying compiler warnings in my iOS app. These warnings popped up after I added Mailgun and AFNetworking using CocoaPods.

Here’s what I’m seeing:

Warning: SystemConfiguration framework not found
Warning: MobileCoreServices framework not found

The weird thing is, I’ve already imported both SystemConfiguration and MobileCoreServices frameworks in my main project. Despite this, these warnings keep showing up.

What’s even more frustrating is that my app runs perfectly fine! These warnings don’t seem to affect its functionality at all.

I’m wondering if anyone has run into a similar issue before. How can I make these warnings go away? Is there something I’m missing in my project setup?

Any help would be much appreciated. Thanks in advance!

I’ve dealt with similar warnings before when working with AFNetworking and other networking libraries.

First, make sure you’re using the latest versions of both AFNetworking and Mailgun pods, as older versions can sometimes trigger these warnings.

If updating the pods doesn’t work, try manually adding the frameworks to your project’s ‘Link Binary With Libraries’ build phase. Check that SystemConfiguration.framework and MobileCoreServices.framework are included there.

Also, verify your project’s ‘Framework Search Paths’ in Build Settings, ensuring it includes $(SDKROOT)/System/Library/Frameworks.

If warnings persist, consider updating your Podfile to explicitly require these frameworks and run ‘pod install’ again. This should prompt CocoaPods to link the frameworks appropriately.

I encountered similar issues when integrating AFNetworking and other third-party libraries. One solution that worked for me was to clean the project and rebuild it. Sometimes Xcode caches can cause persistent warnings.

Another approach is to check your target’s Build Phases. Ensure that the ‘Copy Pods Resources’ script is present and runs during the build process. This script should handle framework linking for pod dependencies.

If the problem persists, you might want to investigate your project’s Header Search Paths. Make sure they’re correctly set to include the necessary directories for AFNetworking and Mailgun.

Lastly, if none of these steps resolve the issue, consider creating a new target and gradually migrating your code and dependencies. This can sometimes bypass stubborn build configuration problems.

hey, i had this issue too. try updating cocoapods and your pods. if that doesn’t work, check your podfile and add these lines:

pod ‘AFNetworking’
pod ‘Mailgun-iOS’

then do a pod install. that fixed it for me. good luck!