Common Errors & Solutions
Cannot find NCKit types after SPMโ
Symptom: Cannot find 'NCKitModelLocator' in scope (or NCKitProcessor, etc.) even though import NCKit is present.
Cause: Xcode resolved an old package checkout. Use tag 1.2.1 and reset caches.
Fix:
-
File โ Add Package Dependencies โ set NCKit to Exact Version
1.2.1 -
File โ Packages โ Reset Package Caches
-
File โ Packages โ Resolve Package Versions
-
Product โ Clean Build Folder (โงโK)
-
Confirm the checkout exposes
NCKitProcessor:Shellgrep NCKitProcessor ~/Library/Developer/Xcode/DerivedData/*/SourcePackages/checkouts/NCKit/NCKit.xcframework/ios-arm64/NCKit.framework/Modules/NCKit.swiftmodule/arm64-apple-ios.swiftinterface
NCKitError.missingModelโ
Symptom: throw NCKitError.missingModel("NCKit_model.tar.gz")
Checklist:
- Framework embedding โ Embed & Sign
- SPM cache โ Reset Package Caches
- CocoaPods โ
pod deintegrate && pod install - Clean derived data
- Intel Mac simulator โ upgrade to 1.2.1 or see Simulator guide
NCKitError.libraryInitโ
Cause: df_create() returned nil. On simulator, often an older NCKit without ios-arm64_x86_64-simulator on Intel x86_64.
Fix: Upgrade to 1.2.1+, or use Rosetta simulator / physical device.
NCKitError.unsupportedFormatโ
let asset = AVAsset(url: inputURL)
let tracks = try await asset.loadTracks(withMediaType: .audio)
print("Audio tracks: \(tracks.count)")
NCKitError.cannotCreateOutputโ
let output = FileManager.default.temporaryDirectory
.appendingPathComponent(UUID().uuidString + ".wav")
Build Error: Missing required module 'CDeepFilter'โ
Clean derived data; use prebuilt XCFramework, not source files.
Build Error: Simulator / device slice mismatchโ
Confirm full NCKit.xcframework is embedded, not a single slice.
NCKitStreamProcessor missing reset()โ
Symptom: reset() not available on NCKitStreamProcessor.
Fix: Upgrade to 1.2.1 (or 1.1.1+), reset package caches, clean build. reset() requires NCKit 1.1.1+.
Mic tap returns 0 Hzโ
Ensure the AVAudioEngine graph is connected, microphone permission is granted, and the audio session is active before installing the tap.
Denoise blocks UIโ
Run NCKitFileProcessor.processFile inside Task.detached (see How to Use).
Package download failsโ
Add your GitHub account under Xcode โ Settings โ Accounts for private repo access.
Audio Sounds Robotic / Over-Processedโ
let proc = try NCKitProcessor(modelURL: url, attenLimDb: 40)
proc.setAttenLim(40)
proc.setPostFilterBeta(0)
NCKitException.MissingModelโ
Symptom: NCKitException.MissingModel at NCKitModelLocator.modelFile(context)
Checklist:
implementation("com.5exceptions:nckit:1.1.2")inbuild.gradle.ktsgoogle()andmavenCentral()insettings.gradle.kts- ProGuard not stripping JNI โ Gradle guide
NCKitException.LibraryInitโ
Cause: Corrupt model, missing ABI .so, or low memory.
Fix: Clear app cache; test on arm64-v8a device first.
NCKitException.CannotOpenInputโ
Copy content:// URIs to a local File before processFile. Grant read permission.
processFile ANR / UI freezeโ
Fix: Never call on the main thread:
withContext(Dispatchers.IO) {
NCKitFileProcessor.processFile(inputFile, outputFile, processor)
}
Cannot resolve com.5exceptions:nckitโ
Fix: Confirm mavenCentral() is in settings.gradle.kts, sync Gradle, and use version 1.1.2. See Gradle (Android).
UnsatisfiedLinkErrorโ
Fix: Add ABI filters for all shipped native libraries:
ndk {
abiFilters += listOf("armeabi-v7a", "arm64-v8a", "x86_64")
}
Silent microphone captureโ
Grant RECORD_AUDIO at runtime before starting AudioRecord.
Audio Sounds Robotic / Over-Processedโ
processor.setAttenLim(40f)
processor.setPostFilterBeta(0f)