我的项目有问题。在Xcode上构建(在Visual代码上开发)时,我会得到这组错误。
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里。
然后,我仍然得到了这个错误,这是我正在咨询的错误,所以我尝试从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模拟器并恢复正常,有什么想法吗?
发布于 2021-09-21 20:06:09
如果有人面临这个问题,我管理一个修补程序,首先我面临两个问题:
为了解决这个问题,我做了两件事:
从问题2开始,我刚刚通过使用命令flutter降级2.2.0来降低我的颤振级别--这帮助我回到我原来的问题上,而不用面对那些依赖的方法。
关于问题1,有以下几点:
首先将其添加到PodFile中:
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.delete 'IPHONEOS_DEPLOYMENT_TARGET'
end
end
end
其次,为了修复Pods,我执行了以下步骤:
最后,只需做一个颤栗跑。
这就是我解决它的方法。
亲切的问候
https://stackoverflow.com/questions/69228814
复制相似问题