Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,4 @@ local.properties

# Visual Studio Code
.vscode/
.gradle
367 changes: 165 additions & 202 deletions README.md

Large diffs are not rendered by default.

85 changes: 85 additions & 0 deletions TROUBLESHOOTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
# Troubleshooting Guide

## Module Resolution Errors

### Error: `react-is` module cannot be resolved

If you encounter an error like:
```
trying to resolve module `react-is` from files .../node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js
the package json successfully found however this package itself specifies a main module field that could not be resolved
```

#### Solution 1: Install react-is (Recommended)

Install `react-is` in your project:

```bash
# Using npm
npm install react-is

# Using yarn
yarn add react-is

# Using pnpm
pnpm add react-is
```

#### Solution 2: Clear Metro Cache

Clear Metro bundler cache and restart:

```bash
# Clear Metro cache
npx react-native start --reset-cache

# Or if using Expo
npx expo start --clear
```

#### Solution 3: Check Metro Configuration

Ensure your `metro.config.js` properly resolves node_modules:

```javascript
const {getDefaultConfig, mergeConfig} = require('@react-native/metro-config');

const config = {
resolver: {
// Ensure node_modules are resolved correctly
nodeModulesPaths: ['node_modules'],
},
};

module.exports = mergeConfig(getDefaultConfig(__dirname), config);
```

#### Solution 4: Reinstall Dependencies

Sometimes a clean reinstall fixes module resolution issues:

```bash
# Remove node_modules and lock files
rm -rf node_modules yarn.lock package-lock.json

# Reinstall
yarn install
# or
npm install
```

#### Solution 5: Check React Version Compatibility

Ensure you're using a compatible React version. This library requires:
- `react >= 18.0.0`
- `react-native >= 0.71.0`
- `react-is >= 16.12.0 || ^17.0.0 || ^18.0.0`

Check your `package.json` to verify versions.

### Additional Notes

- `react-is` is typically provided by React itself, but some bundlers require it to be explicitly installed
- This is a known issue with Metro bundler and transitive dependencies
- The library declares `react-is` as an optional peer dependency to help with resolution

7 changes: 1 addition & 6 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,6 @@ def supportsNamespace() {
android {
if (supportsNamespace()) {
namespace "com.wenkesj.voice"

sourceSets {
main {
manifest.srcFile "src/main/AndroidManifestNew.xml"
}
}
}

compileSdkVersion getExtOrIntegerDefault("compileSdkVersion")
Expand Down Expand Up @@ -110,6 +104,7 @@ def kotlin_version = getExtOrDefault("kotlinVersion")
dependencies {
implementation "com.facebook.react:react-native:+"
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation "androidx.core:core-ktx:1.9.0"
}

if (isNewArchitectureEnabled()) {
Expand Down
10 changes: 5 additions & 5 deletions android/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Voice_kotlinVersion=1.7.0
Voice_minSdkVersion=21
Voice_targetSdkVersion=31
Voice_compileSdkVersion=31
Voice_ndkversion=21.4.7075529
Voice_kotlinVersion=1.9.24
Voice_minSdkVersion=24
Voice_targetSdkVersion=34
Voice_compileSdkVersion=35
Voice_ndkversion=26.1.10909125
55 changes: 0 additions & 55 deletions android/src/main/VoiceSpec.kt

This file was deleted.

Loading