我的專案遇到了一個問題。我在Xcode上的構建中得到了這一堆錯誤(在Visual Studio Code上開發)。
啟動lib/main.dart 在iPhone 11 Pro 在除錯模式...
Xcode構建完成。 1456.2s
構建iOS應用程式失敗
來自Xcode構建的錯誤輸出。
?
**構建失敗 **
Xcode的輸出。
?
/Users/usuario/development/projects/stb/property1/ios/ods/BSImagePicker/Sources/Scene/Albums/AlbumsViewController. swift:26:40: 警告。using 'class' keyword for 協議 繼承 是 廢棄。使用 'AnyObject' 代替
protocol AlbumsViewControllerDelegate。class {
^~~~~
任何物件
/Users/usuario/development/projects/stb/property1/ios/Pods/BSImagePicker/Sources/Scene/Assets/AssetsViewController. swift:26:40: warning: 使用'class'關鍵字for協議繼承是廢棄的;使用'AnyObject'代替
協議 AssetsViewControllerDelegate: class{
^~~~~
任何物件
/Users/usuario/development/projects/stb/property1/ios/Pods/BSImagePicker/Source/Controller/ImagePickerControllerDelegate。 swift:27:48: warning: 使用'class'關鍵字for協議繼承是被廢棄;使用'AnyObject'代替
public protocol ImagePickerControllerDelegate: class {
^~~~~
任何物件
/Users/usuario/development/projects/stb/property1/ios/Pods/BSImagePicker/Sources/Scene/Albums/AlbumsViewController。 swift:26:40: warning: 使用'class'關鍵字for協議繼承是廢棄的;使用'AnyObject'代替
協議AlbumsViewControllerDelegate。class {
^~~~~
任何物件
/Users/usuario/development/projects/stb/property1/ios/Pods/BSImagePicker/Sources/Scene/Assets/AssetsViewController. swift:26:40: warning: 使用'class'關鍵字for協議繼承是廢棄的;使用'AnyObject'代替
協議 AssetsViewControllerDelegate: class{
^~~~~
任何物件
/Users/usuario/development/projects/stb/property1/ios/Pods/BSImagePicker/Source/Controller/ImagePickerControllerDelegate。 swift:27:48: warning: 使用'class'關鍵字for協議繼承是被廢棄;使用'AnyObject'代替
public protocol ImagePickerControllerDelegate: class {
^~~~~
任何物件
/Users/usuario/development/projects/stb/property1/ios/Pods/BSImagePicker/Sources/Scene/Albums/AlbumsViewController。 swift:26:40: warning: 使用'class'關鍵字for協議繼承是廢棄的;使用'AnyObject'代替
協議AlbumsViewControllerDelegate。class {
^~~~~
任何物件
/Users/usuario/development/projects/stb/property1/ios/Pods/BSImagePicker/Sources/Scene/Assets/AssetsViewController. swift:26:40: warning: 使用'class'關鍵字for協議繼承是廢棄的;使用'AnyObject'代替
協議 AssetsViewControllerDelegate: class{
^~~~~
任何物件
/Users/usuario/development/projects/stb/property1/ios/Pods/BSImagePicker/Source/Controller/ImagePickerControllerDelegate。 swift:27:48: warning: 使用'class'關鍵字for協議繼承是被廢棄;使用'AnyObject'代替
public protocol ImagePickerControllerDelegate: class {
^~~~~
任何物件
/Users/usuario/development/projects/stb/property1/ios/Pods/AppAuth/Source/AppAuth/iOS/OIDExternalUserAgentIOSCustomBrowser.m:148:42:警告。'openURL:' is deprecated: first deprecated in iOS 10.0 [-Wdeprecated-declarations]
[[UIApplication sharedApplication] openURL:_appStoreURL]。
^~~~~~~
openURL:options:completionHandler。
在模塊'UIKit'中,從/Users/usuario/development/projects/stb/property1/ios/ods/Target Support Files/AppAuth/AppAuth-prefix.pch匯入:2。
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.5.sdk/System/Library/Frameworks/UIKit. framework/Headers/UIApplication.h:123:1: note: 'openURL:'已明確在此標記為棄用。
- (BOOL)openURL:(NSURL*)url API_DEPRECATED_WITH_REPLACEMENT("openURL:options:completionHandler:"/span>, ios(2.0, 10.0) NS_EXTENSION_UNAVAILABLE_IOS("")。
^
/Users/usuario/development/projects/stb/property1/ios/Pods/AppAuth/Source/AppAuth/iOS/OIDExternalUserAgentIOSCustomBrowser.m:156:61:警告。'openURL:' is deprecated: first deprecated in iOS 10.0 [-Wdeprecated-declarations]
BOOL openedInBrowser = [[UIApplication sharedApplication] openURL:requestURL]。
^~~~~~~
openURL:options:completionHandler。
在模塊'UIKit'中,從/Users/usuario/development/projects/stb/property1/ios/ods/Target Support Files/AppAuth/AppAuth-prefix.pch:2匯入。
1警告生成。
在從/Users/usuario/development/projects/stb/property1/ios/Pods/gRPC-Core/src/core/lib/security/transport/client_auth_filter.cc:32包含的檔案中。
在從/Users/usuario/development/projects/stb/property1/ios/Pods/gRPC-Core/src/core/lib/security/context/security_context.h:28包含的檔案中。
/Users/usuario/development/projects/stb/property1/ios/Pods/gRPC-Core/src/core/lib/security/redentials/redentials. h:205:15: warning: 匿名的非C兼容型別被typedef宣告賦予了typedef鏈接目的;在這里添加一個標簽名[-Wnon-c-typedef-for-linkage]
typedef結構 {
^
資格證書陣列
/Users/usuario/development/projects/stb/property1/ios/Pods/gRPC-Core/src/core/lib/security/redentials/redentials. h:206:21: 注意:由于thisdefault成員初始化器,型別is不兼容C-兼容。
grpc_mdelem* md = nullptr;
^~~~~~~
/Users/usuario/development/projects/stb/property1/ios/Pods/gRPC-Core/src/core/lib/security/redentials/redentials。 h:208:3: note: type is given name 'grpc_credentials_mdelem_array' for linkage purposes by this typedef declaration
} grpc_credentials_mdelem_array;
^
1警告生成。
在從/Users/usuario/development/projects/stb/property1/ios/Pods/gRPC-Core/src/core/ext/transport/chttp2/transport/chttp2_transport.cc:36中包含的檔案。
在從/Users/usuario/development/projects/stb/property1/ios/Pods/gRPC-Core/src/core/ext/transport/chttp2/transport/context_list.h:26包含的檔案中。
/Users/usuario/development/projects/stb/property1/ios/Pods/gRPC-Core/src/core/ext/transport/chttp2/transport/internal。 h:109:15: warning: 匿名的非C-兼容型別被typedef宣告命名為typedef鏈接目的;在這里添加一個標簽名稱[-Wnon-c-typedef-for-linkage]
typedef結構 {
^
呼叫中心
/Users/usuario/development/projects/stb/property1/ios/Pods/gRPC-Core/src/core/ext/transport/chttp2/transport/internal。 h:110:52: 注意:由于thisdefault成員的初始化器,型別is不兼容C-兼容的。
grpc_closure_list lists[GRPC_CHTTP2_PCL_COUNT] = {};
^
打包失敗 /Users/usuario/development/projects/stb/property1。
命令PhaseScriptExecution失敗 with一個非零退出代碼
注意:使用新構建系統。
注意: 構建目標 在并行中
注:計劃構建
注:分析作業區
注:構建構建描述
注:構建準備完成
無法為模擬器構建應用程式。
在iPhone 11 Pro上啟動應用程式時出錯。
退出了(sigterm)。
這種情況是突然發生的,直到今天早上都沒有問題。我之前的問題是:
warning: iOS模擬器的部署目標'IPHONEOS_DEPLOYMENT_TARGET' 是 設定到8. 0,但支持的部署目標版本的范圍是 9.0至14.5.99。
我認為它得到了解決:
我認為它得到了解決。
post_install do|installer|
安裝程式.pods_project.target.each do |target|
構建的目標是什么?
target.build_configurations.each do |config|
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '10.0'。
結束
結束
結束
在PodFile中。
environment:
sdk: ">=2.7.0 <3.0.0"
依賴性。
flutter。
sdk: flutter
提供者。^5.0.0
國際化。^0.17.0 Intl.
carousel_pro: ^1.0.0
url_launcher: ^6.0.3
photo_view: ^0.11.1.
cloud_firestore: ^2.2.1
Firebase_core: ^1.1.1
firebase_auth。^1.1.4
image_picker: ^0.7.5
firebase_storage: ^8.0.6
random_string: ^2.1.0
Algolia: ^1.0.1
custom_switch: ^0.00.1
material_design_icons_flutter: ^4.0.5955.
google_sign_in。^5.0.4.
firebase_dynamic_links: ^2.0.4
分享。^2.00.2
flutter_facebook_login: ^3.0.0
http: ^0.13.3.
sign_in_with_apple: ^3.0.0.
csc_picker: ^0.2.5.
us_states: ^1.1.0
multi_image_picker2: ^5.0.2.
percent_indicator: ^3.0.1
flutter_material_pickers: ^3.1.0 #used on Selling Bathrooms and Bedrooms
挑號者。^2.1.1 #used on 只銷售臥室。
eva_icons_flutter: ^3.0.0
徽章。^2.0.1.
flutter_xlider: ^3.4.0
expandable_text: 2.2.0
google_maps_flutter: ^2.0.6
line_icons: ^2.0.1 line_icons.
intl_phone_field: ^2.0.1 #用于獲取手機在個人資料頁。
flutter_masked_text: ^0.8.0 #用于做過濾器TextFormField的屏蔽為美元值,目前不使用
flutter_absolute_path: ^1.0.6 #用于獲取檔案路徑為多影像。
rxdart: ^0.27.2 #使用用于地理定位查詢與Firebase
geoflutterfire。^3.0.1。
# 以下是將Cupertino Icons字體添加到你的應用程式中。
# 使用with CupertinoIcons class for iOS style icons。
cupertino_icons。^1.0.2
firebase_messaging: ^10.0.6
致:
environment:
sdk: ">=2.7.0 <3.0.0"
依賴性。
flutter。
sdk: flutter
提供者。^6.0.0
國際化。^0.17.0 Intl.
carousel_pro: ^1.0.0
url_launcher: ^6.0.10
photo_view: ^0.12.0
cloud_firestore: ^2.5.3
firebase_core: ^1.6.0
firebase_auth。^3.1.1
image_picker: ^0.8.4 1.
firebase_storage。^10.0.3.
random_string: ^2.3.1.
Algolia: ^1.0.1
custom_switch: ^0.0.1
material_design_icons_flutter: ^4.0.5955.
google_sign_in。^5.1.0
firebase_dynamic_links: ^2.0.9
分享。^2.0.4
#flutter_facebook_login: ^3.0.0
http: ^0.13.3.
sign_in_with_apple: ^3.0.0.
csc_picker: ^0.2.5.
us_states: ^1.1.5
multi_image_picker2: ^5.0.2.
percent_indicator: ^3.00.1
flutter_material_pickers: ^3.1.0 #used on Selling Bathrooms and Bedrooms
挑號者。^2.1.1 #used on 只銷售臥室。
eva_icons_flutter: ^3.0.2
徽章。^2.0.1.
flutter_xlider: ^3.4.0
expandable_text: ^2.2.0
google_maps_flutter。^2.0.9.
line_icons: ^2.0.1 line_icons.
intl_phone_field: ^2.1.0 #用于獲取手機在個人資料頁面。
flutter_masked_text: ^0.8.0 #用于做過濾器TextFormField對美元值的屏蔽,目前不使用
#flutter_absolute_path: ^1.0.6 #用于獲取檔案路徑為多影像
rxdart: ^0.27.2 #使用用于地理定位查詢與Firebase
geoflutterfire。^3.0.1。
# 以下是將Cupertino Icons字體添加到你的應用程式中。
# 使用with CupertinoIcons class for iOS style icons。
cupertino_icons。^1.0.2
firebase_messaging: ^10.0.7
顯然,更新我的代碼以反映這些變化,有什么想法可以讓它回到iOS模擬器中并恢復正常作業?
uj5u.com熱心網友回復:
如果有人面臨這個問題,我管理一個修復,首先在這里我面臨2個問題:
如果有人面臨這個問題,我管理一個修復。
由于Xcode 12中放棄了對iOS 8的支持,我的專案的Pod不再作業了(更多資訊見鏈接)。
為了使其正常作業,我從 Flutter 2.2.0 更新到了 2.5.0,這基本上做了很多改變,并取消了對一些方法的支持,而這些方法正是 Dependencies 的依賴。
為了解決這個問題,我做了兩件事:
從問題2開始,我只是通過使用命令flutter downgrade 2.2.0對我的Flutter進行了降級,這幫助我回到了最初的問題,而沒有面臨那些依賴關系的方法被移除的問題。至于問題1,有以下幾點:
首先將這個問題添加到一個新的應用程式中。
首先在PodFile中添加了這個內容:
post_install do|installer|
安裝程式.pods_project.target.each do |target|
構建的目標是什么?
target.build_configurations.each do |config|
config.build_settings.delete 'IPHONEOS_DEPLOYMENT_TARGET'。
結束
結束
結束
其次,為了解決Pod的問題,我做了以下步驟:
。- 洗掉pubspec.lock檔案。
- 洗掉pubspec.lock檔案。
- 在主專案的終端中
- 做了一個Flutter清理。
- 在終端進入iOS檔案夾:
- 洗掉Podfile.lock 。
- 洗掉Pods檔案夾。
- 重要的是:復制(在任何地方作為備份)PodFile的內容,包括在最后添加的部分。
- 洗掉Podfile.
- 在iOS檔案夾中的終端做一個Pod init。(這將生成帶有基本資訊的Pod檔案)。
- 在iOS檔案夾的終端上做一個Pod安裝。(這將產生Podfile.lock和帶有基本資訊的Pods檔案夾)。
- 在終端中導航到主專案檔案夾(cd ...)或使用pubspec.yaml檔案中的Pub get圖示。
- 做一個flutter pub get
- 在終端進入iOS檔案夾:
- 做一個pod安裝。
- 在終端機中導航到主專案檔案夾(cd ...)
最后,只需做一個flutter運行。
這就是我的方法。
這就是我解決這個問題的方法。
親切的問候
轉載請註明出處,本文鏈接:https://www.uj5u.com/net/332498.html
標籤:
