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

'Swift.h' file not found #265

Closed
dylmye opened this issue Mar 20, 2024 · 3 comments
Closed

'Swift.h' file not found #265

dylmye opened this issue Mar 20, 2024 · 3 comments

Comments

@dylmye
Copy link

dylmye commented Mar 20, 2024

I'm trying to configure react-native-mparticle (well actually I'm trying to make an Expo plugin for the React Native package) and following the instructions to install mParticle-Apple-SDK using use_frameworks with the dynamic linkage style. The closest I can do to that is set use_frameworks! :linkage => :dynamic. When I don't set that, I get #198 . When I do set it, I get this:

› Planning build
› Executing react-native Pods/hermes-engine » [CP-User] [Hermes] Replace Hermes for the right configuration, if needed
› Linking   react-native Pods/React-perflogger » reactperflogger
› Compiling @dylmye/config-plugin-react-native-mparticle Pods/mParticle-Apple-SDK » MPResponseEvents.m
› Compiling @dylmye/config-plugin-react-native-mparticle Pods/mParticle-Apple-SDK » MPTransactionAttributes.m

❌  (ios/Pods/mParticle-Apple-SDK/mParticle-Apple-SDK/Ecommerce/MPTransactionAttributes.m:2:9)

  1 | #import "MPTransactionAttributes.h"
> 2 | #import "Swift.h"
    |         ^ 'Swift.h' file not found
  3 | #import "NSDictionary+MPCaseInsensitive.h"
  4 | #import "MPILogger.h"
  5 | #import "mParticle.h"

› Compiling @dylmye/config-plugin-react-native-mparticle Pods/mParticle-Apple-SDK » MPSurrogateAppDelegate.m
› Compiling @dylmye/config-plugin-react-native-mparticle Pods/mParticle-Apple-SDK » MPStateMachine.m

❌  (ios/Pods/mParticle-Apple-SDK/mParticle-Apple-SDK/Utils/MPStateMachine.m:21:9)

  19 | #import "MPForwardQueueParameters.h"
  20 | #import "MPDataPlanFilter.h"
> 21 | #import "Swift.h"
     |         ^ 'Swift.h' file not found
  22 | 
  23 | #if TARGET_OS_IOS == 1
  24 | #ifndef MPARTICLE_LOCATION_DISABLE

› Compiling @dylmye/config-plugin-react-native-mparticle Pods/mParticle-Apple-SDK » MPSession.m
› Compiling @dylmye/config-plugin-react-native-mparticle Pods/mParticle-Apple-SDK » MPSearchAdsAttribution.m
› Compiling @dylmye/config-plugin-react-native-mparticle Pods/mParticle-Apple-SDK » MPResponseConfig.m
› Compiling @dylmye/config-plugin-react-native-mparticle Pods/mParticle-Apple-SDK » MPPromotion.m

❌  (ios/Pods/mParticle-Apple-SDK/mParticle-Apple-SDK/Ecommerce/MPPromotion.m:4:9)

  2 | #import "MPIConstants.h"
  3 | #import "NSDictionary+MPCaseInsensitive.h"
> 4 | #import "Swift.h"
    |         ^ 'Swift.h' file not found
  5 | 
  6 | // Internal keys
  7 | NSString *const kMPPMAction = @"an";

› Compiling @dylmye/config-plugin-react-native-mparticle Pods/mParticle-Apple-SDK » MPProduct.m

❌  (ios/Pods/mParticle-Apple-SDK/mParticle-Apple-SDK/Ecommerce/MPProduct.m:2:9)

  1 | #import "MPProduct.h"
> 2 | #import "Swift.h"
    |         ^ 'Swift.h' file not found
  3 | #import "MPIConstants.h"
  4 | #import "NSDictionary+MPCaseInsensitive.h"
  5 | #import "MPILogger.h"

› Compiling @dylmye/config-plugin-react-native-mparticle Pods/mParticle-Apple-SDK » MPPersistenceController.mm
› Compiling @dylmye/config-plugin-react-native-mparticle Pods/mParticle-Apple-SDK » MPNotificationController.m

› 4 error(s), and 0 warning(s)

CommandError: Failed to build iOS project. "xcodebuild" exited with error code 65.
error Command failed with exit code 1.

What's weird is I can see the Swift.h file! Any ideas on what I need to configure here - something search paths related? I'm not super well versed in Swift code but I'm happy to share my code if interested.

image

Thanks in advance.

@BrandonStalnaker
Copy link
Contributor

@dylmye My recent discovery might help you here. The pre install command here will have cocoapods include us and only us as a dynamic framework. https://github.com/mParticle/react-native-mparticle/pull/204/files#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5

@dylmye
Copy link
Author

dylmye commented Mar 25, 2024

Just back from holiday today, looking into this. Thanks for sharing.

@dylmye
Copy link
Author

dylmye commented Mar 26, 2024

Fixed by implementing the pre_install hook, thanks

@dylmye dylmye closed this as completed Mar 26, 2024
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

2 participants