react-native-fbads icon indicating copy to clipboard operation
react-native-fbads copied to clipboard

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

Open taschik opened this issue 2 years ago • 18 comments

Bug Report

Before opening

  • [x] Did you try the latest release?
  • [x] Did you look for existing issues?

Ad Modules

Platforms

iOS

Versions

  • Android:
  • iOS: 15
  • react-native-fbads: 7.0.5
  • react-native:0.65.1

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 avatar Oct 13 '21 00:10 taschik

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

taschik avatar Oct 13 '21 01:10 taschik

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?

taschik avatar Nov 25 '21 06:11 taschik

same here

Kweiza avatar Dec 26 '21 06:12 Kweiza

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

foush avatar Jan 04 '22 05:01 foush

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

Kweiza avatar Jan 04 '22 05:01 Kweiza

same issue

giftsets avatar Jan 16 '22 03:01 giftsets

Did anyone find a solution ?

sumesh1993 avatar Feb 27 '22 17:02 sumesh1993

Has anyone found a solution?

yousafConovo avatar May 11 '22 14:05 yousafConovo

have tried every possible soultion , still the same problem

moa-os avatar May 19 '22 12:05 moa-os

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

ishuuwag avatar Jun 12 '22 22:06 ishuuwag

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

lloydllim avatar Jul 06 '22 08:07 lloydllim

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

lloydllim avatar Jul 07 '22 19:07 lloydllim

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

Still facing the same problem

ishuuwag avatar Jul 10 '22 14:07 ishuuwag

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?

isinha-onefc avatar Sep 27 '22 14:09 isinha-onefc

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?

mhNirob avatar Nov 13 '22 09:11 mhNirob

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 avatar Nov 28 '22 21:11 beqramo

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?

isinha-onefc avatar Dec 06 '22 05:12 isinha-onefc

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

beqramo avatar Dec 06 '22 13:12 beqramo