0

我在尝试编译代码魔术时遇到了麻烦,我无法访问 Apple 设备。你能告诉我如何解决吗?

我看到要解决这个问题,我必须执行以下步骤:打开 [YourProject]/ios/Podfile 并从平台:ios,'9.0' 中删除 # 符号,然后尝试 flutter run。如果它不起作用,则将版本号例如增加到 10.0

根据链接:运行 pod install 时出错 - 在目标 `Runner` 上自动分配版本为 `8.0` 的平台`iOS`

但是如何在没有 macOS 的 codemagic 中解决这个问题。

CODEMAGIC 中的日志错误:

== Building for iOS ==

> flutter build ios --debug --no-codesign
Warning: Building for device with codesigning disabled. You will have to manually codesign before deploying to device.
Building com.example.jumilAssistencia for device (ios)...
Running pod install...                                              4.9s
CocoaPods' output:
↳
      Preparing

    Analyzing dependencies

    Inspecting targets to integrate
      Using `ARCHS` setting to build architectures of target `Pods-Runner`: (``)

    Fetching external sources
    -> Fetching podspec for `Flutter` from `Flutter`
    -> Fetching podspec for `firebase_core` from `.symlinks/plugins/firebase_core/ios`
    firebase_core: Using Firebase SDK version '8.3.0' defined in 'firebase_core'
    -> Fetching podspec for `firebase_messaging` from `.symlinks/plugins/firebase_messaging/ios`
    firebase_messaging: Using Firebase SDK version '8.3.0' defined in 'firebase_core'
    -> Fetching podspec for `geocoder` from `.symlinks/plugins/geocoder/ios`
    -> Fetching podspec for `google_maps_flutter` from `.symlinks/plugins/google_maps_flutter/ios`
    -> Fetching podspec for `location` from `.symlinks/plugins/location/ios`
    -> Fetching podspec for `path_provider` from `.symlinks/plugins/path_provider/ios`
    -> Fetching podspec for `qr_code_scanner` from `.symlinks/plugins/qr_code_scanner/ios`
    -> Fetching podspec for `shared_preferences` from `.symlinks/plugins/shared_preferences/ios`
    -> Fetching podspec for `url_launcher` from `.symlinks/plugins/url_launcher/ios`

    Resolving dependencies of `Podfile`

    Adding spec repo `trunk` with CDN `https://cdn.cocoapods.org/`
      CDN: trunk Relative path downloaded: CocoaPods-version.yml, save ETag: "612aa752-3d"

    CocoaPods 1.11.0.rc.1 is available.
    To update use: `gem install cocoapods --pre`
    [!] This is a test version we'd love you to try.

    For more information, see https://blog.cocoapods.org and the CHANGELOG for this version at https://github.com/CocoaPods/CocoaPods/releases/tag/1.11.0.rc.1

      CDN: trunk Relative path: CocoaPods-version.yml exists! Returning local because checking is only perfomed in repo update
    [!] CocoaPods could not find compatible versions for pod "firebase_core":
      In Podfile:
        firebase_core (from `.symlinks/plugins/firebase_core/ios`)

    Specs satisfying the `firebase_core (from `.symlinks/plugins/firebase_core/ios`)` dependency were found, but they required a higher minimum deployment target.

    /Users/builder/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/molinillo-0.6.6/lib/molinillo/resolution.rb:328:in `raise_error_unless_state'
    /Users/builder/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/molinillo-0.6.6/lib/molinillo/resolution.rb:310:in `block in unwind_for_conflict'
    /Users/builder/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/molinillo-0.6.6/lib/molinillo/resolution.rb:308:in `tap'
    /Users/builder/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/molinillo-0.6.6/lib/molinillo/resolution.rb:308:in `unwind_for_conflict'
    /Users/builder/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/molinillo-0.6.6/lib/molinillo/resolution.rb:684:in `attempt_to_activate'
    /Users/builder/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/molinillo-0.6.6/lib/molinillo/resolution.rb:254:in `process_topmost_state'
    /Users/builder/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/molinillo-0.6.6/lib/molinillo/resolution.rb:182:in `resolve'
    /Users/builder/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/molinillo-0.6.6/lib/molinillo/resolver.rb:43:in `resolve'
    /Users/builder/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/cocoapods-1.10.1/lib/cocoapods/resolver.rb:94:in `resolve'
    /Users/builder/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/cocoapods-1.10.1/lib/cocoapods/installer/analyzer.rb:1074:in `block in resolve_dependencies'
    /Users/builder/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/cocoapods-1.10.1/lib/cocoapods/user_interface.rb:64:in `section'
    /Users/builder/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/cocoapods-1.10.1/lib/cocoapods/installer/analyzer.rb:1072:in `resolve_dependencies'
    /Users/builder/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/cocoapods-1.10.1/lib/cocoapods/installer/analyzer.rb:124:in `analyze'
    /Users/builder/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:414:in `analyze'
    /Users/builder/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:239:in `block in resolve_dependencies'
    /Users/builder/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/cocoapods-1.10.1/lib/cocoapods/user_interface.rb:64:in `section'
    /Users/builder/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:238:in `resolve_dependencies'
    /Users/builder/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/cocoapods-1.10.1/lib/cocoapods/installer.rb:160:in `install!'
    /Users/builder/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/cocoapods-1.10.1/lib/cocoapods/command/install.rb:52:in `run'
    /Users/builder/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/claide-1.0.3/lib/claide/command.rb:334:in `run'
    /Users/builder/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/cocoapods-1.10.1/lib/cocoapods/command.rb:52:in `run'
    /Users/builder/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/cocoapods-1.10.1/bin/pod:55:in `<top (required)>'
    /Users/builder/.rbenv/versions/2.7.2/bin/pod:23:in `load'
    /Users/builder/.rbenv/versions/2.7.2/bin/pod:23:in `<main>'

Error output from CocoaPods:
↳

    [!] Automatically assigning platform `iOS` with version `9.0` on target `Runner` because no platform was specified. Please specify a platform for this target in your Podfile. See `https://guides.cocoapods.org/syntax/podfile.html#platform`.

Error running pod install


Build failed :|
Failed to build for iOS
4

1 回答 1

2

您可以在构建期间通过 ssh 或 vnc 访问 codemagic 自己的 Mac,请参阅此处的文档。但我个人会创建一个新的颤振项目并使用 ios 文件夹和所有最新的配置。我最近使用 Flutter 2.2 生成的 ios 配置通过 codemagic 设置了 CD,没有任何问题。

于 2021-08-29T23:18:19.067 回答