Describe the bug
The facebook login flow used to work properly, but since i migrated to flutterEmbedding v2 it is now working anymore on android. on iOS it works though.
This call await FacebookAuth.instance.login() never returns.
Environment
Add your flutter doctor -v
[✓] Flutter (Channel stable, 1.22.5, on Mac OS X 10.15.5 19F101 darwin-x64, locale de-DE)
• Flutter version 1.22.5 at /Users/gsiewe/workspace/private/flutter
• Framework revision 7891006299 (7 weeks ago), 2020-12-10 11:54:40 -0800
• Engine revision ae90085a84
• Dart version 2.10.4
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.0)
• Android SDK at /Users/gsiewe/Library/Android/sdk
• Platform android-30, build-tools 30.0.0
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 12.3)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 12.3, Build version 12C33
• CocoaPods version 1.9.3
[✓] Android Studio (version 4.0)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 48.1.2
• Dart plugin version 193.7547
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)
[!] IntelliJ IDEA Ultimate Edition (version 2020.1.2)
• IntelliJ at /Applications/IntelliJ IDEA.app
✗ Flutter plugin not installed; this adds Flutter specific functionality.
✗ Dart plugin not installed; this adds Dart specific functionality.
• For information about installing plugins, see
https://flutter.dev/intellij-setup/#installing-the-plugins
[✓] Connected device (2 available)
• sdk gphone x86 (mobile) • emulator-5554 • android-x86 • Android 11 (API 30) (emulator)
• iPhone 12 Pro Max (mobile) • 56B67681-CBCA-4927-BAC6-7DD550E80343 • ios • com.apple.CoreSimulator.SimRuntime.iOS-14-3 (simulator)
! Doctor found issues in 1 category.
Add your pubspec.yaml
name: chatetyamo
description: Chat&Yamo application de rencontre pour les jeunes Camerounais.
dependencies:
flutter:
sdk: flutter
flutter_localizations:
sdk: flutter
http: "^0.12.2"
shared_preferences: "^0.5.12"
flutter_cache_manager: "^1.4.2"
web_socket_channel: "^1.1.0"
event_bus: "^1.1.1"
flutter_webview_plugin: "^0.3.11"
in_app_purchase: ^0.3.3+1
firebase_messaging: "^6.0.16"
material_design_icons_flutter: "4.0.5655"
fluttertoast: "^7.1.1"
flutter_slidable: "^0.5.7"
flutter_facebook_auth: ^2.0.0+1
share: "^0.6.5+2"
firebase_performance: ^0.3.1+4
rxdart: ^0.24.1
url_launcher: ^5.7.2
rflutter_alert: ^1.1.0
flutter_custom_tabs: ^0.6.0
geolocator: ^5.3.2+2
image_crop: ^0.3.3
intro_slider: ^2.3.3
highlighter_coachmark: "^0.0.3"
rate_my_app: "^0.4.0"
photo_view: ^0.10.2
zoomable_image: ^1.3.1
timer_builder: "^1.3.0"
package_info: ^0.4.3
flutter_screenutil: ^3.1.1
super_tooltip: ^0.9.0
currency_pickers: ^1.0.6
backdrop: ^0.4.6
flutter_native_splash: ^0.1.9
quiver: ^2.1.3
apple_sign_in: ^0.1.0
flushbar: ^1.10.4
intl: ^0.16.1
image_picker: ^0.6.7+14
expandable_text: ^1.1.0
dev_dependencies:
flutter_test:
sdk: flutter
flutter_launcher_icons: "^0.7.4"
flutter_icons:
android: true
ios: true
image_path: "assets/new_logo.png"
image_path_android: "assets/new_logo.png"
image_path_ios: "assets/new_logo.png"
flutter:
uses-material-design: true
assets:
- assets/profile-placeholder.png
- assets/profile-placeholder-v1.png
- assets/background.jpg
- assets/blur_image.png
- assets/new_logo.png
- assets/orange_money.png
- assets/google_play_store.png
- assets/app_store.png
- assets/paypal.png
- assets/credit_card.png
- assets/bank_transfer.jpg
- assets/m-pesa-logo.png
- assets/momo.png
- assets/google_play.jpeg
- assets/restaurant_1.jpeg
- assets/restaurant_2.jpeg
- assets/restaurant_3.jpeg
- assets/restaurant_4.jpeg
fonts:
- family: ChatetYamoApp
fonts:
- asset: fonts/Lato-Regular.ttf
- asset: fonts/Lato-Black.ttf
- asset: fonts/Lato-Bold.ttf
flutter_native_splash:
image: assets/background.png
color: "42a5f5"
fill: true
android_disable_fullscreen: false
ios: false
Add your AndroidManifest.xml
<!-- The INTERNET permission is required for development. Specifically,
flutter needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
-->
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="com.android.vending.BILLING" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<!-- io.flutter.app.FlutterApplication is an android.app.Application that
calls FlutterMain.startInitialization(this); in its onCreate method.
In most cases you can leave this as-is, but you if you want to provide
additional functionality it is fine to subclass or reimplement
FlutterApplication and put your custom class here. -->
<application
android:name="com.chatetyamo.Application"
android:label="Chat&Yamo"
android:icon="@mipmap/ic_launcher">
<meta-data
android:name="flutterEmbedding"
android:value="2" />
<meta-data
android:name="com.google.firebase.messaging.default_notification_icon"
android:resource="@mipmap/ic_launcher" />
<activity
android:name=".MainActivity"
android:launchMode="singleTop"
android:theme="@style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|layoutDirection|fontScale|screenLayout|density"
android:hardwareAccelerated="true"
android:windowSoftInputMode="adjustResize">
<!-- This keeps the window background of the activity showing
until Flutter renders its first frame. It can be removed if
there is no splash screen (such as the default splash screen
defined in @style/LaunchTheme). -->
<meta-data
android:name="io.flutter.app.android.SplashScreenUntilFirstFrame"
android:value="true" />
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
<intent-filter>
<action android:name="FLUTTER_NOTIFICATION_CLICK" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name="com.yalantis.ucrop.UCropActivity"
android:screenOrientation="portrait"
android:theme="@style/Theme.AppCompat.Light.NoActionBar"/>
<meta-data android:name="com.facebook.sdk.ApplicationId"
android:value="@string/facebook_app_id"/>
<!-- meta-data android:name="firebase_performance_logcat_enabled" android:value="true" /-->
<!-- meta-data android:name="firebase_performance_collection_enabled" android:value="false" /-->
<activity android:name="com.facebook.FacebookActivity"
android:configChanges=
"keyboard|keyboardHidden|screenLayout|screenSize|orientation"
android:label="@string/app_name" />
<activity
android:name="com.facebook.CustomTabActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="@string/fb_login_protocol_scheme" />
</intent-filter>
</activity>
</application>
Add your /app/res/values/strings.xml
Chat&Yamo
<!-- Replace "000000000000" with your Facebook App ID here. -->
<string name="facebook_app_id">FacebookAppID</string>
<!--
Replace "000000000000" with your Facebook App ID here.
**NOTE**: The scheme needs to start with `fb` and then your ID.
-->
<string name="fb_login_protocol_scheme">fbFacebookAppID</string>
To Reproduce
- Migrate old flutter project (using flutter_facebook_auth) to flutterEmbedding v2
- run the app on android and try the Facebook login flow
Expected behavior
I expect the call await FacebookAuth.instance.login() to terminate either with an error or with a valid access token