# java.lang.UnsatisfiedLinkError: dlopen failed: library "libnative.so" not found

- **ID:** `android/unsatisfiedlinkerror-native-library-not-loaded`
- **Domain:** android
- **Category:** runtime_error
- **Verification:** ai_generated
- **Fix Rate:** 85%

## Root Cause

A native library (.so) is missing from the APK, not packaged for the device's ABI, or fails to load due to incorrect path or corrupted binary.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| Android 11 (API 30) | active | — | — |
| Android 12 (API 31) | active | — | — |
| Android 13 (API 33) | active | — | — |
| Android 14 (API 34) | active | — | — |

## Workarounds

1. **Place the .so file in app/src/main/jniLibs/<abi>/ (e.g., arm64-v8a) and ensure build.gradle includes: sourceSets.main.jniLibs.srcDirs = ['src/main/jniLibs']** (90% success)
   ```
   Place the .so file in app/src/main/jniLibs/<abi>/ (e.g., arm64-v8a) and ensure build.gradle includes: sourceSets.main.jniLibs.srcDirs = ['src/main/jniLibs']
   ```
2. **Use Gradle ABI filters: android.defaultConfig.ndk.abiFilters 'arm64-v8a', 'x86_64' to include only supported architectures.** (85% success)
   ```
   Use Gradle ABI filters: android.defaultConfig.ndk.abiFilters 'arm64-v8a', 'x86_64' to include only supported architectures.
   ```
3. **If using a third-party SDK, re-add the dependency via the SDK's provided integration method (e.g., Maven or AAR) instead of manual .so file placement.** (95% success)
   ```
   If using a third-party SDK, re-add the dependency via the SDK's provided integration method (e.g., Maven or AAR) instead of manual .so file placement.
   ```

## Dead Ends

- **** — The .so file is not automatically included in the APK unless the jniLibs source set is properly configured. (70% fail)
- **** — Modern Gradle requires the jniLibs directory or ABI splits; direct file references for native libs are not supported. (60% fail)
- **** — This flag prevents extracting native libs from the APK, but if the lib is already missing for the target ABI, it won't help. (50% fail)
