flutter_string_encryption icon indicating copy to clipboard operation
flutter_string_encryption copied to clipboard

xcode 10 build issues

Open samlotti opened this issue 6 years ago • 8 comments

Hi.

I just installed the plugin and get the following:

(my podfile has:) platform :ios, '9.0'

Xcode's output: ↳ === BUILD TARGET SCrypto OF PROJECT Pods WITH CONFIGURATION Debug === /Users/sam/dev2/chess6/client/chesstime/ios/Pods/SCrypto/Source/SCrypto.swift:107:111: warning: using '!' is not allowed here; treating this as '?' instead typealias Function = (_ data: UnsafeRawPointer, _ len: CC_LONG, _ md: UnsafeMutablePointer<UInt8>) -> UnsafeMutablePointer<UInt8>! ^ ~ ? === BUILD TARGET flutter_string_encryption OF PROJECT Pods WITH CONFIGURATION Debug === /Users/sam/dev2/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_string_encryption-0.2.0/ios/Classes/FlutterStringEncryptionPlugin.m:2:9: fatal error: 'flutter_string_encryption/flutter_string_encryption-Swift.h' file not found #import <flutter_string_encryption/flutter_string_encryption-Swift.h> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1 error generated. Could not build the application for the simulator. Error launching application on iPhone 8 Plus.

samlotti avatar Dec 08 '18 14:12 samlotti

Same here. Did you find a solution to this?

9thwall avatar Jan 04 '19 04:01 9thwall

Same error,Have any solution?

mickyliu945 avatar Jan 27 '19 04:01 mickyliu945

Have you added use_frameworks! inside the Podfile?

sroddy avatar Jan 27 '19 15:01 sroddy

i add use_frameworks! also has this error,

    ** BUILD FAILED **
Xcode's output:
↳
    === BUILD TARGET webview_flutter OF PROJECT Pods WITH CONFIGURATION Debug ===
    /DATA/Work/DEV/Dart/Flutter/workspace/apcc_wallet/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>!
                                                                                                                  ^                          ~
                                                                                                                                             ?
    /DATA/Work/DEV/Dart/Flutter/workspace/apcc_wallet/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 {
        ^~~~~~~
    /DATA/Work/DEV/Dart/Flutter/workspace/apcc_wallet/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 {
        ^~~~~~~
    /DATA/Work/DEV/Dart/Flutter/workspace/apcc_wallet/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 {

@sroddy

jjjachyty avatar Jul 27 '19 01:07 jjjachyty

Same problem. Anyone found the solution?

mixdesign avatar Sep 05 '19 06:09 mixdesign

Not sure what caused this problem, but I think I found the solution :

  • make sure your create a fresh, empty Flutter project with the Swift support ON MAC (you choose this when you create the project in Android Studio). If you created the project on Windows, this error will still show.
  • copy pubspec.yaml, everything from lib folder and any other directories and files your project needs into the new freshly created project on MAC
  • open ios/workspace file in XCode and set your signing info - and everything else necessary
  • edit Podspec inside iOS dir and just uncomment "platform :ios, '9.0'". No need to change anything else
  • connect your device/emulator and type "flutter run" - it should work

Tried on latest Catalina 10.15 and latest XCode 11.3.1

baki83 avatar Jan 21 '20 15:01 baki83

Hi there - just in case anyone is still searching: It's due to an update of the Swift language. You can change the language version in Xcode to use the old version instead. Make sure to change it for Pods > SCrypto. See: https://github.com/dart-lang/crypto/issues/85#issuecomment-584256548

To change this in the Podfile, see: https://stackoverflow.com/questions/50458556/flutter-swift-version-must-be-set-to-a-supported-value

Adding

 config.build_settings['SWIFT_VERSION'] = '4.2'  # required by scrypto

to post_install worked for me.

KarimGeiger avatar May 13 '20 08:05 KarimGeiger

Hi there - just in case anyone is still searching: It's due to an update of the Swift language. You can change the language version in Xcode to use the old version instead. Make sure to change it for Pods > SCrypto. See: dart-lang/crypto#85 (comment)

To change this in the Podfile, see: https://stackoverflow.com/questions/50458556/flutter-swift-version-must-be-set-to-a-supported-value

Adding

 config.build_settings['SWIFT_VERSION'] = '4.2'  # required by scrypto

to post_install worked for me.

@KarimGeiger thankyou it was work for me

shubh-151411 avatar Apr 17 '21 11:04 shubh-151411