darwin-morocho / flutter-facebook-auth

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

"Multiple commands produce...FBSDKCoreKit.framework" when trying to build iOS app #340

Closed kuyaC closed 9 months ago

kuyaC commented 1 year ago

What version are you using?

5.0.10

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

macOS 13.3.1

What platforms are you seeing the problem on?

iOS

pubspec.yaml

name: ******
description: A new Flutter application.

# 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: 0.9.0+1 #version number (version name)+build number (version code)
#^^gets updated in:
#local.properties for android, where that gets referenced from from app-lvl build.gradle in 2 places (def flutterVersionCode/Name... and defaultConfig {...}
#and flutter_export_environment.sh, where it gets referenced from Info.plist

environment:
  sdk: ">=2.7.0 <3.0.0"

dependencies:
  flutter:
    sdk: flutter

  flutter_localizations:
    sdk: flutter

  # The following adds the Cupertino Icons font to your application.
  # Use with the CupertinoIcons class for iOS style icons.
  cupertino_icons: ^1.0.5

  #google (& facebook :P)
  firebase_core: ^2.10.0
  firebase_analytics: ^10.2.1
  firebase_crashlytics: ^3.1.2
  firebase_auth: ^4.4.2
  google_sign_in: ^6.1.0
  flutter_facebook_auth: ^5.0.10
  cloud_firestore: ^4.5.3
  google_mobile_ads: ^2.4.0
  firebase_app_check: ^0.1.2+3
#  intl: ^0.18.0

  in_app_purchase: ^3.1.5

  #for firebase authentication (not by google)
  provider: ^6.0.5

  #other
  flutter_spinkit: ^5.1.0
  shared_preferences: ^2.1.0
  flutter_tts: ^3.6.3
  connectivity_plus: ^3.0.6 #https://www.youtube.com/watch?v=P2vaBZDSqzg to disable features when flutter_offline:
  scrollable_positioned_list: ^0.3.6
  url_launcher: ^6.1.10 #hyperlinks
  smooth_page_indicator: ^1.1.0 #used in the intro(duction) screen
  another_flushbar: ^1.12.29 #used in mc words&sentences for example to show alternative translations
  styled_text: ^7.0.0

  #html_editor_enhanced: ^2.5.1
  #flutter_quill: ^6.3.2
  #quill_html_editor: ^2.0.5
  webview_flutter: ^4.2.0 #the only one I got it to work with, see learning_guide_screen.dart

dev_dependencies:
  flutter_test:
    sdk: flutter

# 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/
    # it should work with this line alone^^ but it doesn't, had to add the below lines
    - assets/logo_white_on_transparent.png
    - assets/logo_white_on_transparent_large.png
    - assets/country_flags/
    - assets/social_logins/
    - lang/

  # 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: Schyler
  #     fonts:
  #       - asset: fonts/Schyler-Regular.ttf
  #       - asset: fonts/Schyler-Italic.ttf
  #         style: italic
  #   - family: Trajan Pro
  #     fonts:
  #       - asset: fonts/TrajanPro.ttf
  #       - asset: fonts/TrajanPro_Bold.ttf
  #         weight: 700
  #
  # For details regarding fonts from package dependencies,
  # see https://flutter.dev/custom-fonts/#from-packages

Describe the Bug

I have censored my appname to "**" as I want to keep that secret for now.

Hello,

Since upgrading my iOS, MacOS, and XCode to the newest versions, I get an error when trying to build my iOS Flutter app: "Multiple commands produce...FBSDKCoreKit.framework"

I have tried countless solutions found all over the internet, with no success.

I have described my issue and my programming environment in more detail in this stackoverflow post.

This problem has been delaying the release of my iOS app for over three weeks. Any help would be greatly appreciated.

Best regards, Cédric Diederich

Expected Behavior

The app should just get built 🤷

To Reproduce

All details can't be found in section "describe the bug".

Relevant log output

Multiple commands produce '/Users//Library/Developer/Xcode/DerivedData/Runner-bczatismiambuefczuntppsiskse/Build/Products/Debug-iphoneos/Runner.app/Frameworks/FBSDKCoreKit.framework'

Target 'Runner' (project 'Runner') has copy command from '/Users//Documents/AndroidStudioProjects//ios/Pods/FBSDKCoreKit/XCFrameworks/FBSDKCoreKit.xcframework/ios-arm64/FBSDKCoreKit.framework' to '/Users/<my-name/Library/Developer/Xcode/DerivedData/Runner-bczatismiambuefczuntppsiskse/Build/Products/Debug-iphoneos/Runner.app/Frameworks/FBSDKCoreKit.framework'

That command depends on command in Target 'Runner' (project 'Runner'): script phase “[CP] Embed Pods Frameworks”

flutter doctor -v

Doctor summary (to see all details, run flutter doctor -v):
[v] Flutter (Channel stable, 3.7.1, on macOS 13.3.1 22261 darwin-x64, locale en-GB)
[v] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
[v] Xcode - develop for 10S and macOS (Xcode 14.3)
[v] Chrome - develop for the web
[v] Android Studio (version 2021.3)
[v] IntelliJ IDEA Ultimate Edition (version 2021.1)
[v] VS Code (version 1.76.2)
[v] Connected device (3 available)
[v] HTTP Host Availability
• No issues found!

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>CADisableMinimumFrameDurationOnPhone</key>
    <true/>
    <key>CFBundleDevelopmentRegion</key>
    <string>$(DEVELOPMENT_LANGUAGE)</string>
    <key>CFBundleDisplayName</key>
    <string>******</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>******</string>
    <key>CFBundlePackageType</key>
    <string>APPL</string>
    <key>CFBundleShortVersionString</key>
    <string>$(FLUTTER_BUILD_NAME)</string>
    <key>CFBundleSignature</key>
    <string>????</string>
    <key>CFBundleURLTypes</key>
    <array>
        <dict>
            <key>CFBundleURLSchemes</key>
            <array>
                <string>fb828723188239449</string>
            </array>
        </dict>
        <dict>
            <key>CFBundleTypeRole</key>
            <string>Editor</string>
            <key>CFBundleURLSchemes</key>
            <array>
                <string>com.googleusercontent.apps.824632089677-v9hecu61b557g00h2n232280ngtblcni</string>
            </array>
        </dict>
    </array>
    <key>CFBundleVersion</key>
    <string>$(FLUTTER_BUILD_NUMBER)</string>
    <key>FacebookAppID</key>
    <string>828723188239449</string>
    <key>FacebookClientToken</key>
    <string>398f4dc3bf261e113704af540563bf2b</string>
    <key>FacebookDisplayName</key>
    <string>******</string>
    <key>GADApplicationIdentifier</key>
    <string>ca-app-pub-5487807382294047~3849368255</string>
    <key>GIDClientID</key>
    <string>824632089677-v9hecu61b557g00h2n232280ngtblcni.apps.googleusercontent.com</string>
    <key>ITSAppUsesNonExemptEncryption</key>
    <false/>
    <key>LSApplicationQueriesSchemes</key>
    <array>
        <string>fbapi</string>
        <string>fb-messenger-share-api</string>
    </array>
    <key>LSRequiresIPhoneOS</key>
    <true/>
    <key>UIApplicationSupportsIndirectInputEvents</key>
    <true/>
    <key>UILaunchStoryboardName</key>
    <string>LaunchScreen</string>
    <key>UIMainStoryboardFile</key>
    <string>Main</string>
    <key>UISupportedInterfaceOrientations</key>
    <array>
        <string>UIInterfaceOrientationPortrait</string>
    </array>
    <key>UISupportedInterfaceOrientations~ipad</key>
    <array>
        <string>UIInterfaceOrientationLandscapeLeft</string>
        <string>UIInterfaceOrientationLandscapeRight</string>
        <string>UIInterfaceOrientationPortrait</string>
        <string>UIInterfaceOrientationPortraitUpsideDown</string>
    </array>
    <key>UIViewControllerBasedStatusBarAppearance</key>
    <false/>
</dict>
</plist>

Podfile (iOS)

# Uncomment this line to define a global platform for your project
platform :ios, '13.0'

# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'

project 'Runner', {
  'Debug' => :debug,
  'Profile' => :release,
  'Release' => :release,
}

def flutter_root
  generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__)
  unless File.exist?(generated_xcode_build_settings_path)
    raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first"
  end

  File.foreach(generated_xcode_build_settings_path) do |line|
    matches = line.match(/FLUTTER_ROOT\=(.*)/)
    return matches[1].strip if matches
  end
  raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get"
end

require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)

flutter_ios_podfile_setup

#install! 'cocoapods', :disable_input_output_paths => true #didn't work from https://github.com/flutter/flutter/issues/20685

target 'Runner' do
  use_frameworks!
  use_modular_headers!

  flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))

  # pods for firebase: //firebase: https://firebase.google.com/docs/ios/setup?authuser=0#available-pods
  # Add the Firebase pod for Google Analytics
  pod 'FirebaseAnalytics'

  # For Analytics without IDFA collection capability, use this pod instead
  # pod ‘Firebase/AnalyticsWithoutAdIdSupport’

  # Add the pods for any other Firebase products you want to use in your app
  # For example, to use Firebase Authentication and Cloud Firestore
  pod 'FirebaseAuth'
  pod 'GoogleSignIn'
  pod 'FBSDKCoreKit' # https://stackoverflow.com/questions/60005793/no-such-module-facebookcore-in-swift-5#answer-61751523
  pod 'FBSDKLoginKit' #<- only this one is mentioned in the docs: https://developers.facebook.com/apps/828723188239449/fb-login/quickstart/?sdk=cocoapods
  pod 'FirebaseFirestore'
  pod 'FirebaseFunctions'
  pod 'FirebaseAppCheck'

end

post_install do |installer|
  installer.pods_project.targets.each do |target|
    flutter_additional_ios_build_settings(target)
  end

#  installer.generated_projects.each do |project|
#    project.targets.each do |target|
#      target.build_configurations.each do |config|
#          config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '13.0'
#       end
#    end
#  end

#  post_install do |installer|
#    installer.pods_project.targets.each do |target|
#      target.build_configurations.each do |config|
#        # drop deployment target so it works with ios14
#        config.build_settings.delete 'IPHONEOS_DEPLOYMENT_TARGET'
#      end
#    end
#  end

#  post_install do |installer|
#    installer.pods_project.targets.each do |target|
#      flutter_additional_ios_build_settings(target)
#      target.build_configurations.each do |config|
#        config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '13.0'
#      end
#    end
#  end

end

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

Could you check https://github.com/darwin-morocho/flutter-facebook-auth/issues/326

darwin-morocho commented 1 year ago

https://github.com/facebook/facebook-ios-sdk/issues/2121

sagarshree commented 1 year ago

Same problem, [✓] Flutter (Channel stable, 3.7.1, on macOS 12.5.1 21G83 darwin-arm64, locale en-NP) [✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0) [✓] Xcode - develop for iOS and macOS (Xcode 14.2) [✓] Chrome - develop for the web [✓] Android Studio (version 2020.3) [✓] IntelliJ IDEA Ultimate Edition (version 2022.1.1) [✓] IntelliJ IDEA Ultimate Edition (version 2022.1.1) [✓] IntelliJ IDEA Ultimate Edition (version 2021.3) [✓] VS Code (version 1.78.0) [✓] Connected device (2 available) [✓] HTTP Host Availability

Tools • Dart 2.19.1 • DevTools 2.20.1

darwin-morocho commented 1 year ago

Same problem,

[✓] Flutter (Channel stable, 3.7.1, on macOS 12.5.1 21G83 darwin-arm64, locale en-NP)

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

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

[✓] Chrome - develop for the web

[✓] Android Studio (version 2020.3)

[✓] IntelliJ IDEA Ultimate Edition (version 2022.1.1)

[✓] IntelliJ IDEA Ultimate Edition (version 2022.1.1)

[✓] IntelliJ IDEA Ultimate Edition (version 2021.3)

[✓] VS Code (version 1.78.0)

[✓] Connected device (2 available)

[✓] HTTP Host Availability

Tools • Dart 2.19.1 • DevTools 2.20.1

Could you provide all info required in the issue template?

Podfile pubspec.yaml AppDelegate.swift