Swift新手集成AWS工具遇No such module 'AWSCore'错误求助
Hey there! I’ve been stuck with this exact "No such module 'AWSCore'" error when setting up AWS SDKs in Swift, so let’s walk through the most common fixes that worked for me and other developers:
This is the #1 mistake most beginners make: you need to open your project’s .xcworkspace file (generated by CocoaPods), not the .xcodeproj file. If you open the plain project file, Xcode won’t recognize the Pods modules like AWSCore at all.
Sometimes the initial Pod install gets corrupted. Let’s reset it:
- Open Terminal, navigate to your project’s root directory (where your Podfile lives)
- Run
pod deintegrateto completely remove existing Pods integration - Run
pod installto re-download and set up all your Pods - Once done, close Xcode completely and re-open the
.xcworkspacefile
Even if you think it’s correct, a tiny mistake can break things:
- Ensure your Podfile includes
pod 'AWSCore'(or the appropriate AWS Pods you need) with no typos - Verify you’ve specified a minimum platform version that meets AWS SDK requirements (e.g.,
platform :ios, '13.0'— older versions might not be supported) - After editing the Podfile, always run
pod installagain to apply changes
Incorrect build settings can prevent Xcode from finding the Pod modules:
- Open your project in Xcode (via
.xcworkspace), select your main target - Go to Build Settings and search for
Framework Search Paths- Make sure
$(inherited)is included in the list (this tells Xcode to use paths defined by CocoaPods)
- Make sure
- Next, search for
Other Linker Flags- Again, ensure
$(inherited)is present — this links your project to the Pod frameworks correctly
- Again, ensure
Xcode’s cached build files can cause weird module detection issues:
- Press
Cmd + Shift + Kto clean the project - Press
Cmd + Option + Shift + Kto clean the entire build folder - Restart Xcode, then try building your project again
Double-check that you’re using the correct import syntax at the top of your Swift file:
import AWSCore
Make sure there are no typos (case matters here — AWSCore is correct, not awscore or AwsCore).
If none of these work, you might want to check if your macOS/Xcode version is compatible with the AWS SDK version you’re using. AWS regularly updates their SDKs to support newer Xcode/Swift versions, so mismatches can cause issues too.
内容的提问来源于stack exchange,提问作者Bryce Soto

