-
Notifications
You must be signed in to change notification settings - Fork 27
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
Unable install in expo #129
Comments
@kunsachdeva were you able to solve this? we're running into the same issue but we're not in an expo managed project (using expo packages) (cc: @morganick) |
Yes, you need specify an older version |
@kunsachdeva That worked! 🎉 🙇 I was banging my head on this for hours last week. |
Quick update on this. We're tracking this internally as https://go.mparticle.com/work/SQDSDKS-5410 Version 8.13.0 was the first version where we added Swift support, which seems to be causing the incompatibility here. We never actually officially supported Expo, it just happened to work before when we were pure Objective-C. We recognize that some people are using Expo and are working to officially support it. For now, please pin to version 8.12.0 as was mentioned above, and I'll update this ticket when we have a new release out that is compatible with Expo, then you can begin using the latest 8.x.x versions again. Apologies for the frustration. |
@einsteinx2 are the new versions expo compatible? |
Bumping this, would appreciate an update @BrandonStalnaker (as It seems Ben is no longer at mParticle) |
I'm pretty close to completing a config plugin - will share it here when done |
@dylmye I would greatly appreciate that. Compatibility with our latest versions is currently being looked into. Though as Ben said Expo has never been officially supported. |
Thank you @BrandonStalnaker - currently Android is working perfectly (though users will need to fork the package to add kits eg Appboy), iOS my only blocker is mParticle/mparticle-apple-sdk#265. I'm planning to maintain this expo plugin (which I have made public now: https://github.com/dylmye/config-plugin-react-native-mparticle - do you need me to add a disclaimer that it's unofficial or anything?) but if y'all ever want to take it over I will be more than happy to transfer ownership! |
It's looking good, thanks for your help again Brandon. I'm still stuck using v8.12.0 of the iOS SDK but I'm going to chase up the specific error encountered by OP with Expo to see if they can shed any further light. edit: tracking here expo/expo#27875 |
Expo have replied: expo/expo#27875 (comment) They suggest that importing |
Official support for this would be extremely helpful; I assume most production apps that utilize mParticle for analytics are using expo nowadays. @dylmye Thanks for your contribution with the config plugin. Is it currently stable and working with SDK 50? |
@tsalama I've got the plugin working, give the sample app a spin and let me know if you come in to any issues :) |
@dylmye It's working for me! Thanks for your contributions 🙏 |
According to Expo and my own testing all that is needed is to replace all #import <mParticle_Apple_SDK/Swift.h> @einsteinx2 @BrandonStalnaker would you be open to a PR to that effect? |
I was able to make it work dynamically using this idea of import replacement using a (As discussed above, this is not a fix) I'm copying it here post_install do |installer|
require 'fileutils'
# Directory where the mParticle-Apple-SDK files are located
mp_dir = File.join(installer.sandbox.root, 'mParticle-Apple-SDK')
# Ensure we can write to the directory and its files
FileUtils.chmod_R('u+w', mp_dir)
# Recursively search for all files and replace "Swift.h"
Dir.glob(File.join(mp_dir, '**/*')).each do |file|
next unless File.file?(file) # Skip directories
# Read the content of the file
text = File.read(file)
new_text = text.gsub('#import "Swift.h"', '#import <mParticle_Apple_SDK/Swift.h>')
# If there are changes, update the file
if text != new_text
# Write the new content back to the file
File.open(file, 'w') { |f| f.puts new_text }
end
end
# Restore original permissions
FileUtils.chmod_R('u+w', mp_dir)
end |
Steps to repro:
npx expo prebuild
to expose native codeyarn add react-native-mparticle
pod 'mParticle-Apple-SDK', '~> 8'
npx expo run:ios
to run in iOS simulatorThis leads to a buildtime error:
Am I missing a step?
The text was updated successfully, but these errors were encountered: