skip to Main Content

I’m trying to implement MoPub into my Swift app, but in some of the files that are provided by the MoPub pod there are errors saying Cannot find type 'SKAdImpression' in scope. I also cannot import MoPub in my own documents. I tried running pod update restarting xcode, and making sure I am using the .xcworkspace file

Edit: I just re-read the apple documentation, and noticed that it says SKAdImpression is an iOS 14.5+ feature. The version of Xcode I have is for iOS 14.4, so it makes sense as to why it cannot be found. My only concern is, does this mean that my app will only work on iOS 14.5+?

Edit 2: My mac does not support the latest MacOS which is required for the latest Xcode for 14.5. Is there anything I can do to get MoPub working anyway?

2

Answers


  1. Take the version out.

    pod ‘mopub-ios-sdk’

    run pod install

    Alternatively you can follow this from their guide:

    simply import MoPubSDK/MoPub-Bridging-Header.h to your project and
    ensure that the Objective-C Bridging Header build setting under Swift
    Compiler – Code Generation has a path to the header.

    They also have a sample program, take a look at that as well. You can find it here:
    https://github.com/mopub/mopub-ios-sdk/tree/master/Canary

    Also, make sure you have the project closed out before you run pod install. I have seen issues in the past when this happens.

    Login or Signup to reply.
  2. The version of Xcode I have is for iOS 14.4
    My mac does not support the latest MacOS

    Bad news is that is there is no other way around this error, as far as I can see.
    What did not help:

    • Removing the version, pod 'mopub-ios-sdk' and running pod install of pod update again.
    • Cleaning Build Folder.
    • Cleaning the /DerivedData folder.

    What did help:

    • Updating Xcode to the 12.5 version.
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search