简体   繁体   English

如何在codemagic中创建podfile?

[英]How to create podfile in codemagic?

I'm trying to build an iOS flutter app in windows using Codemagic.我正在尝试使用 Codemagic 在 Windows 中构建一个 iOS flutter 应用程序。 I created the flutter project in android studio and uploaded it to github in order to use it in Codemagic... But when I try to build the iOS app, Codemagic throws me this error:我在 android studio 中创建了 flutter 项目并将其上传到 github 以便在 Codemagic 中使用它......但是当我尝试构建 iOS 应用程序时,Codemagic 向我抛出了这个错误:

Warning: Building for device with codesigning disabled. You will have to manually codesign before deploying to device.
Building com.jmmago.saltApp for device (ios-release)...
Running pod install...                                             16.0s
Running Xcode build...                                          
Xcode build done.                                           124.3s
Failed to build iOS app
Error output from Xcode build:
↳
    ** BUILD FAILED **


Xcode's output:
↳
    /Users/builder/programs/flutter/.pub-cache/hosted/pub.dartlang.org/barcode_scan-3.0.1/ios/Classes/protos/protos.pb.swift:14:8: error: compiling for iOS 8.0, but module 'SwiftProtobuf' has a minimum deployment target of iOS 9.0: /Users/builder/clone/build/ios/Release-iphoneos/SwiftProtobuf/SwiftProtobuf.framework/Modules/SwiftProtobuf.swiftmodule/armv7-apple-ios.swiftmodule
    import SwiftProtobuf
           ^
    Command CompileSwift failed with a nonzero exit code
    note: Using new build system
    note: Building targets in parallel
    note: Planning build
    note: Constructing build description
    warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.1.99. (in target 'barcode_scan' from project 'Pods')
    warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.1.99. (in target 'sqflite' from project 'Pods')
    warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.1.99. (in target 'shared_preferences' from project 'Pods')
    warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.1.99. (in target 'path_provider' from project 'Pods')
    warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.1.99. (in target 'image_picker' from project 'Pods')
    warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.1.99. (in target 'MTBBarcodeScanner' from project 'Pods')
    warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.1.99. (in target 'FMDB' from project 'Pods')
    warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.1.99. (in target 'Flutter' from project 'Pods')

════════════════════════════════════════════════════════════════════════════════
Building a deployable iOS app requires a selected Development Team with a 
Provisioning Profile. Please ensure that a Development Team is selected by:
  1- Open the Flutter project's Xcode target with
       open ios/Runner.xcworkspace
  2- Select the 'Runner' project in the navigator then the 'Runner' target
     in the project settings
  3- Make sure a 'Development Team' is selected. 
     - For Xcode 10, look under General > Signing > Team.
     - For Xcode 11 and newer, look under Signing & Capabilities > Team.
     You may need to:
         - Log in with your Apple ID in Xcode first
         - Ensure you have a valid unique Bundle ID
         - Register your device with your Apple Developer Account
         - Let Xcode automatically provision a profile for your app
  4- Build or run your project again

For more information, please visit:
  https://flutter.dev/setup/#deploy-to-ios-devices

Or run on an iOS simulator without code signing
════════════════════════════════════════════════════════════════════════════════
Encountered error while building for device.


Build failed :|
Failed to build for iOS

In this question , they solved this same problem creating a podfile.在这个问题中,他们通过创建 podfile 解决了同样的问题。 But how I create a Podfile?但是我如何创建 Podfile 呢? I have to create it in my project and then push it to github?我必须在我的项目中创建它,然后将其推送到 github? Or there is a way to create it in Codemagic?或者有没有办法在 Codemagic 中创建它?

I think it might be enough to open up your project up in VSCODE and change the 'IPHONEOS_DEPLOYMENT_TARGET' to 9.0 in all 3 places where it is present.我认为在 VSCODE 中打开您的项目并在它存在的所有 3 个地方将“IPHONEOS_DEPLOYMENT_TARGET”更改为 9.0 可能就足够了。 In addition check your AppFrameworkInfo.plist file and set the MinimumiOSVersion to 9.0 there as well.此外,请检查您的 AppFrameworkInfo.plist 文件并将 MinimumiOSVersion 设置为 9.0。

If you wish to create a podfile through Codemagic however, then you might try to put this into your pre build script for the first run (and remove it later):但是,如果您希望通过 Codemagic 创建一个 podfile,那么您可以尝试将其放入您的第一次运行的预构建脚本中(稍后将其删除):

cd ios && pod init && git add . cd ios && pod init && git add 。 && git commit -m "Add Podfile to project" && git push && git commit -m "将 Podfile 添加到项目" && git push

我,特别是,选择 beta 作为颤振通道并且运行良好,但还没有在真实设备上试用该应用程序。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM