执行pod install报错:无法确定AdewoleFarmApp目标的平台
解决Cocoapods安装Amplify时「无法确定目标平台」的错误
出现[!] Unable to determine the platform for the 'AdewoleFarmApp' target错误的核心原因是Podfile未明确指定项目的平台版本——默认的平台配置行被注释掉了。
解决步骤:
- 打开你的Podfile,取消第一行
# platform :ios, '9.0'的注释,根据项目实际需求修改iOS版本号(Amplify Swift目前要求最低iOS 13.0,建议设置为platform :ios, '13.0') - 修改后的Podfile示例:
# Uncomment the next line to define a global platform for your project platform :ios, '13.0' target 'AdewoleFarmApp' do # Comment the next line if you don't want to use dynamic frameworks use_frameworks! # Pods for AdewoleFarmApp pod 'Amplify' pod 'AmplifyPlugins/AWSCognitoAuthPlugin' pod 'AWSPredictionsPlugin' pod 'CoreMLPredictionsPlugin' end
- 保存Podfile后,重新执行
pod install命令
额外排查点:
若问题仍存在,确认Xcode项目的Deployment Target版本与Podfile中指定的平台版本一致,版本不匹配也可能触发同类错误。
内容的提问来源于stack exchange,提问作者Wilson Agene
相关产品推荐
相关产品推荐

