Troubleshooting
This section provides solutions to common issues you might encounter while using the Nitro Module CLI.
iOS Build Issues
-
Pod Install Fails
If you encounter issues during
pod install
, try the following steps:cd yourpackage/ios
pod deintegrate
pod install -
Missing Header Files
If Xcode reports missing header files, follow these steps:
- Clean the build folder in Xcode (
Product
->Clean Build Folder
). - Ensure all native dependencies are properly linked.
- Rebuild the project.
- Clean the build folder in Xcode (
Android Build Issues
-
Gradle Sync Failed
If Gradle sync fails, try cleaning and rebuilding the project:
cd yourpackage/android
./gradlew clean
./gradlew build -
Missing Dependencies
If you encounter missing dependencies, check the following:
- Ensure
build.gradle
contains the correct dependencies. - Sync the project with Gradle files.
- Invalidate caches and restart Android Studio.
- Ensure
General Issues
-
Error Invalid Version: latest
If you encounter an invalid version error, this is due to an issue with the CLI: See issue: Invalid Version: latest
✖ Failed to create nitro module: Command failed: bunx -y @react-native-community/cli@latest init TestToSpeechExample --directory path/react-native-module/example --skip-install
Resolving dependencies
Resolved, downloaded and extracted [2]
Saved lockfile
error Invalid Version: latest.To resolve this issue, use the following command: keep trying until it works.
-
Module Not Found
If a module is not found, ensure it is properly installed and linked:
npm install <module-name>
npx react-native link <module-name> -
Command Not Found
If a CLI command is not recognized, ensure the CLI is installed globally:
npm install -g create-nitro-module
-
Permission Denied
If you encounter permission issues, try running the command with
sudo
:sudo <command>
For additional support, please open an issue on our GitHub repository.