Open socialmad opened 8 months ago
Same to me on Gradle 8.0.1:
What went wrong: Some problems were found with the configuration of task ':react-native-voice_voice:packageDebugResources' (type 'MergeResources').
Reason: Task ':react-native-voice_voice:packageDebugResources' uses this output of task ':@react-native-voice_voice:compileDebugRenderscript' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed.
Possible solutions:
Please refer to https://docs.gradle.org/8.0.1/userguide/validation_problems.html#implicit_dependency for more details about this problem.
Reason: Task ':react-native-voice_voice:packageDebugResources' uses this output of task ':@react-native-voice_voice:generateDebugResValues' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed.
Possible solutions:
Please refer to https://docs.gradle.org/8.0.1/userguide/validation_problems.html#implicit_dependency for more details about this problem.
@socialmad I think I have a solution, do npm install react-native-voice and run the app, avoid doing the manual linking steps, it breaks the app. so just npm install should work
Any other solution? @VictorDev200's did not work for me unfortunately
Remove "implementation project(':@react-native-voice_voice')" from android/app/build.gradle file
And also remove following declarations from android/settings.gradle include ':@react-native-voice_voice' project(':@react-native-voice_voice').projectDir = new File(rootProject.projectDir, '../node_modules/@react-native-voice/voice/android')
declarations i used in android/app/src/main/androidmanifest.xml file "uses-permission android:name="android.permission.RECORD_AUDIO"
and try now with cd android ./gradlew clean or gradlew clean npm run android
Putting this here so that people who run into the same issue as I did here. These are my build environment:
$ npm list -g
C:\Users\jeff_\AppData\Roaming\npm
├── react-native-cli@2.0.1
└── react-native@0.75.1
"dependencies": {
"@react-native-voice/voice": "^3.2.4",
"react": "18.3.1",
"react-native": "0.75.1"
},
Gradle version is 8.8
Android SDK Platform 35
I followed @kovikarthik instructions. So basically I removed the manual linking. It appears that React native handles it automatically. However, I was getting another error:
> Task :app:processDebugMainManifest
[com.android.support:animated-vector-drawable:28.0.0] C:\Users\jeff_\.gradle\caches\8.8\transforms\af367b6b2b00bd2373f3a4bbc3cf0def\transformed\animated-vector-drawable-28.0.0\AndroidManifest.xml Warning:
Namespace 'android.support.graphics.drawable' is used in multiple modules and/or libraries: com.android.support:animated-vector-drawable:28.0.0, com.android.support:support-vector-drawable:28.0.0. Please ensure that all modules and libraries have a unique namespace. For more information, See https://developer.android.com/studio/build/configure-app-module#set-namespace
[androidx.versionedparcelable:versionedparcelable:1.1.1] C:\Users\jeff_\.gradle\caches\8.8\transforms\41ea63f3dabe1a140c4792fedd6e315d\transformed\versionedparcelable-1.1.1\AndroidManifest.xml Warning:
Namespace 'androidx.versionedparcelable' is used in multiple modules and/or libraries: androidx.versionedparcelable:versionedparcelable:1.1.1, com.android.support:versionedparcelable:28.0.0. Please ensure that all modules and libraries have a unique namespace. For more information, See https://developer.android.com/studio/build/configure-app-module#set-namespace
> Task :app:checkDebugDuplicateClasses FAILED
To fix this, I removed appcompat-v7 from build.gradle because react native was using AndroidX (androidx.appcompat) while react-native-voice module was still using the deprecated Android Support Library (appcompat-v7) which was causing a conflict where the same namespace was defined in two places.
<react-project>\node_modules\@react-native-voice\voice\android\build.gradle
implementation "com.android.support:appcompat-v7:${supportVersion}"
i had the same issue and the @jespirit solution worked. One question @jespirit since we are modifying the node_modules, you forked the repository and use it like that ?
@kxhelilaj I learned you can use patch-package to create a patch that can be added to source control which can be applied during post-install stage https://stackoverflow.com/questions/72820625/what-is-the-proper-way-to-patch-a-node-modules-module Note: The patch-package command picked up some other changes so I just removed those and left the relevant part.
@jespirit remove maual linking worked for me, thank you very much.
After updating our project with a new React Native engine and upgrading Gradle to version 8.6, we encountered an issue. We have tried various solutions, but none have worked so far.
What went wrong: A problem was found with the configuration of task ':react-native-voice_voice:packageDebugResources' (type 'MergeResources').
Reason: Task ':react-native-voice_voice:packageDebugResources' uses this output of task ':@react-native-voice_voice:generateDebugResValues' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed.
Possible solutions: