roughike / flutter_facebook_login

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

Plugin crashes on Flutter 1.17 #267

Open marcosmko opened 4 years ago

marcosmko commented 4 years ago

Hello!

I'm having some problems using the facebook plugin since flutter upgrade to version 1.17, two days ago (6 May). I use it on a flutter module embedded in an android native app.

When upgrading plugins, it shows:

The plugin flutter_facebook_login is built using an older version of the Android plugin API which assumes that it's running in a full-Flutter environment. It may have undefined behaviors when Flutter is integrated into an existing app as a module.

And when trying to launch app, it crashes with the following error: E/AndroidRuntime: FATAL EXCEPTION: main Process: com.meseems, PID: 7306 java.lang.RuntimeException: Unable to start activity ComponentInfo{com.meseems/com.meseems.meseemsapp.flutter.FlutterMainActivity}: java.lang.NullPointerException: Attempt to invoke interface method 'void io.flutter.plugin.common.BinaryMessenger.setMessageHandler(java.lang.String, io.flutter.plugin.common.BinaryMessenger$BinaryMessageHandler)' on a null object reference at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3270) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3409) at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83) at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135) at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2016) at android.os.Handler.dispatchMessage(Handler.java:107) at android.os.Looper.loop(Looper.java:214) at android.app.ActivityThread.main(ActivityThread.java:7356) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930) Caused by: java.lang.NullPointerException: Attempt to invoke interface method 'void io.flutter.plugin.common.BinaryMessenger.setMessageHandler(java.lang.String, io.flutter.plugin.common.BinaryMessenger$BinaryMessageHandler)' on a null object reference at io.flutter.plugin.common.MethodChannel.setMethodCallHandler(MethodChannel.java:116) at com.roughike.facebooklogin.facebooklogin.FacebookLoginPlugin.registerWith(FacebookLoginPlugin.java:43) at io.flutter.plugins.GeneratedPluginRegistrant.registerWith(GeneratedPluginRegistrant.java:22) at com.meseems.meseemsapp.flutter.FlutterSimpleActivity.configureFlutterEngine(FlutterSimpleActivity.java:52) at io.flutter.embedding.android.FlutterActivityAndFragmentDelegate.onAttach(FlutterActivityAndFragmentDelegate.java:178) at io.flutter.embedding.android.FlutterActivity.onCreate(FlutterActivity.java:409) at android.app.Activity.performCreate(Activity.java:7802) at android.app.Activity.performCreate(Activity.java:7791) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1299) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3245) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3409)  at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83)  at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)  at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2016)  at android.os.Handler.dispatchMessage(Handler.java:107)  at android.os.Looper.loop(Looper.java:214)  at android.app.ActivityThread.main(ActivityThread.java:7356)  at java.lang.reflect.Method.invoke(Native Method)  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930) 

Any help on that?

fehimdervisbegovic commented 4 years ago

I have a similar problem.

E/AndroidRuntime(27770): FATAL EXCEPTION: main E/AndroidRuntime(27770): Process: com.xxxxx.yyyyy, PID: 27770 E/AndroidRuntime(27770): java.lang.NoClassDefFoundError: Failed resolution of: Lcom/facebook/common/R$layout; E/AndroidRuntime(27770): at com.facebook.FacebookActivity.onCreate(FacebookActivity.java:78) E/AndroidRuntime(27770): at android.app.Activity.performCreate(Activity.java:7327) E/AndroidRuntime(27770): at android.app.Activity.performCreate(Activity.java:7318) E/AndroidRuntime(27770): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1271) E/AndroidRuntime(27770): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3094) E/AndroidRuntime(27770): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3257) E/AndroidRuntime(27770): at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78) E/AndroidRuntime(27770): at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108) E/AndroidRuntime(27770): at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68) E/AndroidRuntime(27770): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1948) E/AndroidRuntime(27770): at android.os.Handler.dispatchMessage(Handler.java:106) E/AndroidRuntime(27770): at android.os.Looper.loop(Looper.java:214) E/AndroidRuntime(27770): at android.app.ActivityThread.main(ActivityThread.java:7050) E/AndroidRuntime(27770): at java.lang.reflect.Method.invoke(Native Method) E/AndroidRuntime(27770): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:494) E/AndroidRuntime(27770): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:965) E/AndroidRuntime(27770): Caused by: java.lang.ClassNotFoundException: Didn't find class "com.facebook.common.R$layout" on path: DexPathList[[zip file

dannycortesv commented 4 years ago

This is also happening to me, do you plan an update? :)

placidovlm commented 4 years ago

I have the same problem. Dear Developer, please, feedback us !

marcosmko commented 4 years ago

@roughike hello can we have some feedback on this please? :)

marcosmko commented 4 years ago

Hello all, I have just created a PR fixing the problem.

272

Any feedback would be appreciated! @roughike

placidovlm commented 4 years ago

ok, I know this, only talking about documentation ! already using, 2.xx and 3.00 works fine ! Thank you !

Em sáb., 30 de mai. de 2020 às 13:02, leventkantaroglu < notifications@github.com> escreveu:

worked when downgrading package to 2.x.x

flutter doctor -v

[✓] Flutter (Channel stable, v1.17.1, on Mac OS X 10.15.4 19E287, locale en-TR)

• Flutter version 1.17.1 at /Users/leventkantaroglu/Development/flutter

• Framework revision f7a6a7906b (3 weeks ago), 2020-05-12 18:39:00 -0700

• Engine revision 6bc433c6b6

• Dart version 2.8.2

[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2)

• Android SDK at /Users/leventkantaroglu/Library/Android/sdk

• Platform android-29, build-tools 29.0.2

• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java

• Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)

• All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 11.2.1)

• Xcode at /Applications/Xcode.app/Contents/Developer

• Xcode 11.2.1, Build version 11B500

• CocoaPods version 1.9.1

[✓] Android Studio (version 3.5)

• Android Studio at /Applications/Android Studio.app/Contents

• Flutter plugin version 41.0.2

• Dart plugin version 191.8593

• Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)

[✓] VS Code (version 1.45.1)

• VS Code at /Applications/Visual Studio Code.app/Contents

• Flutter extension version 3.11.0

[✓] Connected device (2 available)

• SM A505F                  • R58M4312H3Y   • android-arm64 • Android 10 (API 29)

• Android SDK built for x86 • emulator-5554 • android-x86   • Android 10 (API 29) (emulator)

• No issues found!

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/roughike/flutter_facebook_login/issues/267#issuecomment-636357863, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAKSSD2GHIHCYFOULZ7A2H3RUE3Z3ANCNFSM4M4EK32Q .

-- Plácido Vicente Lavôr Mitoso placidovlm@gmail.com (92) 99388-0024