auvi
auvi

Reputation: 73

React Native build failure for modules react-native-fs and rn-fetch-blob

I am having build failures (on macOS for Android) when I run npm run android and I get the following build failures:

FAILURE: Build failed with an exception.

* What went wrong:
Could not determine the dependencies of task ':app:compileDebugJavaWithJavac'.
> Could not resolve all task dependencies for configuration ':app:debugCompileClasspath'.
   > Could not resolve project :react-native-fs.
     Required by:
         project :app
      > Unable to find a matching configuration of project :react-native-fs: None of the consumable configurations have attributes.
   > Could not resolve project :rn-fetch-blob.
     Required by:
         project :app
      > Unable to find a matching configuration of project :rn-fetch-blob: None of the consumable configurations have attributes.

Apparently, in the node_modules/react-native-fs/android and node_modules/rn-fetch-blob/android I only see an IML file and no module specific code. Did I forget to Download properly? My android/settings.gradle file is below:

rootProject.name = 'FooApp'
include ':react-native-version-number'
project(':react-native-version-number').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-version-number/android')
include ':react-native-fs'
project(':react-native-fs').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-fs/android')
include ':rn-fetch-blob'
project(':rn-fetch-blob').projectDir = new File(rootProject.projectDir, '../node_modules/rn-fetch-blob/android')
include ':react-native-google-signin'
project(':react-native-google-signin').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-google-signin/android')
include ':react-native-vector-icons'
project(':react-native-vector-icons').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-vector-icons/android')
include ':react-native-image-picker'
project(':react-native-image-picker').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-image-picker/android')
include ':react-native-firebase'
project(':react-native-firebase').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-firebase/android')
include ':react-native-firebase'
project(':react-native-firebase').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-firebase/android')

include ':app'

Am I missing something obvious?

Upvotes: 1

Views: 4795

Answers (2)

user10358298
user10358298

Reputation:

I think just run command

rm -rf node_modules && npm install

and after than run react-native run-android again can solve

Upvotes: 2

Tung Duong
Tung Duong

Reputation: 1166

You can try to remove folder node_modules and install again

rm -rf node_modules
npm install
react-native link

After that clean android by cd android && gradle clean and run android again

Upvotes: 2

Related Questions