2

我正在尝试为我在 codemagic 上的颤振项目创建一个 IOS 版本,但它一直失败。我在应用程序中使用了flutter_config,但我的.env 文件中的值已添加到codemagic 上的环境变量中,但我仍然认为失败的构建与flutter_config 有关,但可能还有更多。这是我的日志,任何帮助都会很棒。

== Building for iOS ==


Running Xcode build...                                          

Xcode archive done.                                         19.1s

Failed to build iOS app
Error output from Xcode build:
↳
    ** ARCHIVE FAILED **


Xcode's output:
↳
    Command CompileSwift failed with a nonzero exit code
    /Users/builder/clone/ios/Pods/SCrypto/Source/SCrypto.swift:107:111: error: using '!' is not allowed here; perhaps '?' was intended?
            typealias Function = (_ data: UnsafeRawPointer, _ len: CC_LONG, _ md: UnsafeMutablePointer<UInt8>) -> UnsafeMutablePointer<UInt8>!
                                                                                                                  ^                          ~
                                                                                                                                             ?
    /Users/builder/clone/ios/Pods/SCrypto/Source/SCrypto.swift:188:5: warning: 'public' modifier is redundant for instance method declared in a public extension
        public func MD2() -> Self {
        ^~~~~~~

    /Users/builder/clone/ios/Pods/SCrypto/Source/SCrypto.swift:198:5: warning: 'public' modifier is redundant for instance method declared in a public extension
        public func MD4() -> Self {
        ^~~~~~~

    /Users/builder/clone/ios/Pods/SCrypto/Source/SCrypto.swift:208:5: warning: 'public' modifier is redundant for instance method declared in a public extension
        public func MD5() -> Self {
        ^~~~~~~

    /Users/builder/clone/ios/Pods/SCrypto/Source/SCrypto.swift:217:5: warning: 'public' modifier is redundant for instance method declared in a public extension
        public func SHA1() -> Self {
        ^~~~~~~

    /Users/builder/clone/ios/Pods/SCrypto/Source/SCrypto.swift:226:5: warning: 'public' modifier is redundant for instance method declared in a public extension
        public func SHA224() -> Self {
        ^~~~~~~

    /Users/builder/clone/ios/Pods/SCrypto/Source/SCrypto.swift:235:5: warning: 'public' modifier is redundant for instance method declared in a public extension
        public func SHA256() -> Self {
        ^~~~~~~

 /Users/builder/clone/ios/Pods/SCrypto/Source/SCrypto.swift:628:5: warning: 'public' modifier is redundant for instance method declared in a public extension
        public func encrypt(_ algorithm: Cipher.Algorithm, options: Cipher.Options, key: Data, iv: Data? = nil) throws -> Data {
        ^~~~~~~

    /Users/builder/clone/ios/Pods/SCrypto/Source/SCrypto.swift:646:5: warning: 'public' modifier is redundant for instance method declared in a public extension
        public func decrypt(_ algorithm: Cipher.Algorithm, options: Cipher.Options, key: Data, iv: Data? = nil) throws -> Data {
        ^~~~~~~

                                                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /Users/builder/clone/ios/Pods/SCrypto/Source/SCrypto.swift:272:69: note: implicit argument conversion from '[UInt8]' to 'UnsafePointer<UInt8>' produces a pointer valid only for the duration of the call to 'init(_:)'
            return type(of: self).init(Data(bytes: UnsafePointer<UInt8>(messageDigest), count: messageDigest.count))
                                                                        ^~~~~~~~~~~~~
    /Users/builder/clone/ios/Pods/SCrypto/Source/SCrypto.swift:272:69: note: use the 'withUnsafeBufferPointer' method on Array in order to explicitly convert argument to buffer pointer valid for a defined scope
            return type(of: self).init(Data(bytes: UnsafePointer<UInt8>(messageDigest), count: messageDigest.count))
   
                                                    ^
    note: Using new build system
    note: Building targets in parallel
    note: Planning build
    note: Constructing build description
    warning: no rule to process file '/Users/builder/programs/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_config-1.0.8/ios/Classes/BuildDotenvConfig.rb' of type 'text.script.ruby' for architecture 'arm64' (in target 'flutter_config' from project 'Pods')
    warning: no rule to process file '/Users/builder/programs/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_config-1.0.8/ios/Classes/BuildXCConfig.rb' of type 'text.script.ruby' for architecture 'arm64' (in target 'flutter_config' from project 'Pods')
    warning: no rule to process file '/Users/builder/programs/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_config-1.0.8/ios/Classes/ReadDotEnv.rb' of type 'text.script.ruby' for architecture 'arm64' (in target 'flutter_config' from project 'Pods')
    warning: no rule to process file '/Users/builder/programs/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_config-1.0.8/ios/Classes/BuildDotenvConfig.rb' of type 'text.script.ruby' for architecture 'armv7' (in target 'flutter_config' from project 'Pods')
    warning: no rule to process file '/Users/builder/programs/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_config-1.0.8/ios/Classes/BuildXCConfig.rb' of type 'text.script.ruby' for architecture 'armv7' (in target 'flutter_config' from project 'Pods')
    warning: no rule to process file '/Users/builder/programs/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_config-1.0.8/ios/Classes/ReadDotEnv.rb' of type 'text.script.ruby' for architecture 'armv7' (in target 'flutter_config' from project 'Pods')
Encountered error while archiveing for device.




Build failed :|
Failed to build for iOS
4

1 回答 1

0

根据错误消息,我建议检查下一个解决方案https://github.com/dart-lang/crypto/issues/85#issuecomment-584256548

于 2021-03-09T12:17:36.410 回答