react-nativereact-native-onesignal

App (true) and OneSignalNotificationServiceExtension (false) do not both set use_frameworks


I am getting error on running npx pod-install after integrating OneSignal into my React Native project:

App (true) and OneSignalNotificationServiceExtension (false) do not both set use_frameworks!.


Solution

  • The error indicates that your application has use_frameworks!, however your OneSignal target in Podfile doesn't.

    You have to implicitly tell OneSignal target to set use_frameworks!

    1. Open Podfile
    2. Add use_frameworks! inside OneSignalNotificationServiceExtension target:
    target 'OneSignalNotificationServiceExtension' do
      use_frameworks!
      
      pod 'OneSignalXCFramework', '>= 3.0', '< 4.0'
    end
    
    1. Run npx pod-install again