I have created this sample Swift framework which has GoogleMobileAds
in it integrated through Cocoapods. I have a class NativeAdView
which inherits from GADNativeAdView
.
import GoogleMobileAds
@objc public class NativeAdView: GADNativeAdView {
}
I also have a sample target which is an Objective-C app. I import the framework header as below in my AppDelegate.m.
#import <SampleFramework/SampleFramework-Swift.h>
Now when I run the Objective-C target it throws an error inside the file SampleFramework-Swift.h
@import GoogleMobileAds; -------- Module 'GoogleMobileAds' not found.
However, if I change the parent class of NativeAdView
to anything other than a Google ad class the error goes away and the build compiles and runs successfully.
Also @import GoogleMobileAds;
line goes away from SampleFramework-Swift.h file
I can't figure out what is happening.
Github link - https://github.com/rishabdutta/FrameworkSample