Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[iOS] App won't build after upgrading to react-native 0.73 #184

Open
crisfast opened this issue Jan 3, 2024 · 4 comments
Open

[iOS] App won't build after upgrading to react-native 0.73 #184

crisfast opened this issue Jan 3, 2024 · 4 comments

Comments

@crisfast
Copy link

crisfast commented Jan 3, 2024

Hello and happy new year.
Sorry in advance if this is not the right repo to report this issue.
This error occurred after I tried to upgrade react-native from 0.72.6 to 0.73.1.

Error message

When I try to build the iOS application I get the following error from mParticle-Google-Analytics-Firebase-GA4 pod

'mParticle_Apple_SDK-Swift.h' file not found

Setup

react-native
0.73.1

react-native-mparticle
2.7.9

Podfile

 pod 'mParticle-Apple-SDK', '~> 8'
 pod 'mParticle-BranchMetrics', '~> 8'
 pod 'mParticle-Optimizely', '~> 8'
 pod 'mParticle-Appboy', '~> 8'
 pod 'mParticle-Google-Analytics-Firebase-GA4', '~> 8'

If there are any other information that I can provide, please let me know.

Thank you.

@jeff-marshall-tvo
Copy link

We had this problem and were able to solve it by copying the header file from a folder named "mParticle-Apple-SDK" to the folder named "mParticle_Apple_SDK". Note that one folder has dashes and the other has underscores.

In order to find if you have these 2 folders go into your project, go to the ios/Pods/Headers/Public folder. From there copy the Missing mParticle_Apple_SDK.h to the folder with the underscores.

Clean and build.

When you do a pod install this change will be wiped out and you will have to do this again, however you can make a change to your Podfile to copy the file automatically when pod install is run.

In the Podfile put the following code in the post_install section:

post_install do |installer|
    react_native_post_install(installer)
    
    # Define the path to your source and destination directories
    source_directory = 'Pods/Headers/Public/mParticle-Apple-SDK'
    destination_directory = 'Pods/Headers/Public/mParticle_Apple_SDK'
    
    # Create a new copy command for each file you want to copy
    FileUtils.cp_r(File.join(source_directory,
        'mParticle_Apple_SDK.h'), destination_directory)

@manjuy124
Copy link

@jeff-marshall-tvo its still not working for us!

Screenshot 2024-01-11 at 6 23 27 PM

Error is talking about mParticle_Apple_SDK-Swift.h file right?

@jeff-marshall-tvo
Copy link

jeff-marshall-tvo commented Jan 11, 2024 via email

@crisfast
Copy link
Author

We had this problem and were able to solve it by copying the header file from a folder named "mParticle-Apple-SDK" to the folder named "mParticle_Apple_SDK". Note that one folder has dashes and the other has underscores.

In order to find if you have these 2 folders go into your project, go to the ios/Pods/Headers/Public folder. From there copy the Missing mParticle_Apple_SDK.h to the folder with the underscores.

Clean and build.

When you do a pod install this change will be wiped out and you will have to do this again, however you can make a change to your Podfile to copy the file automatically when pod install is run.

In the Podfile put the following code in the post_install section:

post_install do |installer|
    react_native_post_install(installer)
    
    # Define the path to your source and destination directories
    source_directory = 'Pods/Headers/Public/mParticle-Apple-SDK'
    destination_directory = 'Pods/Headers/Public/mParticle_Apple_SDK'
    
    # Create a new copy command for each file you want to copy
    FileUtils.cp_r(File.join(source_directory,
        'mParticle_Apple_SDK.h'), destination_directory)

If I use older pods for mparticle integrations the build works

  - mParticle-Appboy (8.0.16)
  - mParticle-Apple-SDK (8.12.0)
  - mParticle-BranchMetrics (8.0.6)
  - mParticle-Optimizely (8.1.1)
  - mParticle-Google-Analytics-Firebase-GA4 (8.3.2)

When I tried to revert back to latest versions of those integrations, I got 'mParticle_Apple_SDK/mParticle_Apple_SDK.h' file not found from mParticle_Apple_SDK-Swift.h and I tried to copy the file like you suggested and looks like it got past that step.

Now I'm getting the following error: 'mParticle_Apple_SDK-Swift.h' file not found from Pods/mParticle-Appboy/Sources/mParticle-Appboy/include/MPKitAppboy.h

Looks like those integrations are not fully compatible with mParticle Apple SDK.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants