react-native-voice / voice

:microphone: React Native Voice Recognition library for iOS and Android (Online and Offline Support)
MIT License
1.76k stars 470 forks source link

Temporary Fixes #488

Open imranemi143 opened 3 months ago

imranemi143 commented 3 months ago

Hi! πŸ‘‹

Firstly, thanks for your work on this project! πŸ™‚

Today I used patch-package to patch react-native-voice@0.3.0 for the project I'm working on.

Here is the diff that solved my problem:

diff --git a/node_modules/react-native-voice/android/build.gradle b/node_modules/react-native-voice/android/build.gradle
index c0484f8..d43b526 100644
--- a/node_modules/react-native-voice/android/build.gradle
+++ b/node_modules/react-native-voice/android/build.gradle
@@ -58,8 +58,9 @@ allprojects {
 def supportVersion = rootProject.hasProperty('supportLibVersion') ? rootProject.supportLibVersion : DEFAULT_SUPPORT_LIB_VERSION

 dependencies {
-    compile fileTree(dir: 'libs', include: ['*.jar'])
-    testCompile 'junit:junit:4.12'
-    compile 'com.android.support:appcompat-v7:${supportVersion}'
-    compile 'com.facebook.react:react-native:+'
+    implementation fileTree(dir: 'libs', include: ['*.jar'])
+    testImplementation 'junit:junit:4.12'
+    implementation "com.android.support:appcompat-v7:${supportVersion}"
+    implementation 'com.facebook.react:react-native:+' // Use the latest version available
 }
+
diff --git a/node_modules/react-native-voice/android/src/main/java/com/wenkesj/voice/VoiceModule.java b/node_modules/react-native-voice/android/src/main/java/com/wenkesj/voice/VoiceModule.java
index 40b8927..d2d701d 100644
--- a/node_modules/react-native-voice/android/src/main/java/com/wenkesj/voice/VoiceModule.java
+++ b/node_modules/react-native-voice/android/src/main/java/com/wenkesj/voice/VoiceModule.java
@@ -11,7 +11,7 @@ import android.speech.RecognitionListener;
 import android.speech.RecognitionService;
 import android.speech.RecognizerIntent;
 import android.speech.SpeechRecognizer;
-import android.support.annotation.NonNull;
+import androidx.annotation.NonNull;
 import android.util.Log;

 import com.facebook.react.bridge.Arguments;

This issue body was partially generated by patch-package.