1

I have added react-native-camera to my application. But I am getting this error while running npm run android command.

* 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-async-storage_async-storage.
     Required by:
         project :app
      > No matching configuration of project :react-native-async-storage_async-storage was found. The consumer was configured to find an API of a component, as well as attribute 'com.android.build.api.attributes.BuildTypeAttr' with value 'debug', attribute 'react-native-camera' with value 'general' but:
          - None of the consumable configurations have attributes.

I have made all the required changes to build.gradle and settings.gradle. I am running react-native 0.64.0 version and node 16.4.2 version.

Rohit Aggarwal
  • 1,048
  • 1
  • 14
  • 32

2 Answers2

1

Your error has more to do with the async storage library it seems, as indicated on the error. So I would check that implementation first.

Second, I would advise against using react-native-camera since it has been deprecated for a while now. Most people seem to have moved to react-native-vision-camera or react-native-camera-kit (which I use and would suggest).

  • I have tried uninstalling react-native-camera and it still gives me the same error. – Rohit Aggarwal Jul 12 '23 at 03:47
  • Yes, I believe it's because of your implementation of your async storage package. As I said in my answer before, the error seems to point to that. `Could not resolve project :react-native-async-storage_async-storage` – Cory Cunningham Jul 13 '23 at 11:30
  • I have downgraded my JDK to version 8 and got this working. Thanks for your help. – Rohit Aggarwal Jul 14 '23 at 16:22
0

As @Cory Cunningham mentioned, it was because of async storage. So I installed the following version of @react-native-async-storage/async-storage

"@react-native-async-storage/async-storage": "^1.17.5",
Rohit Aggarwal
  • 1,048
  • 1
  • 14
  • 32