oddbit / flutter_facebook_app_events

Flutter Plugin for Facebook App Events
https://pub.dev/packages/facebook_app_events
Apache License 2.0
129 stars 327 forks source link

[Bug]: In IOS error (xcode) linker command failed with exit code 1 (use -v to see invocation) #361

Closed waqasalianjum-zeepalm closed 4 days ago

waqasalianjum-zeepalm commented 5 months ago

Is there an existing issue for this?

Current Behavior

i am using this package and getting this error in package version (0.19.2)

Launching lib/main.dart on Iphone 14 pro in debug mode... Xcode build done. 50.1s Failed to build iOS app Error (Xcode): Undefined symbols: Error (Xcode): Linker command failed with exit code 1 (use -v to see invocation) Could not build the application for the simulator. Error launching application on Iphone 14 pro.

Expected Behavior

I must run the app and send analytics to Facebook

Steps To Reproduce

No response

Platform

iOS

Flutter Doctor

flutter doctor -v
[✓] Flutter (Channel master, 3.23.0-13.0.pre.197, on macOS 14.3.1 23D60 darwin-arm64, locale en-PK)
    • Flutter version 3.23.0-13.0.pre.197 on channel master at /Users/macmini/Downloads/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision fdb74fd3e7 (3 hours ago), 2024-06-12 10:47:07 +0200
    • Engine revision c7fcbfce60
    • Dart version 3.5.0 (build 3.5.0-250.0.dev)
    • DevTools version 2.36.0
[!] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at /Users/macmini/Library/Android/sdk
    ✗ cmdline-tools component is missing
      Run `path/to/sdkmanager --install "cmdline-tools;latest"`
      See https://developer.android.com/studio/command-line for more details.
    ✗ Android license status unknown.
      Run `flutter doctor --android-licenses` to accept the SDK licenses.
      See https://flutter.dev/docs/get-started/install/macos#android-setup for more details.
[✓] Xcode - develop for iOS and macOS (Xcode 15.2)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 15C500b
    • CocoaPods version 1.15.2
[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[!] Android Studio (not installed)
    • Android Studio not found; download from https://developer.android.com/studio/index.html
      (or visit https://flutter.dev/docs/get-started/install/macos#android-setup for detailed instructions).
[✓] VS Code (version 1.87.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.90.0
[✓] Connected device (5 available)
    • Khubaib (mobile)                • 00008030-0003782A3EB8402E            • ios            • iOS 17.5.1 21F90
    • Iphone 14 pro (mobile)          • 806B63F9-47B6-43F2-A14C-F9584BFA2118 • ios            • com.apple.CoreSimulator.SimRuntime.iOS-17-2 (simulator)
    • macOS (desktop)                 • macos                                • darwin-arm64   • macOS 14.3.1 23D60 darwin-arm64
    • Mac Designed for iPad (desktop) • mac-designed-for-ipad                • darwin         • macOS 14.3.1 23D60 darwin-arm64
    • Chrome (web)                    • chrome                               • web-javascript • Google Chrome 125.0.6422.142
    ! Error: Browsing on the local area network for MUHAMMAD ’s Apple Watch. Ensure the device is unlocked and discoverable via Bluetooth. (code -27)
    ! Error: Browsing on the local area network for Zohaib (2). Ensure the device is unlocked and attached with a cable or associated with the same local
      area network as this Mac.
      The device must be opted into Developer Mode to connect wirelessly. (code -27)
[✓] Network resources
    • All expected network resources are available.
! Doctor found issues in 2 categories.
Android DevelopersAndroid Developers
Command-line tools  |  Android Studio  |  Android Developers
Find out about the most important command-line tools that are available, organized by the packages in which they're delivered. (32 kB)
Notheros commented 5 months ago

I'm dealing with the same issue. I tried downgrading the package to 0.19.1 and even 0.18.1, but the problem still persists. Only iOS has this issue; Android works fine.

Undefined symbols:
Linker command failed with exit code 1 (use -v to see invocation)
alisabry22 commented 5 months ago

for me also the same issue on ios it works perfectly on android , did any one solved it? iam getting this Undefined symbols for architecture x86_64: Undefined symbols for architecture x86_64: "__swift_FORCE_LOAD_$_swiftCompatibility56", referenced from: __swift_FORCE_LOAD_$_swiftCompatibility56_$_FBAudienceNetwork in FBAudienceNetwork(FBAudienceNetwork.o) (maybe you meant: __swift_FORCE_LOAD_$_swiftCompatibility56_$_FBAudienceNetwork) "__swift_FORCE_LOAD_$_swiftXPC", referenced from: __swift_FORCE_LOAD_$_swiftXPC_$_FBAudienceNetwork in FBAudienceNetwork(FBAudienceNetwork.o) (maybe you meant: __swift_FORCE_LOAD_$_swiftXPC_$_FBAudienceNetwork) ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation)

trainbrainclub commented 5 months ago

The same problem for our 2 projects

Notheros commented 5 months ago

for me also the same issue on ios it works perfectly on android , did any one solved it? iam getting this Undefined symbols for architecture x86_64: Undefined symbols for architecture x86_64: "__swift_FORCE_LOAD_$_swiftCompatibility56", referenced from: __swift_FORCE_LOAD_$_swiftCompatibility56_$_FBAudienceNetwork in FBAudienceNetwork(FBAudienceNetwork.o) (maybe you meant: __swift_FORCE_LOAD_$_swiftCompatibility56_$_FBAudienceNetwork) "__swift_FORCE_LOAD_$_swiftXPC", referenced from: __swift_FORCE_LOAD_$_swiftXPC_$_FBAudienceNetwork in FBAudienceNetwork(FBAudienceNetwork.o) (maybe you meant: __swift_FORCE_LOAD_$_swiftXPC_$_FBAudienceNetwork) ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation)

I believe it is a different issue. Check this out: #176 In my case, I tried to enable this option, but it didn't work.

Williamtobs commented 5 months ago

I am experiencing this issue too, I have been trying to fix it since the past 24 hours no head way, please help look into this

nikolayangelov28 commented 5 months ago

I also receive the same error during the build...

icebergnero27 commented 5 months ago

@waqasalianjum-zeepalm @nikolayangelov28 @Williamtobs I found similar issue in the iOS FBSDK, do your exit code 1 have more error log about the issue?

babirms commented 5 months ago

I got the same error whenever i tried to build for ios. When trying to do an Archive, i got this log:

ld: Undefined symbols:
  __swift_FORCE_LOAD_$_swiftXPC, referenced from:
      __swift_FORCE_LOAD_$_swiftXPC_$_FBAudienceNetwork in FBAudienceNetwork[270](FBAudienceNetwork.o)
LeonManolo commented 5 months ago

Same issue here:

ld: Undefined symbols:
  __swift_FORCE_LOAD_$_swiftXPC, referenced from:
      __swift_FORCE_LOAD_$_swiftXPC_$_FBAudienceNetwork in FBAudienceNetwork[270](FBAudienceNetwork.o)
clang: error: linker command failed with exit code 1 (use -v to see invocation)
antonoddbit commented 5 months ago

Looks like there is some issue in the latest audience network sdk or missmatch with the linker on newest xcode. We will check about it @waqasalianjum-zeepalm

antonoddbit commented 5 months ago

@waqasalianjum-zeepalm @alisabry22 Do you have bridging header on your project?

Notheros commented 5 months ago

For me, shows this error:

ld: warning: Could not find or use auto-linked library 'swiftXPC': library 'swiftXPC' not found
                    ld: warning: Could not find or use auto-linked framework 'CoreAudioTypes': framework 'CoreAudioTypes' not found
                    ld: Undefined symbols:
                      __swift_FORCE_LOAD_$_swiftXPC, referenced from:
                          __swift_FORCE_LOAD_$_swiftXPC_$_FBAudienceNetwork in FBAudienceNetwork[270](FBAudienceNetwork.o)
                    clang: error: linker command failed with exit code 1 (use -v to see invocation)

@antonoddbit, regarding the bridging header, I attempted to set it up, but I believe I may not have done it correctly. Could you explain the proper process?

flutter_run_v.txt

antonoddbit commented 5 months ago

@Notheros I have trying to check this issue and the closest issue is missing bridging header on react native when using FBSDK.

Here's the link, please check about creating bridging header https://github.com/facebookarchive/react-native-fbsdk/issues/794

Notheros commented 5 months ago

@Notheros I have trying to check this issue and the closest issue is missing bridging header on react native when using FBSDK.

Here's the link, please check about creating bridging header facebookarchive/react-native-fbsdk#794

The error isn't quite the same. For me is:

Undefined symbols: __swift_FORCELOAD$_swiftXPC

..but I will give it a shot.

Notheros commented 5 months ago

@antonoddbit

Everything worked after I updated Xcode. I didn't even know that an update was available. I spent a week trying everything, but all I needed to do was update Xcode. Unbelievable!

antonoddbit commented 5 months ago

@Notheros Do you update your XCode to version 15.4 or 15.2? @LeonManolo @babirms What is your current XCode version?

Notheros commented 5 months ago

@Notheros Do you update your XCode to version 15.4 or 15.2?

@antonoddbit 15.4

alisabry22 commented 5 months ago

@antonoddbit hello dear , iam still experiencing this issue and it prevents me from uploading the app to app store , i looked on the link tried to make anew emty file in the .xcodeworkspace but xcode didn't prompt me for any thing , maybe iam doing it wrong.

LeonManolo commented 5 months ago

@Notheros Do you update your XCode to version 15.4 or 15.2? @LeonManolo @babirms What is your current XCode version?

I'm using Xcode Version 15.2 (15C500b). But there is no update available for me.

babirms commented 5 months ago

@Notheros Do you update your XCode to version 15.4 or 15.2? @LeonManolo @babirms What is your current XCode version?

I'm using the 15.2 version.

antonoddbit commented 5 months ago

@alisabry22 @LeonManolo @babirms have you tried updating to Xcode 15.4 or adding the bridging header?

mehmetakdumn604 commented 5 months ago

the latest versions (0.19.x) also have this error. You can try to use version 0.18.0 until the bug is resolved.

icebergnero27 commented 5 months ago

@mehmetakdumn604 so you get it fixed by using version 0.18.x ?

mehmetakdumn604 commented 5 months ago

@mehmetakdumn604 so you get it fixed by using version 0.18.x ?

Yes.

Maf-Dy commented 5 months ago

i can confirm using macos sonoma on mac mini m2 that upgrading to xcode 15.4 and using facebook app events 0.19.0 has resolved this issue

alisabry22 commented 5 months ago

@babirms @icebergnero27 @LeonManolo @waqasalianjum-zeepalm for this kind of error :

Undefined symbols:
  __swift_FORCE_LOAD_$_swiftXPC, referenced from:
      __swift_FORCE_LOAD_$_swiftXPC_$_FBAudienceNetwork in FBAudienceNetwork[x86_64][270](FBAudienceNetwork.o)
clang: error: linker command failed with exit code 1 (use -v to see invocation)

okay .. to people who suffered from this like me : Solution is you need to enforce FBAudienceNetwork sdk to be downgraded rather than the latest version which is 6.15.1 to 6.15.0 : steps 👍

 - facebook_app_events (0.0.1):
    - FBAudienceNetwork (~> 6.15)
    - FBSDKCoreKit (~> 16.0)
    - Flutter
  - FBAudienceNetwork (6.15.0)
iamriajul commented 4 months ago

Same here

trainbrainclub commented 4 months ago

Downgrade to 0.18.0 does not help for me...

mzrikaz commented 4 months ago

@babirms @icebergnero27 @LeonManolo @waqasalianjum-zeepalm for this kind of error :

Undefined symbols:
  __swift_FORCE_LOAD_$_swiftXPC, referenced from:
      __swift_FORCE_LOAD_$_swiftXPC_$_FBAudienceNetwork in FBAudienceNetwork[x86_64][270](FBAudienceNetwork.o)
clang: error: linker command failed with exit code 1 (use -v to see invocation)

okay .. to people who suffered from this like me : Solution is you need to enforce FBAudienceNetwork sdk to be downgraded rather than the latest version which is 6.15.1 to 6.15.0 : steps 👍

 - facebook_app_events (0.0.1):
    - FBAudienceNetwork (~> 6.15)
    - FBSDKCoreKit (~> 16.0)
    - Flutter
  - FBAudienceNetwork (6.15.0)
  • delete FBAudienceNetwork from (SPEC CHECKSUMS) you will find it down in the same file (Podfile.lock) make these modifications in Podfile.lock then cd iOS , do pod install hopefully it will work with you. cheers<3

solution has worked

antonoddbit commented 4 months ago

@iamriajul @trainbrainclub could you try the @alisabry22 suggestion?

iamriajul commented 4 months ago

@antonoddbit the suggestion does work.

rutulchauhan commented 4 months ago

Same issue.

Undefined symbols: Linker command failed with exit code 1 (use -v to see invocation)

Downgrade to 0.18.0 does not help for me... but facebook manager showing warning and action to force update facebook SDK and above Podfile.lock edit suggestion working but it will not work with CI/CD and flavor if we are re-running pod install.

and expected date for this fixes?

ethmaneElmahjoub commented 2 months ago

@babirms @icebergnero27 @LeonManolo @waqasalianjum-zeepalm for this kind of error :

Undefined symbols:
  __swift_FORCE_LOAD_$_swiftXPC, referenced from:
      __swift_FORCE_LOAD_$_swiftXPC_$_FBAudienceNetwork in FBAudienceNetwork[x86_64][270](FBAudienceNetwork.o)
clang: error: linker command failed with exit code 1 (use -v to see invocation)

okay .. to people who suffered from this like me : Solution is you need to enforce FBAudienceNetwork sdk to be downgraded rather than the latest version which is 6.15.1 to 6.15.0 : steps 👍

 - facebook_app_events (0.0.1):
    - FBAudienceNetwork (~> 6.15)
    - FBSDKCoreKit (~> 16.0)
    - Flutter
  - FBAudienceNetwork (6.15.0)
  • delete FBAudienceNetwork from (SPEC CHECKSUMS) you will find it down in the same file (Podfile.lock) make these modifications in Podfile.lock then cd iOS , do pod install hopefully it will work with you. cheers<3

solution has worked

Work for me , thanks

pablonunezTD commented 2 months ago

para este tipo de error :

Undefined symbols:
  __swift_FORCE_LOAD_$_swiftXPC, referenced from:
      __swift_FORCE_LOAD_$_swiftXPC_$_FBAudienceNetwork in FBAudienceNetwork[x86_64][270](FBAudienceNetwork.o)
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Bien.. a las personas que sufrieron esto como yo: La solución es que debe hacer que el SDK de FBAudienceNetwork se degrade en lugar de la última versión, que es de 6.15.1 a 6.15.0: pasos 👍

 - facebook_app_events (0.0.1):
    - FBAudienceNetwork (~> 6.15)
    - FBSDKCoreKit (~> 16.0)
    - Flutter
  - FBAudienceNetwork (6.15.0)
  • eliminar FBAudienceNetwork de (SPEC CHECKSUMS) lo encontrará en el mismo archivo (Podfile.lock) haga estas modificaciones en Podfile.lock luego cd iOS , haga la instalación de pod con suerte funcionará con usted. Saludos<3

Sirvio por aquí tmb. Muchas gracias!

youpelegrace commented 2 months ago

@babirms @icebergnero27 @LeonManolo @waqasalianjum-zeepalm for this kind of error :

Undefined symbols:
  __swift_FORCE_LOAD_$_swiftXPC, referenced from:
      __swift_FORCE_LOAD_$_swiftXPC_$_FBAudienceNetwork in FBAudienceNetwork[x86_64][270](FBAudienceNetwork.o)
clang: error: linker command failed with exit code 1 (use -v to see invocation)

okay .. to people who suffered from this like me : Solution is you need to enforce FBAudienceNetwork sdk to be downgraded rather than the latest version which is 6.15.1 to 6.15.0 : steps 👍

 - facebook_app_events (0.0.1):
    - FBAudienceNetwork (~> 6.15)
    - FBSDKCoreKit (~> 16.0)
    - Flutter
  - FBAudienceNetwork (6.15.0)
  • delete FBAudienceNetwork from (SPEC CHECKSUMS) you will find it down in the same file (Podfile.lock) make these modifications in Podfile.lock then cd iOS , do pod install hopefully it will work with you. cheers<3

this is the perfect fix to downgrading the plugin instead. works just fine

antonoddbit commented 2 months ago

@youpelegrace yes, we will publish that on next release

aggeloskoutanis commented 1 month ago

@antonoddbit Is there any ETA about the next release that will also include this fix?

nimishporwal47b commented 3 weeks ago

Hi @antonoddbit, Could you please provide an update on the release date for the new version that includes this fix? We need to plan the integration into our production application accordingly.

antonoddbit commented 3 weeks ago

@aggeloskoutanis @nimishporwal47b We are currently preparing newer version with latest iOS

nimishporwal47b commented 2 weeks ago

Hi @antonoddbit,

Thank you for your prompt response. Could you kindly provide an estimated timeline for the release of the new version? We need to inform our client about the expected timeframe and plan accordingly.

Looking forward to your update.

antonoddbit commented 2 weeks ago

Hi @nimishporwal47b the new version should be ready in 2-3 weeks.

Arjun47B commented 2 weeks ago

Hi @antonoddbit I tried upgrading to version 0.9.4, but I’m encountering an error when building for iOS. Please refer to the screenshot below.

Screenshot 2024-11-06 at 3 53 26 PM
antonoddbit commented 2 weeks ago

Hi @Arjun47B could you click the error? Do the error show some specific architecture or more info? Last issue more into architecture x86_64 and FBAudienceNetwork. This issue is more general swift issue basic library.

Arjun47B commented 2 weeks ago

Hi @antonoddbit

I created a new sample Flutter app, added the package version 0.9.4, and run pod install. However, I'm encountering a build error when trying to run the app from Xcode. xcode version 15.4 Please refer to the attached screenshot for the app architecture.

Screenshot 2024-11-06 at 4 29 24 PM
antonoddbit commented 2 weeks ago

Hi @Arjun47B, i just found your issue similar with person that use FBAudience 6.16.0 directly, and the fix is using my previous draft that just updated to this build. I am personally testing the framework in XCode 16. please use ref for facebook_app_event if it's easier ref: 3e4e062ded3eb92b37e43c274ee84da4a21edfa2

stack overflow example: https://stackoverflow.com/questions/79094697/undefined-symbol-swift-force-load-on-flutter-ios

sostenesgomes commented 2 weeks ago

Hi @antonoddbit, I currently use xcode 15 and I also tried version 0.19.4 of the package, but without success. The solution that worked was the one you mentioned, using the ref 3e4e062.

Maybe the new version is only compatible with xcode 16.

nimishporwal47b commented 1 week ago

Hello @antonoddbit, Thank you for your prompt response and continued support. We are highly satisfied with the solution you provided, which has been effective in addressing our needs. Additionally, we have implemented tracker permissions for iOS to ensure visibility of event parameters in Facebook's Event Manager console.

However, we are currently encountering an issue where certain custom parameters are being displayed as "removed". According to Facebook’s documentation, these parameters, along with the referring URL, are being shown as "removed". Facebook has indicated that this data is not being used for the creation of Custom Audiences or Custom Conversions, and as such, should not impact the performance of our ads.

We would greatly appreciate your assistance in resolving this issue. Could you kindly advise on any steps we can take to address this behavior?

Thank you again for your support.

antonoddbit commented 1 week ago

@nimishporwal47b could you show some screenshoot in new thread? The FBAudience for for iOS is a bit unstable since last year, we need to check it first.

github-actions[bot] commented 4 days ago

This issue is stale because it has been open 7 days with no activity. Remove stale label or comment or this will be closed in 5 days.

inceptusp commented 3 days ago

@antonoddbit I was having a similar but a little different error like the one on this thread for months but was able to workaround by manually downgrading the FBAudienceNetwork on podfile.lock to 6.15.1 but since upgrading the package to 0.19.4 this workaround stoped working due to version fixing to 6.16 on podfile... :confused:

Captura de Tela 2024-11-22 às 09 37 44

I'm writing just to let you know that pinning the pubspec plugin version to the ref that you mentioned in https://github.com/oddbit/flutter_facebook_app_events/issues/361#issuecomment-2459465365 "resolved" (in quotes cause I know that you are just doing what I've been doing lol)... tkx