Description
-
Create a new React Native project using version 0.85.0
-
Install react-native-audio-api:
yarn add react-native-audio-api
-
Run Android build on Windows:
cd android
./gradlew assembleDebug
-
Observe failure during task:
:react-native-audio-api:downloadPrebuiltBinaries
-
Error occurs:
<3>WSL ERROR: execvpe(/bin/bash) failed: No such file or directory
-
After fixing bash issue, build fails again with:
fatal error: 'react/jni/CxxModuleWrapper.h' file not found
Steps to reproduce
Fix: react-native-audio-api on React Native 0.85 (Windows + Android build + bash + JNI)
Context
I was trying to use react-native-audio-api with:
React Native 0.85
Android (NDK 27)
Windows 10
During the Android build, I ran into multiple issues:
Problem 1 — downloadPrebuiltBinaries fails (bash issue)
Build error:
Task :react-native-audio-api:downloadPrebuiltBinaries FAILED
<3>WSL ERROR: execvpe(/bin/bash) failed: No such file or directory
Root cause
The Gradle task uses:
commandLine 'bash', '../scripts/download-prebuilt-binaries.sh'
On Windows, this resolves to:
C:\Windows\System32\bash.exe
Which points to WSL — and may be broken or unavailable.
✅ Fix 1 — Use Git Bash explicitly on Windows
Replace the task with a platform-aware executable:
task downloadPrebuiltBinaries(type: Exec) {
- commandLine 'chmod', '+x', '../scripts/download-prebuilt-binaries.sh'
- commandLine 'bash', '../scripts/download-prebuilt-binaries.sh'
- args 'android', isFFmpegDisabled() ? 'skipffmpeg' : ''
+ def bashExecutable = Os.isFamily(Os.FAMILY_WINDOWS)
+ ? 'C:/Program Files/Git/usr/bin/bash.exe'
+ : 'bash'
+
+ commandLine bashExecutable, '../scripts/download-prebuilt-binaries.sh', 'android', isFFmpegDisabled() ? 'skipffmpeg' : ''
}
Important
If you're on Windows, make sure to adjust the path depending on your Git installation:
C:/Program Files/Git/usr/bin/bash.exe
Your path may vary.
❌ Problem 2 — JNI build failure (CxxModuleWrapper.h not found)
Error:
fatal error: 'react/jni/CxxModuleWrapper.h' file not found
Root cause
React Native 0.85 introduced changes in internal JNI headers.
CxxModuleWrapper.h is no longer available in the expected location.
✅ Fix 2 — Remove invalid includes
Remove the following include from multiple files:
- #include <react/jni/CxxModuleWrapper.h>
Files affected:
android/src/main/cpp/audioapi/android/AudioAPIModule.h
android/src/main/cpp/audioapi/android/core/NativeAudioPlayer.hpp
android/src/main/cpp/audioapi/android/core/NativeAudioRecorder.hpp
android/src/main/cpp/audioapi/android/system/NativeFileInfo.hpp
Notes
The chmod command in the original Gradle task is redundant (overwritten by the second commandLine)
The issue is not documented clearly, but partially related to:
Windows bash resolution
RN 0.85 native changes
Recommendation
Instead of editing node_modules directly, use patch-package:
npx patch-package react-native-audio-api
And commit the patch:
patches/react-native-audio-api+X.X.X.patch
Result
After applying both fixes:
downloadPrebuiltBinaries runs successfully
JNI compilation succeeds
Android build completes without errors
🙌 Hope this helps someone
This took quite some time to debug, so sharing in case others run into the same issues.
Snack or a link to a repository
I can provide a minimal reproduction repository if needed. This issue happens on a clean React Native 0.85.0 project on Windows after installing react-native-audio-api and running the Android build.
React Native Audio API version
^0.11.7
React Native version
0.85.0
Platforms
Android
JavaScript runtime
None
Workflow
None
Architecture
None
Build type
None
Device
None
Device model
No response
Acknowledgements
Yes
Description
Create a new React Native project using version 0.85.0
Install react-native-audio-api:
yarn add react-native-audio-api
Run Android build on Windows:
cd android
./gradlew assembleDebug
Observe failure during task:
:react-native-audio-api:downloadPrebuiltBinaries
Error occurs:
<3>WSL ERROR: execvpe(/bin/bash) failed: No such file or directory
After fixing bash issue, build fails again with:
fatal error: 'react/jni/CxxModuleWrapper.h' file not found
Steps to reproduce
Fix: react-native-audio-api on React Native 0.85 (Windows + Android build + bash + JNI)
Context
I was trying to use react-native-audio-api with:
During the Android build, I ran into multiple issues:
Problem 1 — downloadPrebuiltBinaries fails (bash issue)
Build error:
Root cause
The Gradle task uses:
commandLine 'bash', '../scripts/download-prebuilt-binaries.sh'On Windows, this resolves to:
C:\Windows\System32\bash.exeWhich points to WSL — and may be broken or unavailable.
✅ Fix 1 — Use Git Bash explicitly on Windows
Replace the task with a platform-aware executable:
Important
If you're on Windows, make sure to adjust the path depending on your Git installation:
C:/Program Files/Git/usr/bin/bash.exeYour path may vary.
❌ Problem 2 — JNI build failure (CxxModuleWrapper.h not found)
Error:
fatal error: 'react/jni/CxxModuleWrapper.h' file not foundRoot cause
React Native 0.85 introduced changes in internal JNI headers.
CxxModuleWrapper.h is no longer available in the expected location.
✅ Fix 2 — Remove invalid includes
Remove the following include from multiple files:
- #include <react/jni/CxxModuleWrapper.h>Files affected:
Notes
The chmod command in the original Gradle task is redundant (overwritten by the second commandLine)
The issue is not documented clearly, but partially related to:
Windows bash resolution
RN 0.85 native changes
Recommendation
Instead of editing node_modules directly, use patch-package:
npx patch-package react-native-audio-apiAnd commit the patch:
patches/react-native-audio-api+X.X.X.patchResult
After applying both fixes:
downloadPrebuiltBinaries runs successfully
JNI compilation succeeds
Android build completes without errors
🙌 Hope this helps someone
This took quite some time to debug, so sharing in case others run into the same issues.
Snack or a link to a repository
I can provide a minimal reproduction repository if needed. This issue happens on a clean React Native 0.85.0 project on Windows after installing
react-native-audio-apiand running the Android build.React Native Audio API version
^0.11.7
React Native version
0.85.0
Platforms
Android
JavaScript runtime
None
Workflow
None
Architecture
None
Build type
None
Device
None
Device model
No response
Acknowledgements
Yes