firstfloorsoftware / flutter_sodium

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

libsodium.a linker error #64

Closed tomquas closed 2 years ago

tomquas commented 2 years ago

hi, i do have a hard time resolving this issue:

$ git clone https://github.com/firstfloorsoftware/flutter_sodium.git
$ cd ./flutter_sodium/
$ flutter pub get
$ cd ./example
$ flutter run
Launching lib/main.dart on u2nite in debug mode...
Updating minimum iOS deployment target from 8.0 to 9.0.
Upgrading project.pbxproj
Upgrading AppFrameworkInfo.plist
Running pod install...                                           1,224ms
Running Xcode build...
Xcode build done.                                            2.7s
Failed to build iOS app
Error output from Xcode build:
↳
    ** BUILD FAILED **

Xcode's output:
↳
    ld: in
    /tmp/flutter_sodium/example/ios/Pods/../.symlinks/plugins/flutter_sodium/ios/libsodium
    .a(libsodium_la-aead_chacha20poly1305.o), building for iOS Simulator, but linking in
    object file built for iOS, file
    '/tmp/flutter_sodium/example/ios/Pods/../.symlinks/plugins/flutter_sodium/ios/libsodiu
    m.a' for architecture arm64
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
    note: Using new build system
    note: Building targets in parallel
    note: Planning build
    note: Analyzing workspace
    note: Constructing build description
    note: Build preparation complete
    /tmp/flutter_sodium/example/ios/Pods/Pods.xcodeproj: warning: The iOS Simulator
    deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of
    supported deployment target versions is 9.0 to 14.5.99. (in target 'Flutter' from
    project 'Pods')

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

strange enough, building and running the example app works when using xcode

$ open ios/Runner.xcworkspace/

my env:

$ flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel beta, 2.4.0-4.2.pre, on macOS 11.4 20F71 darwin-x64, locale en-US)
[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0-rc3)
[✓] Xcode - develop for iOS and macOS
[✓] Chrome - develop for the web
[✓] Android Studio (version 4.2)
[✓] VS Code (version 1.58.2)
[✓] Connected device (3 available)
  ....
• No issues found!

Any suggestions?

tomquas commented 2 years ago

FWIW i rolled back flutter and it works again; if you don't want to deal with this right now, feel free to close this ticket.

$ flutter --version
Flutter 2.3.0-24.1.pre • channel beta • https://github.com/flutter/flutter.git
Framework • revision 615957513e (5 weeks ago) • 2021-06-25 09:24:44 -0700
Engine • revision 9d517f475b
Tools • Dart 2.14.0 (build 2.14.0-188.5.beta)
kozw commented 2 years ago

Thanks

tomquas commented 2 years ago

hi @kozw, the error persists with

$ flutter --version
Flutter 2.5.0-5.3.pre • channel beta • https://github.com/flutter/flutter.git
Framework • revision a7fb06d6fa (8 days ago) • 2021-09-02 09:07:14 -0700
Engine • revision fcde2c8b2f
Tools • Dart 2.14.0 (build 2.14.0-377.8.beta)

maybe it's time to look into it?

toseefkhan403 commented 2 years ago

Hi, I am facing the same error as well. The app works fine when I test it on an actual iPhone, but it doesn't work on the simulator. Any solutions?