Closed schoenbl closed 2 years ago
Hi. Trust you are well. Did you find a solution to this? I have the same problem and I can't find a solution that works.
Also running into this after weeks of running this lib without issue. The error fully blocked our build process and unfortunately I had to remove OneSignal entirely. Would greatly appreciate a fix.
Edit: things are working now but unfortunately I can't pinpoint what changed -- moving forward cautiously but concerned this bug will break things when moving into prod
I haven't found a solution. I've been sending message with their support, and they sent this:
When updating to the major release version of our SDK it does have some breaking changes.
We have step by step migration guides here that should explain the change https://documentation.onesignal.com/docs/mobile-2020-api-migration-guide
I tried what is in the documentation, but there may have been other issues wrong as well; they said that the target should not be added into the react native target, and instead be added by itself.
I moved on to using firebase, but I may try and see if some of the other feedback they gave works. It's pretty frustrating.
I haven't found a solution. I've been sending message with their support, and they sent this:
When updating to the major release version of our SDK it does have some breaking changes. We have step by step migration guides here that should explain the change https://documentation.onesignal.com/docs/mobile-2020-api-migration-guide
I tried what is in the documentation, but there may have been other issues wrong as well; they said that the target should not be added into the react native target, and instead be added by itself.
I moved on to using firebase, but I may try and see if some of the other feedback they gave works. It's pretty frustrating.
Thanks a lot. I removed all traces of OneSignal and redid the process in the documentation. It worked the second time.
Same problem here, I followed the OneSignal documentation step by step but couldn't build my app yet!
In my case this error appears to be related to my M1 Mac; I solved the issue by modifying my project.pbxproj
:
change:
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = "i386";
to:
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = "arm64 i386";
Not a huge fan of this as AFAIK it forces my iOS simulator to use Rosetta when running my app but at least things are building.
In my case the error was M1 Mac arm
architecture too.
In addition to this, @jesse-savary's comment is correct and is in fact one of the necessary steps to achieve OneSignal (or another Pod with the same issue) to compile, but I needed to add a post_install script into Podfile which force every single Pod to target x86_64
architecture on compilation, and this config is not available via project.pbxproj
file so this post_install script is crucial.
This additional last step was necessary for me in order to make my project to compile.
You simple need to add this to your Podfile:
target 'YourApp' do
# ... all your dependencies etc.
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
# Force CocoaPods targets to always build for x86_64
config.build_settings['ARCHS[sdk=iphonesimulator*]'] = 'x86_64'
end
end
end
end
There's an alternative to EXCLUDED_ARCHS which is not excluding architectures BUT limiting 'Any iOS Simulator SDK' to just be x86_64
so you don't need to exclude archs by limiting them to the only compatible one.
You can do this by adding this into project.pbxproj
:
"ARCHS[sdk=iphonesimulator*]" = x86_64;
(or configuring it via Xcode UI).
All this information was extracted from this blog post(which saved my life), and explains everything in a very clear and direct way: https://blog.sudeium.com/2021/06/18/build-for-x86-simulator-on-apple-silicon-macs/
Of course this will forcing Simulator to run with Rosetta but there's no alternative which works in the time I'm writting this. This solution applies to every arm
Apple Silicon: M1, M1 Pro/Max/Ultra.
Happy coding! 🚀
@rgomezp I do not see how this is a duplicate of #1260 ?
People are talking about M1 chips.. I'm on Intel chips and I do have the same no such module error.
And in both issues. There is not a proper and clean response how to fix this.
It's been more then a year.
I was able to get ride of the error.
What I did you may ask !! .
I use to open xcodeproj file but instead open xcworkspace file and it worked.
I was able to get ride of the error.
What I did you may ask !! .
I use to open xcodeproj file but instead open xcworkspace file and it worked.
Worked for me too.
That's weird @Ebeldev and @GSFZamai ... everything we have learned says that is bad. Haha. Sadly, this did not work for me but I may be suffering from a separate issue.
on an M1 and I'm attempting to build an archive, I can build the app on my machine and run but cannot archive. All solutions including the above have failed.
after seeing Xcode give the No such module 'OneSignal' error, what worked for me is:
1) use terminal and run pod deintegrate
and then pod install
2) use terminal to install npm install
2) use terminal and run react-native run-ios --device
to load it onto my device
3) reload the project in xcode and all is well in the world
4) ...
5) profit
maybe xcode compiles differently than the react-native run-ios --device
compilation method... not sure but it works now!
if someone is facing this issue after installing watermelon db and have set use_frameworks option in podfile, try to install watermelon libs from static library.
$static_framework = [
'WatermelonDB',
'simdjson',
]
pre_install do |installer|
Pod::Installer::Xcode::TargetValidator.send(:define_method, :verify_no_static_framework_transitive_dependencies) {}
installer.pod_targets.each do |pod|
if $static_framework.include?(pod.name)
def pod.build_type;
Pod::BuildType.static_library # >= 1.9
# Pod::Target::BuildType.static_library # pods version < 1.9
end
end
end
end
source https://github.com/Nozbe/WatermelonDB/issues/1285#issuecomment-1381323060
Well, I'm having this issue, right now. Already tried a lot of different solutions, none worked. Does anyone else is experiencing this issue too?
I encountered this issue yesterday when trying to build a target that was a duplicate of another one. This target was not present in our podfile. I created a shared config for the targets to use and the error went away.
def sharedConfig
config goes here
end
def sharedOneSignal
config goes here
end
target 'Target'
sharedConfig
end
target 'Target Clone'
sharedConfig
end
target 'OneSignalNotificationServiceExtension' do
sharedOneSignal
end
target 'OneSignalNotificationServiceExtensionClone' do
sharedOneSignal
end
after seeing Xcode give the No such module 'OneSignal' error, what worked for me is:
- use terminal and run
pod deintegrate
and thenpod install
- use terminal to install
npm install
- use terminal and run
react-native run-ios --device
to load it onto my device- reload the project in xcode and all is well in the world
- ...
- profit
maybe xcode compiles differently than the
react-native run-ios --device
compilation method... not sure but it works now!
this approach worked for me as well! 🤷♂️🙃
If you're using React Native, please open the iOS folder directly in Xcode, and don't open the .xcodeproj file in the iOS folder but instead open the .xcworkspace file. As long as you've correctly run 'pod install' in React Native, you should be able to successfully resolve the 'no module' issue.
It worked for me:
With OneSignal 5.0.0 (on Flutter) I had to use:
import OneSignalFramework
instead of
import OneSignal
Description:
This is listed as a common issue: https://documentation.onesignal.com/docs/troubleshooting-ios
Resources that I have found have not been able to solve the issue. I've searched online and through the prior issues that people have listed on github.
In
OneSignalNotificationServiceExtension
, I receive the error:No such module 'OneSignal'
Environment
I am running Xcode 13.2.
I installed through npm:
This is my podfile:
Steps to Reproduce Issue: I followed the React Native SDK Setup: https://documentation.onesignal.com/docs/react-native-sdk-setup