Build Issues
Android: Unknown host CPU architecture on Apple Silicon Macs
If you encounter the build errorUnknown host CPU architecture: arm64 when building for Android on Apple Silicon Macs, use one of these solutions:
Solution 1: Update NDK Version (Recommended)
Solution 1: Update NDK Version (Recommended)
Update to NDK version 24.0.8215888 or aboveThis is the recommended solution. Update your NDK version in Or install via Android Studio:
android/local.properties or Android Studio:- Open Android Studio > Settings/Preferences
- Navigate to Appearance & Behavior > System Settings > Android SDK
- Click on “SDK Tools” tab
- Check “Show Package Details”
- Find “NDK (Side by side)” and install version 24.0.8215888 or newer
Solution 2: Modify ndk-build Script (Alternative)
Solution 2: Modify ndk-build Script (Alternative)
If you cannot change the NDK version, you can modify the
ndk-build script to run under x86_64 architecture.Edit ~/Library/Android/sdk/ndk/23.1.7779620/ndk-build:This workaround runs the NDK build under Rosetta 2 translation, which may be slower than using a native ARM64-compatible NDK version.
iOS: Build fails with Core ML errors
If you encounter Core ML-related build errors on iOS:-
Disable Core ML if not needed
Add this to your Podfile before
use_react_native!: -
Clean build folder
-
Rebuild the app
iOS: Xcode build errors after updating
Clean Xcode derived data
Clean Xcode derived data
Xcode sometimes caches old build artifacts. Clean them:Then rebuild your app.
Build from source instead of prebuilt framework
By default, whisper.rn uses a prebuiltrnwhisper.xcframework for iOS. To build from source:
Add this to your Podfile before use_react_native!:
Runtime Issues
App crashes with large models
Solutions:- Use quantized models - They use less memory with minimal accuracy loss. See Model Formats for details.
-
iOS: Enable Extended Virtual Addressing
For large models on iOS, add this entitlement to your app:
In Xcode: Signing & Capabilities > App Sandbox > Hardware > Extended Virtual Addressing
Or add to your entitlements file:
-
Reduce model size - Use a smaller model like
tiny,base, orsmallinstead ofmediumorlarge.
Transcription is slow
Check your build configuration
Check your build configuration
Make sure you’re testing in Release mode, not Debug mode:Debug builds are significantly slower than release builds.
Verify GPU/Metal acceleration
Verify GPU/Metal acceleration
Check if GPU acceleration is active:iOS uses Metal acceleration by default if available.
Optimize thread count
Optimize thread count
The default thread count (2 for 4-core devices, 4 for more cores) is optimal for most devices, but you can experiment:
Do not use all CPU cores or fewer than 2 threads. This typically degrades performance.
Microphone permission issues
iOS: Add microphone usage description toios/YourApp/Info.plist:
-
Add permission to
android/app/src/main/AndroidManifest.xml: -
Request permission at runtime:
JSI binding errors
JSI bindings are automatically installed when you initialize a context:Audio format errors
If transcription fails or produces poor results, verify your audio format:Asset Loading Issues
Model file not found
For bundled assets:-
Add file extensions to Metro config (
metro.config.js): -
Use
require()to load bundled models:
Large model files fail to bundle
For large models:-
Download at runtime instead of bundling:
- Use quantized models - They’re smaller and often faster on mobile.
Memory Issues
Memory leaks
RealtimeTranscriber memory usage
Control memory usage with slice limits:ProGuard Issues (Android)
Add this rule toandroid/app/proguard-rules.pro:
Getting Help
If your issue isn’t covered here:- Check GitHub Issues for similar problems
- Review whisper.cpp documentation for core functionality
- Open a new issue with:
- Platform (iOS/Android) and version
- whisper.rn version
- Model size and type
- Minimal reproduction code
- Error messages and logs