sroddy / flutter_string_encryption

Cross-platform string encryption using common best-practices (AES/CBC/PKCS5/Random IVs/HMAC-SHA256 Integrity Check).
https://pub.dartlang.org/packages/flutter_string_encryption
Other
57 stars 42 forks source link

Xcode 9.4 build issues #7

Open stelford opened 6 years ago

stelford commented 6 years ago

Hello. I am having real troubles getting this to work with Xcode 9.4.1 on an imported flutter app. I built it on Android and linux first, and then wanted to build the ios version on my mac. I imported and started the debug and it seemed okay until I hit this;

↳
    The “Swift Language Version” (SWIFT_VERSION) build setting must be set to a supported value for targets which use Swift. This setting can be set in the build settings editor.
Could not build the application for the simulator.

so no problem, I edited my Podfile and added in

  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
      config.build_settings['ENABLE_BITCODE'] = 'NO'
      config.build_settings['SWIFT_VERSION'] = '3.0'
    end
  end
end

However, when I then do a debug build, I get the following


    #import <flutter_string_encryption/flutter_string_encryption-Swift.h>
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    1 warning and 1 error generated.
Could not build the application for the simulator.```

Any ideas what I am missing or doing wrong are gratefully received.
sroddy commented 6 years ago

Hi, can you please try with Swift version 4.0 instead of 3.0 and tell me if it works? Thanks a lot

stelford commented 6 years ago

sadly no, it's the same error if I change the Podfile to config.build_settings['SWIFT_VERSION'] = '4.0'

looking at ; https://stackoverflow.com/questions/40484816/modulename-swift-h-file-not-found-in-xcode8 it seems to suggest that it's some build option inside the module.. but.. I am not an iOS dev by a long stretch so this reads mostly as greek to me (sorry!!)

ChrisHoffmann96 commented 5 years ago

Is there any fix to this yet? Encountered the same problem here

sroddy commented 5 years ago

Hi, are you using the use_frameworks! flag inside your Podfile?

yahya31415 commented 5 years ago

I am getting the same error in Xcode Version 9.2. I added use_frameworks! to my Podfile and set the Swift version to 4.0. This is the error: `:1:9: note: in file included from :1:

import "Headers/flutter_string_encryption-umbrella.h"

    ^

/Users/............/ios/Pods/Target Support Files/flutter_string_encryption/flutter_string_encryption-umbrella.h:13:9: error: include of non-modular header inside framework module 'flutter_string_encryption': '/Users/........./flutter/.pub-cache/hosted/pub.dartlang.org/flutter_string_encryption-0.1.0/ios/Classes/FlutterStringEncryptionPlugin.h'

import "FlutterStringEncryptionPlugin.h"

    ^
:0: error: could not build Objective-C module 'flutter_string_encryption'`
josep-albert-bonarea commented 5 years ago

Same here:

Xcode's output: ↳ === BUILD TARGET shared_preferences OF PROJECT Pods WITH CONFIGURATION Debug === /Users/sergi/flutterdietes/ios/Pods/SCrypto/Source/SCrypto.swift:107:111: warning: using '!' is not allowed here; treating this as '?' instead typealias Function = ( data: UnsafeRawPointer, _ len: CCLONG, md: UnsafeMutablePointer) -> UnsafeMutablePointer! ^ ~ ? === BUILD TARGET flutter_string_encryption OF PROJECT Pods WITH CONFIGURATION Debug === While building module 'Flutter' imported from /Users/sergi/Downloads/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_string_encryption-0.2.0/ios/Classes/FlutterStringEncryptionPlugin.h:1: In file included from :1: In file included from /Users/sergi/flutter_dietes/ios/Pods/../.symlinks/flutter/ios/Flutter.framework/Headers/Flutter.h:44: In file included from /Users/sergi/flutter_dietes/ios/Pods/../.symlinks/flutter/ios/Flutter.framework/Headers/FlutterAppDelegate.h:11: In file included from /Users/sergi/flutter_dietes/ios/Pods/../.symlinks/flutter/ios/Flutter.framework/Headers/FlutterPlugin.h:13: /Users/sergi/flutter_dietes/ios/Pods/../.symlinks/flutter/ios/Flutter.framework/Headers/FlutterPlatformViews.h:25:11: warning: parameter 'viewIdentifier' not found in the function declaration [-Wdocumentation]

Could not build the application for the simulator. Error launching application on iPhone XR.

baki83 commented 4 years ago

Regarding the last error here from josepalbert95, you may try this :

Tried on latest Catalina 10.15 and latest XCode 11.3.1