roughike / flutter_facebook_login

A Flutter plugin for allowing users to authenticate with native Android & iOS Facebook login SDKs.
BSD 2-Clause "Simplified" License
405 stars 331 forks source link

Version 3.0.0 doesn't work on iOS #222

Open shovelmn12 opened 4 years ago

shovelmn12 commented 4 years ago

Created clean project add version 3.0.0 added all configurations in plist.info try to run and getting:

Running pod install...
Running Xcode build...
Xcode build done.                                            7.0s
Failed to build iOS app
Error output from Xcode build:
↳
    ** BUILD FAILED **

Xcode's output:
↳
    Undefined symbols for architecture arm64:
      "_vDSP_mmul", referenced from:
          mat1::dense(float*, float*, float*, int, int, int) in FBSDKAddressInferencer.o
          mat1::dense(float*, float*, float*, int, int, int) in FBSDKEventInferencer.o
      "_vDSP_vclip", referenced from:
          mat1::relu(float*, int) in FBSDKAddressInferencer.o
          mat1::relu(float*, int) in FBSDKEventInferencer.o
      "_vDSP_dotpr", referenced from:
          mat1::conv1D(float*, float*, int, int, int, int, int) in FBSDKAddressInferencer.o
          mat1::conv1D(float*, float*, int, int, int, int, int) in FBSDKEventInferencer.o
    ld: symbol(s) not found for architecture arm64
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
    note: Using new build system
    note: Planning build
    note: Constructing build description

Could not build the precompiled application for the device.

Update: version 2.0.1 works. Update 2: i can run version 2 0.1 but nothing happens when i call loginWithPermmisions() Update 3: By adding Accelerate.framwork to FBSDKCoreKit i solve the issue but i still cant build release

phuc-koli commented 4 years ago

I get same issue with "architecture arm64". Anyone solved it?

shovelmn12 commented 4 years ago

I managed to get the Facebook sdk working on ios (not the plugin) by just downloading the framework from Facebook sdk github and adding it to the project. If you do that remember to add the accelerate.framework. Now you can create a plugin and expose the api you need. I need only login so its quite easy. I still haven't tested the creation of local plugin but i know for sure the project compiled and run with now issues when i added the framework manually

rphlmr commented 4 years ago

Hi, I just start a clean project (come from react native :) ) and I have no issue compiling (debug) on IOS 13 simulator. I just changed the default ios target from 8 to 9 (on project and target), did a flutter clean, flutter pub get (again in case) and that's all. I'll try on a real device.

phuc-koli commented 4 years ago

Hi @rphlmr

What is your Flutter version?

rphlmr commented 4 years ago

@phuc-koli :

[✓] Flutter (Channel stable, v1.12.13+hotfix.5, on Mac OS X 10.14.6 18G95, locale fr-FR)

You should check in your xcode project. You need to provide Other linker flags :

$(inherited)
-ObjC
etc ..

image

https://developers.facebook.com/docs/facebook-login/ios/ ==> part 4b (in case you didn't have this in your project build settings)

phuc-koli commented 4 years ago

Hi @rphlmr

I tried your instruction but now I'm getting this error: module 'FBSDKCoreKit' not found Do you have any idea?

phuc-koli commented 4 years ago

Finally, I solved the issue by below steps:

  1. Run: flutter clean
  2. Go to ios folder, delete Podfile, Podfile.lock, Pods folder, Runner.xcworkspace
  3. Run project again
rphlmr commented 4 years ago

Yeah ! That's the point. Sometimes cocoapods is crazy and we need to clean everything 😅

robertkhs commented 4 years ago

Hi~ I am not sure but I solved this issue in this way.

Cause: Current flutter_facebook_login(3.0.0) is using Facebook SDK v5.11.0. But Facebook SDK v5.11.0. has small issue. Screen Shot 2019-12-26 at 17 45 15 (https://github.com/facebook/facebook-ios-sdk/releases)

Solution: As Facebook page says "manually add the Accelerate framework to their targets under the the "Frameworks, Libraries, and Embedded Content" section of the "General" tab." Screen Shot 2019-12-26 at 17 52 16

I hope you can solve this issue. Have a nice day~ and Happy new year~~^^/

shovelmn12 commented 4 years ago

Hi~ I am not sure but I solved this issue in this way.

Cause: Current flutter_facebook_login(3.0.0) is using Facebook SDK v5.11.0. But Facebook SDK v5.11.0. has small issue. Screen Shot 2019-12-26 at 17 45 15 (https://github.com/facebook/facebook-ios-sdk/releases)

Solution: As Facebook page says "manually add the Accelerate framework to their targets under the the "Frameworks, Libraries, and Embedded Content" section of the "General" tab." Screen Shot 2019-12-26 at 17 52 16

I hope you can solve this issue. Have a nice day~ and Happy new year~~^^/

this doesnt solve the problem because once you hit flutter build ios it will run pod install and all your changes will be lost. i got to your solution before but it doesnt work eventually

SoftWyer commented 4 years ago

I've been around the houses and back with this and have eventually got this to work with the 5.13.1 Podfiles on iOS (by work, I mean compiling, linking and installing onto a real iPhone - I don't actually use Facebook but it's required as part of the firebase-ui login package :-D )

Firstly, do the clean mentioned in https://github.com/roughike/flutter_facebook_login/issues/222#issuecomment-568164311

After building I got errors regarding:

fatal error: module 'FBSDKCoreKit' not found
    @import FBSDKCoreKit;

I then added the modular headers override into the ios/podspec file mentioned here https://github.com/roughike/flutter_facebook_login/issues/214#issuecomment-565166295

The start of the podfile looks like this:

platform :ios, '12.0'

use_modular_headers!

I did note that linking errors, about missing Facebook libraries, were due to a spurious entry in the Frameworks section. Attached is a picture of my current config.

image

maheshj01 commented 4 years ago

Finally, I solved the issue by below steps:

  1. Run: flutter clean
  2. Go to ios folder, delete Podfile, Podfile.lock, Pods folder, Runner.xcworkspace
  3. Run project again

and then run this command open ios/Runner.xcworkspace from the root of the project

thank you very much that worked I have been trying to build the archive since a month,thanks a tonne,

shayanelhami commented 4 years ago

My workaround was to update post_install method in Podfile like this:

post_install do |installer|
  installer.pods_project.targets.each do |target|
    if target.name == 'FBSDKCoreKit'
        frameworks_build_phase = target.build_phases.find { |build_phase| build_phase.to_s == 'FrameworksBuildPhase' }
        frameworks_group = target.project.groups.find { |group| group.display_name == 'Frameworks' }
        framework_ref = frameworks_group.new_file("Accelerate.framework")
        frameworks_build_phase.add_file_reference(framework_ref)
    end

    target.build_configurations.each do |config|
      config.build_settings['ENABLE_BITCODE'] = 'NO'
    end
  end
end

to remove the manual step of adding framework and allow for automated builds to succeed. Of course it's only temporary until this issue is addressed.