darwin-morocho / flutter-facebook-auth

A flutter plugin to add login with facebook in your flutter app
193 stars 127 forks source link

Library not loaded: @rpath/FBSDKCoreKit.framework/FBSDKCoreKit #326

Open lukepighetti opened 1 year ago

lukepighetti commented 1 year ago

What version are you using?

flutter_facebook_auth 5.0.7

Describe the Bug

Issue

When I try to launch my Flutter app using flutter_facebook_auth, the app crashes immediately and produces this error

Library not loaded: @rpath/FBSDKCoreKit.framework/FBSDKCoreKit

Expected Behavior

It builds and runs

Reproduction & Environment

https://github.com/lukepighetti/ffa_repro

lukepighetti commented 1 year ago

I have a reproduction available here: https://github.com/lukepighetti/ffa_repro

darwin-morocho commented 1 year ago

@lukepighetti please check https://github.com/darwin-morocho/flutter-facebook-auth/issues/302

This is an issue of the native facebook ios sdk since 15.x , if you are on macos with an intel processor you must use flutter_facebook_auth: 4.x

lukepighetti commented 1 year ago

I am using an M1 Pro,

Here's a reproduction of it working on 4.x as you noted

https://github.com/lukepighetti/ffa_repro/tree/4.x.x

darwin-morocho commented 1 year ago

I am using an M1 Pro,

Here's a reproduction of it working on 4.x as you noted

https://github.com/lukepighetti/ffa_repro/tree/4.x.x

Sorry I have cloned your project from main brach and run it without any problem. I am not able to reproduce this issue

lukepighetti commented 1 year ago

Added Xcode version to the reproduction repository

darwin-morocho commented 1 year ago

@lukepighetti

Flutter (Channel stable, 3.3.10, on macOS 13.1 22C65 darwin-arm, locale
    es-EC)
    • Flutter version 3.3.10 on channel stable at
      /Users/darwin/development/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 135454af32 (7 weeks ago), 2022-12-15 07:36:55 -0800
    • Engine revision 3316dd8728
    • Dart version 2.18.6
    • DevTools version 2.15.0

[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
    • Android SDK at /Users/darwin/Library/Android/sdk
    • Platform android-33, build-tools 33.0.0
    • ANDROID_HOME = /Users/darwin/Library/Android/sdk
    • Java binary at: /Applications/Android
      Studio.app/Contents/jre/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build
      11.0.13+0-b1751.21-8125866)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 14.2)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 14C18
    • CocoaPods version 1.11.3

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2021.3)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build
      11.0.13+0-b1751.21-8125866)

[✓] VS Code (version 1.74.3)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.58.0

[✓] Connected device (3 available)
    • iPhone 14 Pro Max (mobile) • BA8DA18F-69F0-4A3E-8737-BD5852C27016 • ios
      • com.apple.CoreSimulator.SimRuntime.iOS-16-2 (simulator)
    • macOS (desktop)            • macos                                •
      darwin-arm64   • macOS 13.1 22C65 darwin-arm
    • Chrome (web)               • chrome                               •
      web-javascript • Google Chrome 109.0.5414.119

[✓] HTTP Host Availability
    • All required HTTP hosts are available

• No issues found!
lukepighetti commented 1 year ago

I just updated macOS and the error is still persisting. Can you think of any other differences between our environments?

ProductName:        macOS
ProductVersion:     13.2
BuildVersion:       22D49
lukepighetti commented 1 year ago

I noticed you're on an outdated version of the stable branch, any chance you can get up to date and let me know if you can repro?

lukepighetti commented 1 year ago

I was able to get it working in this reproduction by adding FBSDKCoreKit to Frameworks. That said, do you have any idea why I have to take this step on my machine, but you don't on yours?

Screenshot 2023-02-02 at 10 06 50 PM
darwin-morocho commented 1 year ago

I was able to get it working in this reproduction by adding FBSDKCoreKit to Frameworks. That said, do you have any idea why I have to take this step on my machine, but you don't on yours?

Screenshot 2023-02-02 at 10 06 50 PM

I don't have any idea why this step is required in some machines. But this is an issue of the native facebook sdk since 15.x

lukepighetti commented 1 year ago

Unfortunately when I fix this problem using that method on my environment, it breaks CI and everyone else on the team's environment. Created a Stack Overflow question here: https://stackoverflow.com/questions/75340247/library-not-loaded-x-multiple-commands-produce-x-but-only-on-some-environment

darwin-morocho commented 1 year ago

@lukepighetti I think You should open an issue here https://github.com/facebook/facebook-ios-sdk

lukepighetti commented 1 year ago

Added an issue to facebook/facebook-ios-sdk, visible here: https://github.com/facebook/facebook-ios-sdk/issues/2169

HelloJunWei commented 1 year ago

I thought it is a facebook issue. Because many developer can not build the app too. I have try downgrade to version 14 , unfortunately There is the same issue :(

But the Android is fine

[✓] Flutter (Channel stable, 3.3.10, on macOS 12.6 21G115 darwin-x64, locale zh-Hant-TW)
    • Flutter version 3.3.10 on channel stable at /Users/aimm/Desktop/bitbucket/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 135454af32 (8 weeks ago), 2022-12-15 07:36:55 -0800
    • Engine revision 3316dd8728
    • Dart version 2.18.6
    • DevTools version 2.15.0

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    • Android SDK at /Users/aimm/Library/Android/sdk
    • Platform android-33, build-tools 30.0.3
    • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.12+0-b1504.28-7817840)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 14.2)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 14C18
    • CocoaPods version 1.11.3

[✓] Android Studio (version 2021.2)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.12+0-b1504.28-7817840)

[✓] VS Code (version 1.75.0)
    • VS Code at /Users/aimm/Desktop/Visual Studio Code.app/Contents
    • Flutter extension can be installed from:
      🔨 https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter

[✓] Connected device (1 available)
    • macOS (desktop) • macos • darwin-x64 • macOS 12.6 21G115 darwin-x64

[✓] HTTP Host Availability
    • All required HTTP hosts are available

https://github.com/facebook/facebook-ios-sdk/issues/2121

babang1da commented 1 year ago

have same

jcurlier commented 1 year ago

+1

turdigicode commented 1 year ago

the same issue, any news?

lukepighetti commented 1 year ago

I got this working. I had this in my ~/.zshrc, I can't remember where it came from, but I think it was a suggestion made by brew on macOS when I installed something. After I removed it, everything started working again.

if [ -d "/opt/homebrew/opt/ruby/bin" ]; then
  export PATH=/opt/homebrew/opt/ruby/bin:$PATH
  export PATH=`gem environment gemdir`/bin: $PATH
fi
choi-seung-min commented 1 year ago

I have same issue.
And in my ~/.zshrc there's no script you mentioned.

I got this working. I had this in my ~/.zshrc, I can't remember where it came from, but I think it was a suggestion made by brew on macOS when I installed something. After I removed it, everything started working again.

if [ -d "/opt/homebrew/opt/ruby/bin" ]; then
  export PATH=/opt/homebrew/opt/ruby/bin:$PATH
  export PATH=`gem environment gemdir`/bin: $PATH
fi
lukepighetti commented 1 year ago

Wish I could help, this issue was very frustrating

tamasapps commented 1 year ago

Updating CocoaPods to v1.12.0 fixed it for me.

vytautas-pranskunas- commented 1 year ago

watching. cannot use 5.0.8 version