callstack / react-native-fbads

Facebook Audience SDK integration for React Native
MIT License
435 stars 142 forks source link

Build with Facbeook iOS SDK v12 fails with 'FBSDKCoreKit/FBSDKSettings.h' file not found #308

Open taschik opened 2 years ago

taschik commented 2 years ago

Bug Report

Before opening

Ad Modules

Platforms

iOS

Versions

Current Behaviour

Until this morning our release builds ran smoothly but re-running the same build that worked this morning fails with the following error:

/Users/user/actions-runner/_work/user-mobile/user-mobile/node_modules/react-native-fbads/ios/ReactNativeAdsFacebook/EXAdSettingsManager.m:10:9: 'FBSDKCoreKit/FBSDKSettings.h' file not found

#import <FBSDKCoreKit/FBSDKSettings.h>
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Expected Behaviour The build to run smooth again.

Steps to Reproduce It happens on two different build servers independent of a branch to build.

Thanks so much for any idea what this could cause it all of a sudden.

taschik commented 2 years ago

Whoever runs into the same issue. This seems to be the solution. https://github.com/facebook/facebook-ios-sdk/issues/1829

taschik commented 2 years ago

I am reopening this since the issue resurfaces when upgrading to Facebook iOS SDK v12. My current environment is:

    OS: macOS 12.0.1
    CPU: (12) x64 Intel(R) Core(TM) i9-8950HK CPU @ 2.90GHz
    Memory: 25.21 MB / 32.00 GB
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 14.17.5 - ~/.nvm/versions/node/v14.17.5/bin/node
    Yarn: 1.22.17 - ~/.nvm/versions/node/v14.17.5/bin/yarn
    npm: 8.1.0 - ~/.nvm/versions/node/v14.17.5/bin/npm
    Watchman: 2021.06.07.00 - /usr/local/bin/watchman
  Managers:
    CocoaPods: 1.11.2 - /usr/local/bin/pod
  SDKs:
    iOS SDK:
      Platforms: DriverKit 21.0.1, iOS 15.0, macOS 12.0, tvOS 15.0, watchOS 8.0
    Android SDK:
      API Levels: 23, 26, 27, 28, 29
      Build Tools: 23.0.1, 25.0.0, 26.0.3, 27.0.3, 28.0.1, 28.0.2, 28.0.3
      Android NDK: Not Found
  IDEs:
    Android Studio: 3.6 AI-192.7142.36.36.6308749
    Xcode: 13.1/13A1030d - /usr/bin/xcodebuild
  Languages:
    Java: 1.8.0_221 - /usr/bin/javac
  npmPackages:
    @react-native-community/cli: Not Found
    react: 17.0.2 => 17.0.2
    react-native: 0.66.3 => 0.66.3
    react-native-macos: Not Found
  npmGlobalPackages:
    *react-native*: Not Found

My Podfile contains the following line:

  # Facebook
  pod 'FBSDKCoreKit', '~> 12.1'

Anyone that got v12 to work with react-native-fbads?

Kweiza commented 2 years ago

same here

foush commented 2 years ago

I'm also running into this- any workarounds found? Does downgrading to 11.2.1 work?

Kweiza commented 2 years ago

I solved this problem.

try install 'react-native-fbsdk'

yarn add react-native-fbsdk

And if you see an error message "The SDK version in the ad request is no longer supported for new apps. Please upgrade to the latest version of the SDK", edit sdk version in react-native-fbads/android/app/build.gradle

I made a PR for this. you can see at sdk version error fixed

giftsets commented 2 years ago

same issue

sumesh1993 commented 2 years ago

Did anyone find a solution ?

yousafConovo commented 2 years ago

Has anyone found a solution?

moa-os commented 2 years ago

have tried every possible soultion , still the same problem

ishuuwag commented 2 years ago

Did anyone find a solution? Facing the same problem. Below is my environment: System: OS: macOS 12.4 CPU: (8) arm64 Apple M1 Pro Memory: 515.66 MB / 16.00 GB Shell: 5.8.1 - /bin/zsh Binaries: Node: 16.13.0 - /var/folders/s8/1ksn76j94d16j6gj6rxjwzzh0000gn/T/yarn--1655071958562-0.7801873311428125/node Yarn: 1.22.17 - /var/folders/s8/1ksn76j94d16j6gj6rxjwzzh0000gn/T/yarn--1655071958562-0.7801873311428125/yarn npm: 8.1.0 - /usr/local/bin/npm Watchman: 2022.03.21.00 - /opt/homebrew/bin/watchman Managers: CocoaPods: 1.11.2 - /usr/local/bin/pod SDKs: iOS SDK: Platforms: DriverKit 21.4, iOS 15.5, macOS 12.3, tvOS 15.4, watchOS 8.5 Android SDK: API Levels: 27, 28, 29, 30, 31, 32 Build Tools: 28.0.3, 29.0.0, 29.0.1, 29.0.2, 29.0.3, 30.0.2, 31.0.0, 32.1.0 System Images: android-29 | Intel x86 Atom_64, android-31 | Google APIs ARM 64 v8a Android NDK: Not Found IDEs: Android Studio: 2020.3 AI-203.7717.56.2031.7784292 Xcode: 13.4.1/13F100 - /usr/bin/xcodebuild Languages: Java: Not Found Python: Not Found npmPackages: @react-native-community/cli: ^4.7.0 => 4.14.0 react: 16.11.0 => 16.11.0 react-native: ^0.62.2 => 0.62.2 npmGlobalPackages: react-native: Not Found

lloydllim commented 2 years ago

Has anyone found a solution on this ? I got the same problem

lloydllim commented 2 years ago

facebook/facebook-ios-sdk#1829

Hi there, is the problem still persist your side ? It has been 2 days still there's no solution into it . I have searched through everywhere I even tried using the Facebook iOS SDK but still didn't work. Downgrading to v11 downwards is not an option since there is a minimum version that FB sets and it fails during pod install. Hoping you could give me feedback , Thank you very much

ishuuwag commented 2 years ago

Has anyone found a solution on this ? I got the same problem

Still facing the same problem

isinha-onefc commented 1 year ago

Facing this problem too.

"react-native-fbads": "^7.1.0",
"react-native-fbsdk-next": "^10.1.0",

FBSDKCoreKit (14.1.0)

How do I get my build to succeed?

mhNirob commented 1 year ago

I am having the same problem. Getting this same error while running on iOS.

"react-native-fbads": "^7.1.0",
"react-native-fbsdk-next": "^11.0.1",

    - FBSDKCoreKit (~> 15.0.0)

DId anybody able to solve this issue? What should I do to resolve this issue?

beqramo commented 1 year ago

Hi guys, After spending tons of time I was finally able to build and run the app. here is a patch file that I made:

diff --git a/node_modules/react-native-fbads/ReactNativeAdsFacebook.podspec b/node_modules/react-native-fbads/ReactNativeAdsFacebook.podspec
index 7ba2cee..56120ef 100644
--- a/node_modules/react-native-fbads/ReactNativeAdsFacebook.podspec
+++ b/node_modules/react-native-fbads/ReactNativeAdsFacebook.podspec
@@ -13,6 +13,9 @@ Pod::Spec.new do |s|
   s.platform      = :ios, '7.0'
   s.dependency      'React'
   s.dependency      'FBAudienceNetwork'
+  s.dependency      'FBSDKCoreKit'
+  s.dependency      'FBSDKCoreKit_Basics'
+  s.dependency      'FBSDKGamingServicesKit'

   s.source_files  = 'ios/**/*.{h,m}'
 end
\ No newline at end of file
diff --git a/node_modules/react-native-fbads/ios/ReactNativeAdsFacebook/EXAdSettingsManager.m b/node_modules/react-native-fbads/ios/ReactNativeAdsFacebook/EXAdSettingsManager.m
index 56bb991..ee49228 100644
--- a/node_modules/react-native-fbads/ios/ReactNativeAdsFacebook/EXAdSettingsManager.m
+++ b/node_modules/react-native-fbads/ios/ReactNativeAdsFacebook/EXAdSettingsManager.m
@@ -126,7 +126,7 @@ - (void)setBridge:(RCTBridge *)bridge

 RCT_EXPORT_METHOD(setAdvertiserIDCollectionEnabled:(BOOL)enabled)
 {
-    [FBSDKSettings setAdvertiserIDCollectionEnabled:enabled];
+//    [FBSDKSettings setAdvertiserIDCollectionEnabled:enabled];
 }
isinha-onefc commented 1 year ago

Hi guys, After spending tons of time I was finally able to build and run the app. here is a patch file that I made:

diff --git a/node_modules/react-native-fbads/ReactNativeAdsFacebook.podspec b/node_modules/react-native-fbads/ReactNativeAdsFacebook.podspec
index 7ba2cee..56120ef 100644
--- a/node_modules/react-native-fbads/ReactNativeAdsFacebook.podspec
+++ b/node_modules/react-native-fbads/ReactNativeAdsFacebook.podspec
@@ -13,6 +13,9 @@ Pod::Spec.new do |s|
   s.platform      = :ios, '7.0'
   s.dependency      'React'
   s.dependency      'FBAudienceNetwork'
+  s.dependency      'FBSDKCoreKit'
+  s.dependency      'FBSDKCoreKit_Basics'
+  s.dependency      'FBSDKGamingServicesKit'

   s.source_files  = 'ios/**/*.{h,m}'
 end
\ No newline at end of file
diff --git a/node_modules/react-native-fbads/ios/ReactNativeAdsFacebook/EXAdSettingsManager.m b/node_modules/react-native-fbads/ios/ReactNativeAdsFacebook/EXAdSettingsManager.m
index 56bb991..ee49228 100644
--- a/node_modules/react-native-fbads/ios/ReactNativeAdsFacebook/EXAdSettingsManager.m
+++ b/node_modules/react-native-fbads/ios/ReactNativeAdsFacebook/EXAdSettingsManager.m
@@ -126,7 +126,7 @@ - (void)setBridge:(RCTBridge *)bridge

 RCT_EXPORT_METHOD(setAdvertiserIDCollectionEnabled:(BOOL)enabled)
 {
-    [FBSDKSettings setAdvertiserIDCollectionEnabled:enabled];
+//    [FBSDKSettings setAdvertiserIDCollectionEnabled:enabled];
 }

@beqramo do we have to use something like patch-package to add these changes?

beqramo commented 1 year ago

you can, and don't forget to change package.json too like this:

  "main": "src/index",
  "typings": "src/index.d.ts",

as it has problems on finding files. have in mind patch-package doesn't work on package.json. for that if you want you need to fork this repo and make changes on your repo

Jamal-Ud-Din-hub commented 2 weeks ago

Hi guys, After spending tons of time I was finally able to build and run the app. here is a patch file that I made:

diff --git a/node_modules/react-native-fbads/ReactNativeAdsFacebook.podspec b/node_modules/react-native-fbads/ReactNativeAdsFacebook.podspec
index 7ba2cee..56120ef 100644
--- a/node_modules/react-native-fbads/ReactNativeAdsFacebook.podspec
+++ b/node_modules/react-native-fbads/ReactNativeAdsFacebook.podspec
@@ -13,6 +13,9 @@ Pod::Spec.new do |s|
   s.platform      = :ios, '7.0'
   s.dependency      'React'
   s.dependency      'FBAudienceNetwork'
+  s.dependency      'FBSDKCoreKit'
+  s.dependency      'FBSDKCoreKit_Basics'
+  s.dependency      'FBSDKGamingServicesKit'

   s.source_files  = 'ios/**/*.{h,m}'
 end
\ No newline at end of file
diff --git a/node_modules/react-native-fbads/ios/ReactNativeAdsFacebook/EXAdSettingsManager.m b/node_modules/react-native-fbads/ios/ReactNativeAdsFacebook/EXAdSettingsManager.m
index 56bb991..ee49228 100644
--- a/node_modules/react-native-fbads/ios/ReactNativeAdsFacebook/EXAdSettingsManager.m
+++ b/node_modules/react-native-fbads/ios/ReactNativeAdsFacebook/EXAdSettingsManager.m
@@ -126,7 +126,7 @@ - (void)setBridge:(RCTBridge *)bridge

 RCT_EXPORT_METHOD(setAdvertiserIDCollectionEnabled:(BOOL)enabled)
 {
-    [FBSDKSettings setAdvertiserIDCollectionEnabled:enabled];
+//    [FBSDKSettings setAdvertiserIDCollectionEnabled:enabled];
 }

Not working for me

I am using

"react-native-fbads": "^7.1.1",
"react-native-fbsdk-next": "^13.0.0",