我正在尝试将Expo SDK从49升级到50,但我无法使ios应用程序运行。 https://expo.dev/changelog/2024/01-18-sdk-50
pods 安装运行没有错误。
当我运行 npx expo run:ios 我得到:
❌ (ios/Pods/Target Support Files/Pods-Dmaze/ExpoModulesProvider.swift:8:8)
6 | */
7 |
> 8 | import ExpoModulesCore
| ^ compiling for iOS 13.0, but module 'ExpoModulesCore' has a minimum deployment target of iOS 13.4: /Users/marvin/Library/Developer/Xcode/DerivedData/Dmaze-eherjphdqufazvbjufezzvmfviqj/Build/Products/Debug-iphonesimulator/ExpoModulesCore/ExpoModulesCore.swiftmodule/arm64-apple-ios-simulator.swiftmodule
9 | import EXConstants
10 | import ExpoFileSystem
11 | import ExpoKeepAwake
❌ (ios/Pods/Target Support Files/Pods-Dmaze/ExpoModulesProvider.swift:8:8)
6 | */
7 |
> 8 | import ExpoModulesCore
| ^ compiling for iOS 13.0, but module 'ExpoModulesCore' has a minimum deployment target of iOS 13.4: /Users/marvin/Library/Developer/Xcode/DerivedData/Dmaze-eherjphdqufazvbjufezzvmfviqj/Build/Products/Debug-iphonesimulator/ExpoModulesCore/ExpoModulesCore.swiftmodule/arm64-apple-ios-simulator.swiftmodule
9 | import EXConstants
10 | import ExpoFileSystem
11 | import ExpoKeepAwake
❌ (ios/Pods/Target Support Files/Pods-Dmaze/ExpoModulesProvider.swift:8:8)
6 | */
7 |
> 8 | import ExpoModulesCore
| ^ compiling for iOS 13.0, but module 'ExpoModulesCore' has a minimum deployment target of iOS 13.4: /Users/marvin/Library/Developer/Xcode/DerivedData/Dmaze-eherjphdqufazvbjufezzvmfviqj/Build/Products/Debug-iphonesimulator/ExpoModulesCore/ExpoModulesCore.swiftmodule/arm64-apple-ios-simulator.swiftmodule
9 | import EXConstants
10 | import ExpoFileSystem
11 | import ExpoKeepAwake
› 3 error(s), and 0 warning(s)
CommandError: Failed to build iOS project. "xcodebuild" exited with error code 65.
我在 Podfile 中将目标设置为 13.4:
require File.join(File.dirname(`node --print "require.resolve('expo/package.json')"`), "scripts/autolinking")
require File.join(File.dirname(`node --print "require.resolve('react-native/package.json')"`), "scripts/react_native_pods")
require 'json'
pod 'AppAuth'
podfile_properties = JSON.parse(File.read(File.join(__dir__, 'Podfile.properties.json'))) rescue {}
ENV['RCT_NEW_ARCH_ENABLED'] = podfile_properties['newArchEnabled'] == 'true' ? '1' : '0'
ENV['EX_DEV_CLIENT_NETWORK_INSPECTOR'] = podfile_properties['EX_DEV_CLIENT_NETWORK_INSPECTOR']
platform :ios, podfile_properties['ios.deploymentTarget'] || '13.4'
为什么要针对 iOS 13.0 进行编译?我怎样才能让它构建为 13.4?
我修好了!
在 Xcode 中更新部署目标: 除了在 Podfile 中设置部署目标之外,您还需要确保在 Xcode 中为您的项目及其所有目标正确设置部署目标。在 Xcode 中打开您的项目,在导航器中选择项目文件,然后对于每个目标(包括主应用程序目标和任何测试目标),转到常规选项卡并将部署目标设置为 iOS 13.4 或更高版本。
我在 Expo 49 和 expo EAS 构建中遇到了类似的错误。有什么办法可以修复它而不从博览会弹出吗?
❌(ios/Pods/FirebaseStorage/FirebaseStorage/Sources/Storage.swift:73:12)
71 |让提供者= ComponentType.instance(对于:StorageProvider.self, 72 | 72在:app.container)
73 |返回provider.storage(对于:Storage.bucket(对于:app)) | ^ 可选类型“?”的值必须解包才能引用包装基类型“any StorageProvider”的成员“storage” 74 | 74 } 75 | 75 76 | 76 /**
❌(ios/Pods/FirebaseStorage/FirebaseStorage/Sources/Storage.swift:88:12)
86 |让提供者= ComponentType.instance(对于:StorageProvider.self, 87 | 87在:app.container)
88 |返回provider.storage(for: Storage.bucket(for: app, urlString: url)) | ^ 可选类型“?”的值必须解包才能引用包装基类型“any StorageProvider”的成员“storage” 89 | 89 } 90 | 90 91 | 91 /**
❌(ios/Pods/FirebaseStorage/FirebaseStorage/Sources/Storage.swift:291:39)
289 |初始化(应用程序:FirebaseApp,存储桶:字符串){ 290 | 290 self.app = 应用程序
291 | auth = ComponentType.instance(for: AuthInterop.self, | ^ 无法分配“?”类型的值输入“任何 AuthInterop” 292 | 292在:应用程序容器) 293 | 293 appCheck = ComponentType.instance(for: AppCheckInterop.self, 294 | 294在:app.container)
❌(ios/Pods/FirebaseStorage/FirebaseStorage/Sources/Storage.swift:293:47)
291 | auth = ComponentType.instance(for: AuthInterop.self, 292 | 292在:app.container)
293 | appCheck = ComponentType.instance(for: AppCheckInterop.self, | ^ 无法分配“?”类型的值输入“任何 AppCheckInterop” 294 | 294在:应用程序容器) 295 | 295存储桶=存储桶 296 | 296主机=“firebasestorage.googleapis.com”
如果您有任何建议,我们将不胜感激!
谢谢。