react-native-onesignal
react-native-onesignal copied to clipboard
[Bug]: OneSignalExtension No such module
What happened?
In project react native, I have installed OneSignalExtension. However, OneSignalExtension not found in file NotificationService
Steps to reproduce?
1. rm -rf Pods
2. rm -rf Podfile.lock
3. Clean project
4. rm -rf build folder ios
What did you expect to happen?
I expect app running
React Native OneSignal SDK version
5.2.2
Which platform(s) are affected?
- [X] iOS
- [ ] Android
Relevant log output
No response
Code of Conduct
- [X] I agree to follow this project's Code of Conduct
+1
+1
+1
Hi, can you share what you have in your Podfile?
+1
+1
+1
+1
HELLO ALL
I have resolved this by updating pod file please update your Main target name
require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
require_relative '../node_modules/react-native-permissions/scripts/setup'
platform :ios, '12.4'
install! 'cocoapods', :deterministic_uuids => false
production = ENV["PRODUCTION"] == "1"
target 'your_main_target' do
config = use_native_modules!
use_frameworks! :linkage => :static
$RNFirebaseAsStaticFramework = true
# Flags change depending on the env values.
flags = get_default_flags()
use_react_native!(
:path => config[:reactNativePath],
:hermes_enabled => flags[:hermes_enabled],
:fabric_enabled => flags[:fabric_enabled],
# An absolute path to your application root.
:app_path => "#{Pod::Config.instance.installation_root}/.."
)
setup_permissions([
'Camera',
'LocationWhenInUse',
'MediaLibrary',
'Notifications',
'PhotoLibrary',
'PhotoLibraryAddOnly',
])
end
# OneSignal Notification Service Extension target
target 'OneSignalNotificationServiceExtension' do
use_frameworks! :linkage => :static
pod 'OneSignalXCFramework', '>= 5.0.0', '< 6.0'
end
# Combined post_install hook for both targets
post_install do |installer|
# For DigilegalPro and general post install tasks
react_native_post_install(installer)
__apply_Xcode_12_5_M1_post_install_workaround(installer)
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '12.4'
config.build_settings["ONLY_ACTIVE_ARCH"] = "NO"
# This setting is required for app extensions
if target.name == 'OneSignalNotificationServiceExtension'
config.build_settings['APPLICATION_EXTENSION_API_ONLY'] = 'YES'
end
end
end
# Xcode 14 resource bundle signing fix
installer.target_installation_results.pod_target_installation_results
.each do |pod_name, target_installation_result|
target_installation_result.resource_bundle_targets.each do |resource_bundle_target|
resource_bundle_target.build_configurations.each do |config|
config.build_settings['CODE_SIGNING_ALLOWED'] = 'NO'
end
end
end
end
+1 this bug is blocking me from even building my app
I resolve this following this steps:
- In the project folder run:
pod deintegratepod install --repo-update - Open the project in XCode and go to:
Build > Clear All IssuesBuild > Clean Build Folder...
After these steps the error No such module 'OneSignalExtension' was resolved.
I encountered the same issue and resolved it by following the Official OneSignal troubleshooting guide:
Steps:
- Remove the following code from the Podfile:
target 'OneSignalNotificationServiceExtension' do
pod 'OneSignalXCFramework', '>= 5.0.0', '< 6.0'
end
target 'OneSignalNotificationServiceExtensionDev' do
pod 'OneSignalXCFramework', '>= 5.0.0', '< 6.0'
end
- Add OneSignalCore.xcframework, OneSignalOutcomes.xcframework, and OneSignalExtension.xcframework to the Notification Service Extension target in Xcode.
any update on this issue?
@mowaisdinar did you try the recommendations suggested by @IronSantana and @sandipshiwakoti above?
+1
+1, This error occurs when using 'ios 15.1'
I figure it out. do not open the wrong project file.
Yes make sure you open the .xcworkspace file in Xcode:
https://documentation.onesignal.com/docs/react-native-sdk-setup#1-add-push-notifications-capability-to-app-target
I haven't heard any new updates since my last response (except the +1's to let us know you also experience this), closing this issue.