Flutter and Firebase authentication via Facebook: Lost connection to device

Viewed 505

I'm trying to setup Flutter-Firebase-Facebook social authentication as defined here. I used just the example given in the docs and after I execute flutter run and click the 'Login' button on the simulator, the app exits and what I can see from the logged message is just:

[ +4 ms] Lost connection to device.

Step I followed are the following:

  • I setup the Facebook App as described in here;
  • I also setup the Flutter project for iOS and Android as defined in here;
  • I ran the exact example described in the flutter_facebook_auth page;

What I've checked so far is:

  • Memory is enough;
  • flutter doctor does not show any issue.

Version of deps I am using are:

  • firebase_core: ^0.7.0
  • firebase_auth: ^0.20.0+1
  • flutter_facebook_auth: ^2.0.1

Version of flutter, sdk etc are all latest. Running on Big Sur 11.1

Does anyone know what I can investigate further?

2 Answers

I ran into this and went back through the installation guide to make sure I got everything. What fixed it for me was making sure I had these two properties set in the Info.plist:

<key>FacebookAppID</key>
<string>{your-fb-app-id}</string>
<key>FacebookDisplayName</key>
<string>{your-app-name}</string>

i had same issue, make sure your CFBundleURLSchemes starts with fb

<key>CFBundleURLTypes</key>
  <array>
  <dict>
  <key>CFBundleURLSchemes</key>
  <array>
  <!--
  Replace "000000000000" with your Facebook App ID here.
  **NOTE**: The scheme needs to start with `fb` and then your ID.
  -->
  <string>fb000000000000</string>
  </array>
  </dict>
  </array>
Related