【发布时间】:2021-09-17 19:52:43
【问题描述】:
我的项目有问题。我在 Xcode 上构建(在 Visual Studio 代码上开发)时遇到了一堆错误。
Launching lib/main.dart on iPhone 11 Pro in debug mode...
Xcode build done. 1456.2s
Failed to build iOS app
Error output from Xcode build:
↳
** BUILD FAILED **
Xcode's output:
↳
/Users/usuario/development/projects/stb/property1/ios/Pods/BSImagePicker/Sources/Scene/Albums/AlbumsViewController.swift:26:40: warning: using 'class' keyword for protocol inheritance is deprecated; use 'AnyObject' instead
protocol AlbumsViewControllerDelegate: class {
^~~~~
AnyObject
/Users/usuario/development/projects/stb/property1/ios/Pods/BSImagePicker/Sources/Scene/Assets/AssetsViewController.swift:26:40: warning: using 'class' keyword for protocol inheritance is deprecated; use 'AnyObject' instead
protocol AssetsViewControllerDelegate: class {
^~~~~
AnyObject
/Users/usuario/development/projects/stb/property1/ios/Pods/BSImagePicker/Sources/Controller/ImagePickerControllerDelegate.swift:27:48: warning: using 'class' keyword for protocol inheritance is deprecated; use 'AnyObject' instead
public protocol ImagePickerControllerDelegate: class {
^~~~~
AnyObject
/Users/usuario/development/projects/stb/property1/ios/Pods/BSImagePicker/Sources/Scene/Albums/AlbumsViewController.swift:26:40: warning: using 'class' keyword for protocol inheritance is deprecated; use 'AnyObject' instead
protocol AlbumsViewControllerDelegate: class {
^~~~~
AnyObject
/Users/usuario/development/projects/stb/property1/ios/Pods/BSImagePicker/Sources/Scene/Assets/AssetsViewController.swift:26:40: warning: using 'class' keyword for protocol inheritance is deprecated; use 'AnyObject' instead
protocol AssetsViewControllerDelegate: class {
^~~~~
AnyObject
/Users/usuario/development/projects/stb/property1/ios/Pods/BSImagePicker/Sources/Controller/ImagePickerControllerDelegate.swift:27:48: warning: using 'class' keyword for protocol inheritance is deprecated; use 'AnyObject' instead
public protocol ImagePickerControllerDelegate: class {
^~~~~
AnyObject
/Users/usuario/development/projects/stb/property1/ios/Pods/BSImagePicker/Sources/Scene/Albums/AlbumsViewController.swift:26:40: warning: using 'class' keyword for protocol inheritance is deprecated; use 'AnyObject' instead
protocol AlbumsViewControllerDelegate: class {
^~~~~
AnyObject
/Users/usuario/development/projects/stb/property1/ios/Pods/BSImagePicker/Sources/Scene/Assets/AssetsViewController.swift:26:40: warning: using 'class' keyword for protocol inheritance is deprecated; use 'AnyObject' instead
protocol AssetsViewControllerDelegate: class {
^~~~~
AnyObject
/Users/usuario/development/projects/stb/property1/ios/Pods/BSImagePicker/Sources/Controller/ImagePickerControllerDelegate.swift:27:48: warning: using 'class' keyword for protocol inheritance is deprecated; use 'AnyObject' instead
public protocol ImagePickerControllerDelegate: class {
^~~~~
AnyObject
/Users/usuario/development/projects/stb/property1/ios/Pods/AppAuth/Source/AppAuth/iOS/OIDExternalUserAgentIOSCustomBrowser.m:148:42: warning: 'openURL:' is deprecated: first deprecated in iOS 10.0 [-Wdeprecated-declarations]
[[UIApplication sharedApplication] openURL:_appStoreURL];
^~~~~~~
openURL:options:completionHandler:
In module 'UIKit' imported from /Users/usuario/development/projects/stb/property1/ios/Pods/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:' has been explicitly marked deprecated here
- (BOOL)openURL:(NSURL*)url API_DEPRECATED_WITH_REPLACEMENT("openURL:options:completionHandler:", 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: warning: 'openURL:' is deprecated: first deprecated in iOS 10.0 [-Wdeprecated-declarations]
BOOL openedInBrowser = [[UIApplication sharedApplication] openURL:requestURL];
^~~~~~~
openURL:options:completionHandler:
In module 'UIKit' imported from /Users/usuario/development/projects/stb/property1/ios/Pods/Target Support Files/AppAuth/AppAuth-prefix.pch:2:
1 warning generated.
In file included from /Users/usuario/development/projects/stb/property1/ios/Pods/gRPC-Core/src/core/lib/security/transport/client_auth_filter.cc:32:
In file included from /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/credentials/credentials.h:205:15: warning: anonymous non-C-compatible type given name for linkage purposes by typedef declaration; add a tag name here [-Wnon-c-typedef-for-linkage]
typedef struct {
^
grpc_credentials_mdelem_array
/Users/usuario/development/projects/stb/property1/ios/Pods/gRPC-Core/src/core/lib/security/credentials/credentials.h:206:21: note: type is not C-compatible due to this default member initializer
grpc_mdelem* md = nullptr;
^~~~~~~
/Users/usuario/development/projects/stb/property1/ios/Pods/gRPC-Core/src/core/lib/security/credentials/credentials.h:208:3: note: type is given name 'grpc_credentials_mdelem_array' for linkage purposes by this typedef declaration
} grpc_credentials_mdelem_array;
^
1 warning generated.
In file included from /Users/usuario/development/projects/stb/property1/ios/Pods/gRPC-Core/src/core/ext/transport/chttp2/transport/chttp2_transport.cc:36:
In file included from /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: anonymous non-C-compatible type given name for linkage purposes by typedef declaration; add a tag name here [-Wnon-c-typedef-for-linkage]
typedef struct {
^
grpc_chttp2_ping_queue
/Users/usuario/development/projects/stb/property1/ios/Pods/gRPC-Core/src/core/ext/transport/chttp2/transport/internal.h:110:52: note: type is not C-compatible due to this default member initializer
grpc_closure_list lists[GRPC_CHTTP2_PCL_COUNT] = {};
^
Failed to package /Users/usuario/development/projects/stb/property1.
Command PhaseScriptExecution failed with a nonzero exit code
note: Using new build system
note: Building targets in parallel
note: Planning build
note: Analyzing workspace
note: Constructing build description
note: Build preparation complete
Could not build the application for the simulator.
Error launching application on iPhone 11 Pro.
Exited (sigterm)
直到今天早上,这一切都出乎意料地发生了。我之前遇到过问题:
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.5.99
我认为它已经解决了:
post_install do |installer|
installer.pods_project.targets.each do |target|
flutter_additional_ios_build_settings(target)
target.build_configurations.each do |config|
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '10.0'
end
end
end
在 PodFile 中。
然后我仍然收到这个错误,我正在咨询这个错误,所以我尝试将我的 Flutter 从 2.2.0 更新到 2.5.0,并从以下位置更新了我的依赖项:
environment:
sdk: ">=2.7.0 <3.0.0"
dependencies:
flutter:
sdk: flutter
provider: ^5.0.0
intl: ^0.17.0
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.0.1
material_design_icons_flutter: ^4.0.5955
google_sign_in: ^5.0.4
firebase_dynamic_links: ^2.0.4
share: ^2.0.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
numberpicker: ^2.1.1 #used on Selling Bedrooms only.
eva_icons_flutter: ^3.0.0
badges: ^2.0.1
flutter_xlider: ^3.4.0
expandable_text: 2.2.0
google_maps_flutter: ^2.0.6
line_icons: ^2.0.1
intl_phone_field: ^2.0.1 #used to get the phone in the Profile Page.
flutter_masked_text: ^0.8.0 #used to do the mask of the Filters TextFormField to Dollar Value, not use currently
flutter_absolute_path: ^1.0.6 #used to get the file path for multi Image
rxdart: ^0.27.2 #used for Geolocation queries with Firebase
geoflutterfire: ^3.0.1
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^1.0.2
firebase_messaging: ^10.0.6
收件人:
environment:
sdk: ">=2.7.0 <3.0.0"
dependencies:
flutter:
sdk: flutter
provider: ^6.0.0
intl: ^0.17.0
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
share: ^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.0.1
flutter_material_pickers: ^3.1.0 #used on Selling Bathrooms and Bedrooms
numberpicker: ^2.1.1 #used on Selling Bedrooms only.
eva_icons_flutter: ^3.0.2
badges: ^2.0.1
flutter_xlider: ^3.4.0
expandable_text: ^2.2.0
google_maps_flutter: ^2.0.9
line_icons: ^2.0.1
intl_phone_field: ^2.1.0 #used to get the phone in the Profile Page.
flutter_masked_text: ^0.8.0 #used to do the mask of the Filters TextFormField to Dollar Value, not use currently
#flutter_absolute_path: ^1.0.6 #used to get the file path for multi Image
rxdart: ^0.27.2 #used for Geolocation queries with Firebase
geoflutterfire: ^3.0.1
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^1.0.2
firebase_messaging: ^10.0.7
显然,更新我的代码以反映更改,关于如何将其恢复到 iOS 模拟器并恢复正常工作的任何想法?
【问题讨论】: