Closed JackHuang111 closed 9 months ago
@JackHuang111 sorry but the problem is not the meta data tags. They are in the right place, you can check the official facebook documentation https://developers.facebook.com/docs/facebook-login/android
I'm almost sure the error is due to a bad configuration in your AndroidManifest. If you don't put the complete code of that file I cannot help you.
Keep in mind that you must be created the string.xml file in/android/app/src/main/res/values/strings.xml
with your facebook app id and your client token
@darwin-morocho here is my full AndroidManifest. And the string.xml is also setting done.
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.jooca.kitchenhand.launch.kitchenhand">
<uses-permission android:name="android.permission.INTERNET"/>
<queries>
<provider android:authorities="com.facebook.katana.provider.PlatformProvider"/>
</queries>
<application
android:label="kitchenhand"
android:name="${applicationName}"
android:icon="@mipmap/ic_launcher">
<activity
android:name=".MainActivity"
android:exported="true"
android:launchMode="singleTop"
android:theme="@style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true"
android:windowSoftInputMode="adjustResize">
<!-- Specifies an Android theme to apply to this Activity as soon as
the Android process has started. This theme is visible to the user
while the Flutter UI initializes. After that, this theme continues
to determine the Window background behind the Flutter UI. -->
<meta-data
android:name="io.flutter.embedding.android.NormalTheme"
android:resource="@style/NormalTheme"
/>
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
<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:host="kitchenhand.page.link"
android:scheme="https"/>
</intent-filter>
</activity>
<!-- Don't delete the meta-data below.
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
<meta-data
android:name="flutterEmbedding"
android:value="2"/>
<meta-data android:name="com.facebook.sdk.ApplicationId" android:value="@string/facebook_app_id"/>
<meta-data android:name="com.facebook.sdk.ClientToken" android:value="@string/facebook_client_token"/>
<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>
</manifest>
@JackHuang111 since flutter_facebook_auth: 4.x you don't need
<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>
Try to remove that tags.
Also any permission tag must be after the queries tag.
check this example https://github.com/darwin-morocho/flutter-facebook-auth/blob/master/examples/with_provider/android/app/src/main/AndroidManifest.xml
Also please run your app since android studio and copy the error logs from your logcat and put them here
I removed the activity part and this is the log after that.
It shows a blank screen, and got another problem.
I have already upgrade flutter_local_notifications
to 12.0.4 but still not work.
I wonder if it is needed to upgrade flutter_local_notifications
to 13.0.0 .....
√ Built build\app\outputs\flutter-apk\app-debug.apk.
Debug service listening on ws://127.0.0.1:4215/1WHvkvUDxa4=/ws
Syncing files to device SM A920F...
I/flutter ( 9393): Firebase.initializeApp() completed
I/flutter ( 9393): **** eSoMk8cmSImqQch6Bqm6AD:APA91bFrZsj1AdN-c8Ag3Z02NfRPkn6_lmwI3QgR0i6Kv1JQEduTnp-OYB17-eDtXtFjqmCS_VCZBaU9vokH2O-HudOjU10BUEHtzfvRM8cbYLECjc7IlUGXjozQwv0wI1AE1XF4rjMT
E/flutter ( 9393): [ERROR:flutter/lib/ui/ui_dart_state.cc(209)] Unhandled Exception: MissingPluginException(No implementation found for method createNotificationChannel on channel dexterous.com/flutter/local_notifications)
E/flutter ( 9393): #0 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:175:7)
E/flutter ( 9393): <asynchronous suspension>
E/flutter ( 9393): #1 main (package:easy_cook/main.dart:60:5)
E/flutter ( 9393): <asynchronous suspension>
E/flutter ( 9393):
I/chenhand.launc( 9393): Compiler allocated 4266KB to compile void android.view.ViewRootImpl.performTraversals()
@JackHuang111 sorry but I don't have the enough info about what is the problem. So I am not able to help you
What version are you using?
flutter_facebook_auth ^5.0.6
What OS and version are you using to local deploy your application?
windows 11
What platforms are you seeing the problem on?
Android
pubspec.yaml
Describe the Bug
I just follow the document to seting up the file. https://facebook.meedu.app/docs/5.x.x/android After that, I run the flutter app and goes crash.
Expected Behavior
Launch app and login with facebook successfully.
To Reproduce
according to this document Android configuration https://facebook.meedu.app/docs/5.x.x/android
Relevant log output
No response
flutter doctor -v
Info.plist (iOS)
No response
Podfile (iOS)
No response
AndroidManifest.xml
MainActivity.java
No response
MainActivity.kt
index.html
No response
Info.plist (macOS)
No response