darwin-morocho / flutter-facebook-auth

A flutter plugin to add login with facebook in your flutter app
193 stars 127 forks source link

App crashes on launch #333

Closed vytautas-pranskunas- closed 1 year ago

vytautas-pranskunas- commented 1 year ago

What version are you using?

flutter_facebook_auth : ^5.0.8

What OS and version are you using to local deploy your application?

macOS 13 ventura and for emulator IOS 16.2

What platforms are you seeing the problem on?

iOS

pubspec.yaml

name: senio_assist
description: A new Flutter project.

# The following line prevents the package from being accidentally published to
# pub.dev using `pub publish`. This is preferred for private packages.
publish_to: "none" # Remove this line if you wish to publish to pub.dev

# The following defines the version and build number for your application.
# A version number is three numbers separated by dots, like 1.2.43
# followed by an optional build number separated by a +.
# Both the version and the builder number may be overridden in flutter
# build by specifying --build-name and --build-number, respectively.
# In Android, build-name is used as versionName while build-number used as versionCode.
# Read more about Android versioning at https://developer.android.com/studio/publish/versioning
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
# Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
version: 99.99.99+99

environment:
  sdk: ">=2.19.4 <3.0.0"

dependencies:
  apple_sign_in_safety: ^0.0.6
  auto_size_text: ^3.0.0
  cached_network_image: ^3.1.0
  collection: ^1.15.0-nullsafety.4
  confetti: ^0.7.0
  connectivity_plus: ^3.0.3
  country_code_picker: ^3.0.0
  cupertino_icons: ^1.0.2
  darq: ^1.1.1
  dio: ^4.0.0
  email_validator: ^2.0.1
  enum_to_string: ^2.0.1
  fancy_on_boarding: ^1.8.0-nullsafety.0
  feature_discovery: ^0.14.1
  file_picker: ^4.0.3
  firebase_analytics: ^10.1.5
  firebase_auth: ^4.4.0
  firebase_core: ^2.7.1
  firebase_dynamic_links: ^5.0.16
  firebase_messaging: ^14.2.6
  flutter:
    sdk: flutter
  flutter_cache_manager: ^3.1.2
  flutter_credit_card: ^3.0.1
  flutter_facebook_auth: ^5.0.8
  flutter_fgbg: ^0.2.0
  flutter_image_compress: ^1.0.0
  flutter_local_notifications: ^9.2.0
  flutter_localizations:
    sdk: flutter
  flutter_markdown: ^0.6.2
  flutter_mobx: ^2.0.0
  flutter_native_timezone: ^2.0.0
  flutter_rating_bar: ^4.0.0
  flutter_screenutil: ^5.5.3+2
  flutter_slidable: ^2.0.0
  flutter_spinkit: ^5.0.0
  flutter_typeahead: ^4.0.0
  fresh_dio: ^0.3.1
  fresh_graphql: ^0.5.1
  file: ^6.1.4
  geocoding: ^2.0.0
  geolocator: ^9.0.2
  get_it: ^7.0.0
  google_sign_in: ^6.0.2
  graphql_flutter: ^5.2.0-beta.1
  hive: ^2.0.4
  hive_flutter: ^1.0.0
  image_cropper: ^3.0.1
  image_picker: ^0.8.4+4
  intl: ^0.17.0
  launch_review: ^3.0.1
  libphonenumber: ^2.0.0
  load: ^1.0.0
  logging: ^1.1.1
  mime: ^1.0.0
  mobx: ^2.0.1
  objectdb: ^1.2.1
  oktoast: ^3.0.0
  path: ^1.8.2
  path_provider: ^2.0.13
  purchases_flutter: ^4.10.4
  quiver: ^3.2.1
  rxdart: ^0.27.3
  sentry: ^6.2.2
  stripe_payment:
    git:
      url: https://github.com/vytautas-pranskunas-/flutter_stripe_payment.git
      ref: master
  styled_text: ^7.0.0
  table_calendar: ^3.0.0
  timezone: ^0.8.0
  url_launcher: ^6.0.3
  uuid: ^3.0.4
  youtube_player_flutter: ^8.0.0
  veriff_flutter: ^3.1.0
  modal_bottom_sheet:
    git:
      url: https://github.com/followthemoney1/modal_bottom_sheet.git
      ref: main
      path: modal_bottom_sheet

dev_dependencies:
  build_runner: ^2.0.1
  flutter_launcher_icons: ^0.11.0
  flutter_lints: ^2.0.1
  flutter_test:
    sdk: flutter
  mobx_codegen: ^2.0.1+3
  mockito: ^5.0.16

flutter_icons:
  ios: true
  android: true
  image_path_ios: "stuff/launcher/fallback_icon_ios.png"
  image_path_android: "stuff/launcher/fallback_icon.png"
  adaptive_icon_background: "stuff/launcher/background.png"
  adaptive_icon_foreground: "stuff/launcher/foreground.png"

# For information on the generic Dart part of this file, see the
# following page: https://dart.dev/tools/pub/pubspec
# The following section is specific to Flutter.
flutter:
  # The following line ensures that the Material Icons font is
  # included with your application, so that you can use the icons in
  # the material Icons class.
  uses-material-design: true
  # To add assets to your application, add an assets section, like this:
  assets:
    - assets/
    - assets/lang/
    - assets/images/
    - assets/images/flags/
    - assets/images/credit_cards/
    - assets/terms_and_conditions/
  #   - images/a_dot_burr.jpeg
  #   - images/a_dot_ham.jpeg
  # An image asset can refer to one or more resolution-specific "variants", see
  # https://flutter.dev/assets-and-images/#resolution-aware.
  # For details regarding adding assets from package dependencies, see
  # https://flutter.dev/assets-and-images/#from-packages
  # To add custom fonts to your application, add a fonts section here,
  # in this "flutter" section. Each entry in this list should have a
  # "family" key with the font family name, and a "fonts" key with a
  # list giving the asset and other descriptors for the font. For
  # example:
  fonts:
    - family: Merriweather
      fonts:
        - asset: assets/fonts/Merriweather-Black.ttf
        - asset: assets/fonts/Merriweather-BlackItalic.ttf
        - asset: assets/fonts/Merriweather-Bold.ttf
        - asset: assets/fonts/Merriweather-BoldItalic.ttf
        - asset: assets/fonts/Merriweather-Italic.ttf
        - asset: assets/fonts/Merriweather-Light.ttf
        - asset: assets/fonts/Merriweather-LightItalic.ttf
        - asset: assets/fonts/Merriweather-Regular.ttf
          style: normal
    - family: SenioIcons
      fonts:
        - asset: assets/fonts/SenioIcons.ttf
  # For details regarding fonts from package dependencies,
  # see https://flutter.dev/custom-fonts/#from-packages

Describe the Bug

After igrating to latest 3.7.8 i have experienced app crashes on launch. After investigation i came up upt to the point when this dependency is removed everything works fine If i add this to pubspec.yaml app is not starting

Expected Behavior

App should start

To Reproduce

https://github.com/vytautas-pranskunas-/flutter-facebook-auth

Relevant log output

No response

flutter doctor -v

[✓] Flutter (Channel stable, 3.7.8, on macOS 13.2.1 22D68 darwin-x64, locale en-CH)
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
[✓] Xcode - develop for iOS and macOS (Xcode 14.2)
[✓] Android Studio (version 4.2)
[✓] VS Code (version 1.76.1)
[✓] Connected device (2 available)
[✓] HTTP Host Availability

Info.plist (iOS)

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>CFBundleDevelopmentRegion</key>
    <string>$(DEVELOPMENT_LANGUAGE)</string>
    <key>CFBundleDisplayName</key>
    <string>Test3</string>
    <key>CFBundleExecutable</key>
    <string>$(EXECUTABLE_NAME)</string>
    <key>CFBundleIdentifier</key>
    <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
    <key>CFBundleInfoDictionaryVersion</key>
    <string>6.0</string>
    <key>CFBundleName</key>
    <string>test3</string>
    <key>CFBundlePackageType</key>
    <string>APPL</string>
    <key>CFBundleShortVersionString</key>
    <string>$(FLUTTER_BUILD_NAME)</string>
    <key>CFBundleSignature</key>
    <string>????</string>
    <key>CFBundleVersion</key>
    <string>$(FLUTTER_BUILD_NUMBER)</string>
    <key>LSRequiresIPhoneOS</key>
    <true/>
    <key>UILaunchStoryboardName</key>
    <string>LaunchScreen</string>
    <key>UIMainStoryboardFile</key>
    <string>Main</string>
    <key>UISupportedInterfaceOrientations</key>
    <array>
        <string>UIInterfaceOrientationPortrait</string>
        <string>UIInterfaceOrientationLandscapeLeft</string>
        <string>UIInterfaceOrientationLandscapeRight</string>
    </array>
    <key>UISupportedInterfaceOrientations~ipad</key>
    <array>
        <string>UIInterfaceOrientationPortrait</string>
        <string>UIInterfaceOrientationPortraitUpsideDown</string>
        <string>UIInterfaceOrientationLandscapeLeft</string>
        <string>UIInterfaceOrientationLandscapeRight</string>
    </array>
    <key>UIViewControllerBasedStatusBarAppearance</key>
    <false/>
    <key>CADisableMinimumFrameDurationOnPhone</key>
    <true/>
    <key>UIApplicationSupportsIndirectInputEvents</key>
    <true/>
    <key>CFBundleURLTypes</key>
    <array>
        .......
    </array>
</dict>
</plist>

Podfile (iOS)

No response

AndroidManifest.xml

No response

MainActivity.java

No response

MainActivity.kt

No response

index.html

No response

Info.plist (macOS)

No response

darwin-morocho commented 1 year ago

@vytautas-pranskunas- In your example the ios config is missing, your info.plist must have this

<key>FacebookAppID</key>
<string>{your-app-id}</string>
<key>FacebookClientToken</key>
<string>CLIENT-TOKEN</string>
<key>FacebookDisplayName</key>
<string>{your-app-name}</string>
<key>LSApplicationQueriesSchemes</key>
<array>
  <string>fbapi</string>
  <string>fb-messenger-share-api</string>
</array>
vytautas-pranskunas- commented 1 year ago

I have i just did not paste it

darwin-morocho commented 1 year ago

I have i just did not paste it

try to run your project on xcode and paste the crash logs here

vytautas-pranskunas- commented 1 year ago

I will. Just a moment. I just mean that it was working before upgrading to latest flutter so i have everything in info.plist :)))

vytautas-pranskunas- commented 1 year ago

Screenshot 2023-03-30 at 21 11 39 my crash log is empty. But it is not running on emulator... app opens and is closed immediatly and then it just keeps hanging forever receiving signt signal Screenshot 2023-03-30 at 21 15 50

darwin-morocho commented 1 year ago

Screenshot 2023-03-30 at 21 11 39 my crash log is empty. But it is not running on emulator... app opens and is closed immediatly and then it just keeps hanging forever receiving signt signal Screenshot 2023-03-30 at 21 15 50

I mean run your project > open your console and when the app crashes you will see the crash logs

vytautas-pranskunas- commented 1 year ago

you mean this:

dyld[98746]: Library not loaded: @rpath/FBSDKCoreKit.framework/FBSDKCoreKit Referenced from: /Users/vytautaspranskunas/Library/Developer/CoreSimulator/Devices/5B0F54AB-72A6-4A6A-B9B6-DCA6D358498F/data/Containers/Bundle/Application/F61A9F3D-2CE9-4827-A8D6-249A22CDB1DC/Runner.app/Runner Reason: tried: '/Users/vytautaspranskunas/Library/Developer/Xcode/DerivedData/Runner-azjquebwvtsoqcgzragjpvduglwh/Build/Products/Debug-iphonesimulator/FBSDKCoreKit.framework/FBSDKCoreKit' (errno=2), '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/swift/FBSDKCoreKit.framework/FBSDKCoreKit' (errno=2), '/usr/lib/swift/FBSDKCoreKit.framework/FBSDKCoreKit' (errno=2, not in dyld cache), '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/swift/FBSDKCoreKit.framework/FBSDKCoreKit' (errno=2), '/usr/lib/swift/FBSDKCoreKit.framework/FBSDKCoreKit' (errno=2, not in dyld cache), '/Users/vytautaspranskunas/Library/Developer/CoreSimulator/Devices/5B0F54AB-72A6-4A6A-B9B6-DCA6D358498F/data/Containers/Bundle/Application/F61A9F3D-2CE9-4827-A8D6-249A22CDB1DC/Runner.app/Frameworks/FBSDKCoreKit.framework/FBSDKCoreKit' (errno=2), '/Users/vytautaspranskunas/Library/Developer/CoreSimulator/Devices/5B0F54AB-72A6-4A6A-B9B6-DCA6D358498F/data/Containers/Bundle/Application/F61A9F3D-2CE9-4827-A8D6-249A22CDB1DC/Runner.app/Frameworks/FBSDKCoreKit.framework/FBSDKCoreKit' (errno=2), '/Users/vytautaspranskunas/Library/Developer/CoreSimulator/Devices/5B0F54AB-72A6-4A6A-B9B6-DCA6D358498F/data/Containers/Bundle/Application/F61A9F3D-2CE9-4827-A8D6-249A22CDB1DC/Runner.app/Frameworks/FBSDKCoreKit.framework/FBSDKCoreKit' (errno=2), '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/swift/FBSDKCoreKit.framework/FBSDKCoreKit' (errno=2), '/usr/lib/swift/FBSDKCoreKit.framework/FBSDKCoreKit' (errno=2, not in dyld cache), '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/swift/FBSDKCoreKit.framework/FBSDKCoreKit' (errno=2), '/usr/lib/swift/FBSDKCoreKit.framework/FBSDKCoreKit' (errno=2, not in dyld cache), '/Users/vytautaspranskunas/Library/Developer/CoreSimulator/Devices/5B0F54AB-72A6-4A6A-B9B6-DCA6D358498F/data/Containers/Bundle/Application/F61A9F3D-2CE9-4827-A8D6-249A22CDB1DC/Runner.app/Frameworks/FBSDKCoreKit.framework/FBSDKCoreKit' (errno=2), '/Users/vytautaspranskunas/Library/Developer/CoreSimulator/Devices/5B0F54AB-72A6-4A6A-B9B6-DCA6D358498F/data/Containers/Bundle/Application/F61A9F3D-2CE9-4827-A8D6-249A22CDB1DC/Runner.app/Frameworks/FBSDKCoreKit.framework/FBSDKCoreKit' (errno=2), '/Users/vytautaspranskunas/Library/Developer/CoreSimulator/Devices/5B0F54AB-72A6-4A6A-B9B6-DCA6D358498F/data/Containers/Bundle/Application/F61A9F3D-2CE9-4827-A8D6-249A22CDB1DC/Runner.app/Frameworks/FBSDKCoreKit.framework/FBSDKCoreKit' (errno=2), '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/FBSDKCoreKit.framework/FBSDKCoreKit' (errno=2) Library not loaded: @rpath/FBSDKCoreKit.framework/FBSDKCoreKit Referenced from: /Users/vytautaspranskunas/Library/Developer/CoreSimulator/Devices/5B0F54AB-72A6-4A6A-B9B6-DCA6D358498F/data/Containers/Bundle/Application/F61A9F3D-2CE9-4827-A8D6-249A22CDB1DC/Runner.app/Runner Reason: tried: '/Users/vytautaspranskunas/Library/Developer/Xcode/DerivedData/Runner-azjquebwvtsoqcgzragjpvduglwh/Build/Products/Debug-iphonesimulator/FBSDKCoreKit.framework/FBSDKCoreKit' (errno=2), '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/swift/FBSDKCoreKit.framework/FBSDKCoreKit' (errno=2), '/usr/lib/swift/FBSDKCoreKit.framework/FBSDKCoreKit' (errno=2, not in dyld cache), '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/swift/FBSDKCoreKit. dyld config: DYLD_SHARED_CACHE_DIR=/Users/vytautaspranskunas/Library/Developer/CoreSimulator/Caches/dyld/22D68/com.apple.CoreSimulator.SimRuntime.iOS-16-2.20C52 DYLD_ROOT_PATH=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot DYLD_LIBRARY_PATH=/Users/vytautaspranskunas/Library/Developer/Xcode/DerivedData/Runner-azjquebwvtsoqcgzragjpvduglwh/Build/Products/Debug-iphonesimulator:/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/introspection DYLD_INSERT_LIBRARIES=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libBacktraceRecording.dylib:/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libMainThreadChecker.dylib:/usr/lib/libRPAC.dylib:/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/Developer/Library/PrivateFrameworks/DTDDISupport.framework/libViewDebuggerSupport.dylib DYLD_FRAMEWORK_PATH=/Users/vytautaspranskunas/Library/Developer/Xcode/DerivedData/Runner-azjquebwvtsoqcgzragjpvduglwh/Build/Products/Debug-iphonesimulator DYLD_FALLBACK_FRAMEWORK_PATH=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks DYLD_FALLBACK_LIBRARY_PATH=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib

darwin-morocho commented 1 year ago

@vytautas-pranskunas- it seems duplicated https://github.com/darwin-morocho/flutter-facebook-auth/issues/326

darwin-morocho commented 1 year ago

Feel free to reopen the issue if you think that is not duplicated

vytautas-pranskunas- commented 1 year ago

hmm looks like.. should i try downgrading to 4.x.x? Or update cocopods to v1.12.0? Any ideas?

darwin-morocho commented 1 year ago

hmm looks like.. should i try downgrading to 4.x.x? Or update cocopods to v1.12.0? Any ideas?

try upgrading cocoapods

vytautas-pranskunas- commented 1 year ago

with: pod update flutter_facebook_auth? If it so i have tried already - same result

vytautas-pranskunas- commented 1 year ago

I have downgraded to 4.4.1+1 and it looks like it works now.... any idea when initial bug will be fixed?

darwin-morocho commented 1 year ago

I have downgraded to 4.4.1+1 and it looks like it works now.... any idea when initial bug will be fixed?

this issue was introduced into the native facebook sdk 15.x for more info check https://github.com/facebook/facebook-ios-sdk/issues/2121

jonaskivi commented 1 year ago

Cocoapods updating to 1.12 means uninstalling and re-installing cocoapods. Not a normal pod update.

Check with pod --version that you have version 1.11 of cocoapods. The last of these need to be run in flutter_app/ios/ folder, so run all of them there.

// uninstall cocoapods with: sudo gem uninstall cocoapods // possibly not necessary, but I did these as well (Looks like its removing some old cached pods data):

rm -rf ~/Library/Developer/Xcode/DerivedData/
rm -rf "${HOME}/Library/Caches/CocoaPods"

// Rest of these in folder flutter_app/ios/

rm -rf Pods
rm Podfile.lock

// re-install cocoapods

sudo gem install cocoapods
pod install --repo-update

// not sure if this final is even necessary. But it was in the example provided to me. pod update