skip to Main Content

When npx react-native start — –reset-cache

warn Package react-native-sqlite-storage contains invalid configuration: "dependency.platforms.ios.project" is not allowed. Please verify it’s properly linked using "react-native config" command and contact the package maintainers about this.

My configs:

"react-native-sqlite-storage": "^3.3.3", // Latest as of now

react-native.config.js:

    module.exports = {
    dependency: {
        platforms: {
            ios: {
                project: './platforms/ios/SQLite.xcodeproj'
            },
            android: {
                sourceDir: './platforms/android'
            },
            windows: {
                sourceDir: './platforms/windows',
                solutionFile: 'SQLitePlugin.sln',
                projects: [
                  {
                    projectFile: 'SQLitePlugin/SQLitePlugin.vcxproj',
                    directDependency: true,
                  }
                ],
            }
        }
    }
}

Error:

react-native-sqlite-storage contains invalid configuration: "dependency.platforms.ios.project" is not allowed

2

Answers


  1. Chosen as BEST ANSWER

    react-native.config.js: commend or delete part of ios

      module.exports = {
    dependency: {
        platforms: {
    
          // ios: {
           //     project: './platforms/ios/SQLite.xcodeproj'
           // },
            android: {
                sourceDir: './platforms/android'
            },
            windows: {
                sourceDir: './platforms/windows',
                solutionFile: 'SQLitePlugin.sln',
                projects: [
                  {
                    projectFile: 'SQLitePlugin/SQLitePlugin.vcxproj',
                    directDependency: true,
                  }
                ],
            }
        }
    }
    

    }


  2. First of all, make sure that you have the following config in the react-native.config.js file:

    module.exports = {
      ...,
      dependencies: {
        ...,
        "react-native-sqlite-storage": {
          platforms: {
            android: {
              sourceDir:
                "../node_modules/react-native-sqlite-storage/platforms/android-native",
              packageImportPath: "import io.liteglue.SQLitePluginPackage;",
              packageInstance: "new SQLitePluginPackage()"
            }
          }
        }
        ...
      }
      ...
    };
    

    NOTE

    If you do not have the react-native.config.js file in the root of your project, feel free to create it and put the config above in it.

    Then, do the following steps

    1-Set up patch-package for your project

    2-Open node_modules/react-native-sqlite-storage/react-native.config.js

    3-Edit as follows

    ios: {
        project: './platforms/ios/SQLite.xcodeproj'
    },
    

    to

    ios: {},
    

    4-Run npx patch-package react-native-sqlite-storage at terminal

    5-patch-package makes react-native-sqlite-storage+6.0.1.patch and add it to {$root}/patches

    6-Build your project!

    Thanks to Mitsuharu Emoto for sharing the code.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search