No such module 'RestKit' with cocoapods and swift

后端 未结 25 2122
再見小時候
再見小時候 2020-12-01 02:34

I am having this problem with a brand new project. This problem happens with both RestKit and Facebook SDK. Strangely SwiftyJSON works just fine. I create a brand new swift

相关标签:
25条回答
  • 2020-12-01 02:59

    Things I tried:

    • Removing and re-adding linked pods framework
    • Cleaning
    • Deleting derived data
    • pod install again

    The only solution I had to this problem was to expose the Pods-(yourapp) target in the scheme picker (next to the run/stop buttons) and manually build that Pods- target before building and running my main app target again. I hope this can save someone 10 minutes!

    0 讨论(0)
  • 2020-12-01 03:00

    I had a similar problem. Not with RestKit specifically, but initially with the HockeySDK. I tried everything, including removing and reinstalling pods, updating cocoapods itself and updating pods, deleting derived data, cleaning the project, etc.

    I then noticed that every pod was an issue for me. After continuing to search on related topics, I finally discovered that under:

    • Target > Build Phases > Link Binary With Libraries

    I had a misplaced Pods framework (likely from a prior Pods setup or install attempt).

    Target > Build Phases > Link Binary With Libraries

    After removing it, the problem went away. I have noticed that people seemed to experience similar problems under:

    • Project > Info > Configurations

    as well, where the Pods framework was being mapped incorrectly. So if the first doesn't work for you, you may want to check on the second as well.

    0 讨论(0)
  • 2020-12-01 03:01

    For me, 'Find implicit Dependencies' was unchecked. and it was the issue. Worked fine once I checked it.

    The path: Edit Scheme > Build > Find implicit Dependencies

    0 讨论(0)
  • 2020-12-01 03:04

    I had a similar issue when adding Fabric to my project. I had multiple targets (Release and Dev). It would throw No Such Module for import Fabric. What worked for me was to go to Project> Build Phases > Link Binary with Libraries and simply marking the status of both the pod framework as Optional.

    0 讨论(0)
  • 2020-12-01 03:05

    I also had this issue after renaming my project and modifying the build schemes. After hours of trying to get it to work, I found out what caused the issues for me.

    CocoaPods auto-generates build schemes for each library you import. When you rename your project build configurations, these schemes are not updated with the same configurations, because they are in a separate .xcodeproject.

    The steps to resolve this were easy:

    1. In Xcode, on the top left, select your build scheme and "Manage Schemes..."
    2. Remove all build schemes related to "Pods project"
    3. Close Xcode, run pod deintegrate and pod install

    After this, you can open Xcode and the build should now work.

    0 讨论(0)
  • 2020-12-01 03:07

    This happened to me when an app extension had a different target iOS version than the app. Making them match fixed this for me.

    0 讨论(0)
提交回复
热议问题