Reputation: 109
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:
Upvotes: 5
Views: 10009
Reputation: 677
This code works for me without warnings Maybe works for you too
module.exports = {
dependency: {
platforms: {
ios: {
// project: './platforms/ios/SQLite.xcodeproj'
},
android: {
sourceDir: './platforms/android',
// packageImportPath: "import io.liteglue.SQLitePluginPackage;",
// packageInstance: "new SQLitePluginPackage()"
},
windows: {
sourceDir: './platforms/windows',
solutionFile: 'SQLitePlugin.sln',
projects: [
{
projectFile: 'SQLitePlugin/SQLitePlugin.vcxproj',
directDependency: true,
}
],
}
}
}
}
Upvotes: 0
Reputation: 14892
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()"
}
}
}
...
}
...
};
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-Run npx patch-package react-native-sqlite-storage
at terminal
3-Open node_modules/react-native-sqlite-storage/react-native.config.js
4-Edit as follows
ios: {
project: './platforms/ios/SQLite.xcodeproj'
},
to
ios: {},
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.
Upvotes: 7
Reputation: 109
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,
}
],
}
}
}
}
Upvotes: 5