skip to Main Content

I’m getting this error when trying to build a React native App (npm run android)

error: package com.facebook.react.modules.storage does not exist
import com.facebook.react.modules.storage.ReactDatabaseSupplier;

error: package com.facebook.react.modules.storage does not exist
com.facebook.react.modules.storage.ReactDatabaseSupplier.getInstance(getApplicationContext()).setMaximumSize(size);

React Native 63

I’ve already tried to remove node_modules and install everything again but nothing works at the moment

2

Answers


  1. This was reported in rect-native bulletin, the issue started on Nov-4, 2022 and react-native team released a patch and workarounds.
    https://github.com/facebook/react-native/issues/35210

    For your use of 63.x, update to the patch, 63.5 and it will fix the build, try clean and build.

    Login or Signup to reply.
  2. as mentioned here adding folowing content to your android/build.gradle and after that sync project with gradle will fix the issue:

    def REACT_NATIVE_VERSION = new File(['node', '--print',"JSON.parse(require('fs').readFileSync(require.resolve('react-native/package.json'), 'utf-8')).version"].execute(null, rootDir).text.trim())
    
    allprojects {
        configurations.all {
            resolutionStrategy {
                // Remove this override in 0.65+, as a proper fix is included in react-native itself.
                force "com.facebook.react:react-native:" + REACT_NATIVE_VERSION
            }
        }
        .
        .
        .
    }
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search