firstfloorsoftware / flutter_sodium

Flutter bindings for libsodium
BSD 3-Clause "New" or "Revised" License
102 stars 46 forks source link

flutter_sodium does not build for IOS. #1

Closed pneves001 closed 5 years ago

pneves001 commented 6 years ago
=== BUILD TARGET flutter_sodium OF PROJECT Pods WITH CONFIGURATION Debug ===
warning: no rule to process file '/.pub-cache/hosted/pub.dartlang.org/flutter_sodium-0.0.2/ios/Classes/libsodium-ios/lib/libsodium.a' of type archive.ar for architecture armv7
warning: no rule to process file /.pub-cache/hosted/pub.dartlang.org/flutter_sodium-0.0.2/ios/Classes/libsodium-ios/lib/libsodium.a' of type archive.ar for architecture arm64
/Users/.pub-cache/hosted/pub.dartlang.org/flutter_sodium-0.0.2/ios/Classes/FlutterSodiumPlugin.m:2:9: fatal error: 'flutter_sodium/flutter_sodium-Swift.h' file not found
#import <flutter_sodium/flutter_sodium-Swift.h>
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
kozw commented 6 years ago

Most likely related to https://github.com/flutter/flutter/issues/16049

Will need to re-investigate

pneves001 commented 6 years ago

I haven't even added any code yet to use the library in my code. This is coming up when I install the package.

kozw commented 6 years ago

After creating a new flutter app with flutter create, and adding the flutter_sodium dependency in pubspec.yaml, you'll need to manually edit ios/Podfile:

See also the attached Podfile for reference. I'm aware this is not ideal, but this is a one-time setup.

Eventually this issue needs to be addressed in the flutter tooling.

Taken from https://github.com/flutter/flutter/issues/16049#issuecomment-382629492

kozw commented 5 years ago

FYI: these manual steps are still required in Flutter v0.6.0

kozw commented 5 years ago

FYI: these manual steps are still required in Flutter v0.8.2 (preview 2)

Additionally, with Xcode 10 the iOS build of your flutter app will fail as well. See https://github.com/firstfloorsoftware/flutter_sodium/issues/9 for details

kozw commented 5 years ago

FYI: in Flutter 1.0 the following workaround is still required when creating a Flutter iOS app using ObjC (which is the default).

After creating a new flutter app with flutter create, and adding the flutter_sodium dependency in pubspec.yaml, you'll need to manually edit ios/Podfile:

Kiruel commented 4 years ago

Still required in v1.9.8-pre.3 ?