Troubleshooting React Native
Common issues on React Native.
Deep linking does not work in my React Native app
Make sure you've followed the instruction in the Setting up deep linking from the quickstart guide.
Firebase fails to initialize. My installation is opt-out.
If you are using React Native Firebase (https://rnfirebase.io/) and encounter one of the following errors:
java.lang.IllegalArgumentException: Please set your project ID. A valid Firebase project ID is required to communicate with Firebase server APIs: It identifies your project with Google.
Could not get Firebase InstanceId
java.io.IOException: FIS_AUTH_ERROR
You will temporarily need to downgrade a few components of Firebase until we devise a fix and release a new SDK version. As mentioned on https://rnfirebase.io/, you will need to override the native Firebase SDK version.
Since React Native Firebase internally sets the versions of the native Firebase SDKs, you will need to override them for compatibility with WonderPush.
Edit your android/app/build.gradle to add:
project.ext {
set('react-native', [
versions: [
firebase: [
// Override Firebase SDK Version for compatibility with WonderPush SDK v3.4.0 and earlier
bom: "20.1.0",
],
],
])
}If you have any further issue, do not hesitate to contact us by chat.
[Xcodeproj] Unable to find compatibility version string for object version 70
70If you see the following compilation error:
/Library/Ruby/Gems/2.6.0/gems/xcodeproj-1.27.0/lib/xcodeproj/project.rb:85:in `initialize': [Xcodeproj] Unable to find compatibility version string for object version `70`. (ArgumentError)
from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.16.2/lib/cocoapods/project.rb:48:in `initialize'
from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.16.2/lib/cocoapods/installer/xcode/pods_project_generator/project_generator.rb:82:in `new'
from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.16.2/lib/cocoapods/installer/xcode/pods_project_generator/project_generator.rb:82:in `create_project'
from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.16.2/lib/cocoapods/installer/xcode/pods_project_generator/project_generator.rb:73:in `generate!'
from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.16.2/lib/cocoapods/installer/xcode/single_pods_project_generator.rb:16:in `generate!'
from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.16.2/lib/cocoapods/installer.rb:320:in `block in create_and_save_projects'
from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.16.2/lib/cocoapods/user_interface.rb:64:in `section'
from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.16.2/lib/cocoapods/installer.rb:315:in `create_and_save_projects'
from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.16.2/lib/cocoapods/installer.rb:307:in `generate_pods_project'
from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.16.2/lib/cocoapods/installer.rb:183:in `integrate'
from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.16.2/lib/cocoapods/installer.rb:170:in `install!'
from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.16.2/lib/cocoapods/command/install.rb:52:in `run'
from /Library/Ruby/Gems/2.6.0/gems/claide-1.1.0/lib/claide/command.rb:334:in `run'
from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.16.2/lib/cocoapods/command.rb:52:in `run'
from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.16.2/bin/pod:55:in `<top (required)>'
from /usr/local/bin/pod:23:in `load'
from /usr/local/bin/pod:23:in `<main>'
The list of handled .xcodeproj file versions is listed in the …/gems/xcodeproj-1.27.0/lib/xcodeproj/constants.rb file (take its path from your stacktrace).
As of this writing it supports version 63 "Xcode 15.3" and 77 "Xcode 16.0". We'll choose the latter.
- Click on the project in the Project navigator in the left pane.
- In the right pane's File Inspector, under the Project Document section, set Project Format to Xcode 16.0.
Xcode compilation error Sandbox deny(1) file-write-create
If you see the following compilation error:
error Sandbox: bash(4057) deny(1) file-write-create …/ios/Pods/resources-to-copy-WonderPushNotificationServiceExtension.txt (in target 'WonderPushNotificationServiceExtension' from project 'MyApp')
error Unexpected failure
Update your Xcode project build option ENABLE_USER_SCRIPT_SANDBOXING to No.
See https://stackoverflow.com/a/76792332.
Cocoapod RuntimeError - PBXGroup attempted to initialize an object with unknown ISA PBXFileSystemSynchronizedRootGroup
PBXGroup attempted to initialize an object with unknown ISA PBXFileSystemSynchronizedRootGroupIf you encounter the following error:
When running `bundle exec pod install` if you get:
RuntimeError - `PBXGroup` attempted to initialize an object with unknown ISA `PBXFileSystemSynchronizedRootGroup` from attributes: `{"isa"=>"PBXFileSystemSynchronizedRootGroup", "exceptions"=>["3DD04F0D2E868471006784EA"], "explicitFileTypes"=>{}, "explicitFolders"=>[], "path"=>"WonderPushNotificationServiceExtension", "sourceTree"=>"<group>"}`
Then update your Gemfile to:
gem 'cocoapods', '>= 1.16'
gem 'xcodeproj', '>= 1.26.0'Then run: bundle install.
Module was compiled with an incompatible version of Kotlin
If you see the following errors:
> Task :react-native-wonderpush-fcm:compileDebugKotlin FAILED
e: Incompatible classes were found in dependencies. Remove them from the classpath or use '-Xskip-metadata-version-check' to suppress errors
e: ~/.gradle/caches/transforms-3/2cfe106a332c6a6f2245988cf5920bcb/transformed/jetified-kotlin-stdlib-common-1.6.10.jar!/META-INF/kotlin-stdlib-common.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.6.0, expected version is 1.1.15.
e: ~/.gradle/caches/transforms-3/8fa201288e2c6500b9e1af2f8ed9c77c/transformed/jetified-kotlin-stdlib-jdk7-1.6.10.jar!/META-INF/kotlin-stdlib-jdk7.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.6.0, expected version is 1.1.15.
e: ~/.gradle/caches/transforms-3/b6d16718b0badf943a01bd505b26edc1/transformed/jetified-kotlin-stdlib-jdk8-1.6.10.jar!/META-INF/kotlin-stdlib-jdk8.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.6.0, expected version is 1.1.15.
e: ~/.gradle/caches/transforms-3/d3fc290c9b603f2d0c573f31aa64957d/transformed/jetified-kotlin-stdlib-1.6.10.jar!/META-INF/kotlin-stdlib.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.6.0, expected version is 1.1.15.
e: ~/.gradle/caches/transforms-3/fcb0bc3264f9d378912d589ac764afdd/transformed/jetified-react-native-0.70.2-debug-api.jar!/META-INF/ReactAndroid_debug.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.6.0, expected version is 1.1.15.
e: /data/notiflex/gits/notiflex-platform-scripts/sdk/install/WonderPushExample/node_modules/react-native-wonderpush-fcm/android/src/main/java/com/wonderpush/sdk/reactnative/fcm/WonderPushFcmModule.kt: (19, 15): Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.6.0, expected version is 1.1.15.
The class is loaded from ~/.gradle/caches/transforms-3/d3fc290c9b603f2d0c573f31aa64957d/transformed/jetified-kotlin-stdlib-1.6.10.jar!/kotlin/Unit.class
e: /data/notiflex/gits/notiflex-platform-scripts/sdk/install/WonderPushExample/node_modules/react-native-wonderpush-fcm/android/src/main/java/com/wonderpush/sdk/reactnative/fcm/WonderPushFcmPackage.kt: (18, 16): Unresolved reference: emptyList
You will need to specify an explicit version of Kotlin to use for your whole project, so that our modules use it too.
Edit your android/build.gradle to add:
buildscript {
ext {
kotlinVersion = "1.6.10" // <-- adapt to the version you need
}
}Cocoapods can't modify frozen String (FrozenError)
If you encounter the following error when running cocoapods:
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.16.2/lib/cocoapods/user_interface/error_report.rb:34:in `force_encoding': can't modify frozen String (FrozenError)
from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.16.2/lib/cocoapods/user_interface/error_report.rb:34:in `report'
from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.16.2/lib/cocoapods/command.rb:66:in `report_error'
from /Library/Ruby/Gems/2.6.0/gems/claide-1.1.0/lib/claide/command.rb:396:in `handle_exception'
from /Library/Ruby/Gems/2.6.0/gems/claide-1.1.0/lib/claide/command.rb:337:in `rescue in run'
from /Library/Ruby/Gems/2.6.0/gems/claide-1.1.0/lib/claide/command.rb:324:in `run'
from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.16.2/lib/cocoapods/command.rb:52:in `run'
from /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.16.2/bin/pod:55:in `<top (required)>'
from /usr/local/bin/pod:23:in `load'
from /usr/local/bin/pod:23:in `<main>'
You likely have another error message below that is the actual cause of your issue.
But you can fix this error too by opening this …/gems/cocoapods-1.16.2/lib/cocoapods/user_interface/error_report.rb file and changing line 34 (the location of the error in the stack) to simply use encode instead of force_encoding.
Restart your command and you should no longer see this part of the error and have Cocoapods write a new message about the actual error encountered.
npx expo install fails
npx expo install failsIf you see the following error:
$ npx expo install
› Installing using npm
> npm install
npm error code 1
npm error path …/react-native-wonderpush
npm error command failed
npm error command sh -c bob build && tsc --project tsconfig.plugin.json
npm error ℹ [module] Cleaning up previous build at lib/module
npm error ℹ [typescript] Cleaning up previous build at lib/typescript
npm error ℹ [typescript] Generating type definitions with tsc
npm error ℹ [module] Compiling 2 files in src with babel
npm error ✔ [module] Wrote files to lib/module
npm error ✖ [typescript] Errors found when building definition files:
npm error error TS6053: File '…/react-native-wonderpush/fcm/lib/typescript/src/NativeWonderPushFcm.d.ts' not found.
npm error The file is in the program because:
npm error Matched by default include pattern '**/*'
npm error
npm error error TS6053: File '…/react-native-wonderpush/fcm/lib/typescript/src/__tests__/index.test.d.ts' not found.
npm error The file is in the program because:
npm error Matched by default include pattern '**/*'
npm error
npm error error TS6053: File '…/react-native-wonderpush/fcm/lib/typescript/src/index.d.ts' not found.
npm error The file is in the program because:
npm error Matched by default include pattern '**/*'
npm error
npm error
npm error Found 3 errors.
npm error
npm error
npm error bob build
npm error
npm error build files for publishing
npm error
npm error Options :
npm error --help Displays this help [boolean]
npm error --version Displays the version number [boolean]
npm error --target The target to build
npm error [string] [choices: "commonjs", "module", "typescript", "codegen"]
npm error
npm error Error: Failed to build definition files.
npm error at Object.build [as typescript] (…/react-native-wonderpush/node_modules/react-native-builder-bob/lib/targets/typescript.js:210:11) {
npm error [cause]: Error: Command exited with code 2
npm error at ChildProcess.<anonymous> (…/react-native-wonderpush/node_modules/react-native-builder-bob/lib/utils/spawn.js:27:23)
npm error at Object.onceWrapper (node:events:622:26)
npm error at ChildProcess.emit (node:events:507:28)
npm error at maybeClose (node:internal/child_process:1101:16)
npm error at Socket.<anonymous> (node:internal/child_process:457:11)
npm error at Socket.emit (node:events:507:28)
npm error at Pipe.<anonymous> (node:net:346:12)
npm error }
npm error A complete log of this run can be found in: …/.npm/_logs/2025-10-10T07_41_38_694Z-debug-0.log
Error: npm install exited with non-zero code: 1
Error: npm install exited with non-zero code: 1
at ChildProcess.completionListener (…/my-expo-app/node_modules/@expo/spawn-async/build/spawnAsync.js:42:23)
at Object.onceWrapper (node:events:622:26)
at ChildProcess.emit (node:events:507:28)
at maybeClose (node:internal/child_process:1101:16)
at ChildProcess._handle.onexit (node:internal/child_process:305:5)
...
at spawnAsync (…/my-expo-app/node_modules/@expo/spawn-async/build/spawnAsync.js:7:23)
at NpmPackageManager.runAsync (…/my-expo-app/node_modules/@expo/package-manager/build/node/BasePackageManager.js:41:42)
at NpmPackageManager.installAsync (…/my-expo-app/node_modules/@expo/package-manager/build/node/BasePackageManager.js:61:21)
at NpmPackageManager.addAsync (…/my-expo-app/node_modules/@expo/package-manager/build/node/NpmPackageManager.js:32:25)
at installPackagesAsync (…/my-expo-app/node_modules/expo/node_modules/@expo/cli/build/src/install/installAsync.js:189:30)
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
Simply run the command again.
It is likely that we only encountered this error during the development of the plugin and during your integration you will not encounter this.
The WonderPush Delegate does not work on my Expo app
This is a known bug. It works fine on React Native apps without Expo, but Expo breaks this functionality.
Under the hood our React Native Turbo module emits JavaScript events that the JavaScript part of the module listens to. When using Expo the JavaScript listener is somehow never called.
I get Error: WonderPush native module not initialized
Error: WonderPush native module not initializedThis applies to the old v2 plugin. The new v3 plugin uses the New Architecture works differently. You should consider Upgrading to React Native SDK v3.
You have run the following commands:
npm install react-native-wonderpush --save
npm install react-native-wonderpush-fcm --savebut you probably forgot to run the following two:
react-native link react-native-wonderpush
react-native link react-native-wonderpush-fcmAlso, make sure you have ejected Expo and run using the native tools:
expo ejectMetro error about invalid package.json configuration
package.json configurationIf you sometime see this error when Metro is running:
WARN The package …/react-native-wonderpush contains an invalid package.json configuration. Consider raising this issue with the package maintainer(s).
Reason: The resolution for "…/my-expo-app/node_modules/react-native-wonderpush" defined in "exports" is …/react-native-wonderpush/lib/module/index.js, however this file does not exist. Falling back to file-based resolution.This means that you are tweaking the react-native-wonderpush package content and are running npm run prepare that cleans and recompiles the SDK TypeScript code, and Metro is fast enough to pick up the time between the old files are removed and the new JavaScript code is compiled.
This should not happen during normal use, only during development on react-native-wonderpush itself.
Updated 17 days ago
