首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >Xcode在颤振上的生成错误--任何对象错误和openURL错误

Xcode在颤振上的生成错误--任何对象错误和openURL错误
EN

Stack Overflow用户
提问于 2021-09-17 19:52:43
回答 1查看 543关注 0票数 0

我的项目有问题。在Xcode上构建(在Visual代码上开发)时,我会得到这组错误。

代码语言:javascript
运行
复制
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)

这件事在今天早上才突然发生,没有任何问题。我以前有个问题:

代码语言:javascript
运行
复制
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

我认为这是用以下方法解决的:

代码语言:javascript
运行
复制
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,并从以下几个方面更新了我的依赖项:

代码语言:javascript
运行
复制
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

至:

代码语言:javascript
运行
复制
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模拟器并恢复正常,有什么想法吗?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2021-09-21 20:06:09

如果有人面临这个问题,我管理一个修补程序,首先我面临两个问题:

  1. 由于Xcode 12中对iOS 8的支持(链接中有更多信息),我的项目的Pods不再工作了。
  2. 在我的工作中,我从Flator2.2.0升级到了2.5.0,这基本上是做了大量的更改,并从依赖的一些方法中获得了支持。

为了解决这个问题,我做了两件事:

从问题2开始,我刚刚通过使用命令flutter降级2.2.0来降低我的颤振级别--这帮助我回到我原来的问题上,而不用面对那些依赖的方法。

关于问题1,有以下几点:

首先将其添加到PodFile中:

代码语言:javascript
运行
复制
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,我执行了以下步骤:

  1. 删除pubspec.lock文件。
  • 主工程终点站
  1. 做了一次颤栗清洁。
  • 在终端中,转到iOS文件夹:
  1. 删除Podfile.lock
  2. 删除Pods文件夹。
  3. 关键:复制(无论何时作为备份) PodFile的内容,包括在末尾添加的部分。
  4. 删除Podfile。
  5. 在终端中的iOS文件夹中做一个荚init。(这将生成带有基本信息的Podfile )。
  6. 在iOS文件夹中的终端中,进行吊舱安装。(这将生成包含基本信息的Podfile.lock和Pods文件夹)。
  • 导航到终端中的主Project文件夹(cd .)或者使用pubspec.yaml文件中的Pub图标。
  1. 一家小酒吧
  • 在终端中,转到iOS文件夹:
  1. 复制步骤5中备份的存储信息,并粘贴到PodFile中。
  2. 安装吊舱。
  • 导航到终端中的主Project文件夹(cd .)

最后,只需做一个颤栗跑。

这就是我解决它的方法。

亲切的问候

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/69228814

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档