-
Notifications
You must be signed in to change notification settings - Fork 521
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[react-native]After adding Sqlite to the project, Error occurs #294
Comments
I've the same problem. I can't build for Android after configuring
My environmentpackage.json
android/settings.gradle
android/app/build.gradle
android/app/src/main/java/com/appname
|
@Niks77 Have you found any solution? |
@andpor After some tries I was able to install and link correctly the package. It built in both android and IOS with no errors. Then trying to open a new db I discovered another problem: this one #285. I've reinstalled many times the package, in a clean rn project, following line by line the readme. |
@filippoitaliano If you are using prepopulated database then you may want to test this https://github.com/sameerjain/SQLiteDemo and see if that compile well and run as expected on android. |
@SameerJain Thank you! It doesn't build on IOS but it's very usefull!! |
@filippoitaliano yeah, I used cipher lib which needed extra steps to build on ios. But this should take you in right direction :) |
I solve my problem with upgrade the version of |
Sincerely I don't know why, but now it works really well. I have the same dependencies mentioned before. My After installing deps I usually:
and I start the bundler separately:
|
Has anyone fixed this? It looks like the problem is that jcenter is missing the gradle dependency and that is the only repository listed in the react-native-sqlite-storage/src/android/build.gradle Lines 2 to 5 in 3d309b2
|
I've been using this lib for close to a year now with minimal problems, but my builds are suddenly spitting out this error (starting 3 days ago on friday). Is the issue that jcenter dropped that dep and this lib has no way of resolving it otherwise? |
@tonycapone The PR I submitted fixed the issue for me. For now I've got |
@filippoitaliano
} |
@DedoJr Yeah, we are in 2019. |
Hi, I had a lot of dependencies errors after trying to install react-native-sqlite-storage and i solved it by changing the path in the settings.gradle : I replace Another thing was that I didn't put anything in the mainApplication file, I din't add any package, which gives me this : I hope it helps |
Which settings.gradle?
|
My React Native Project configuration is
{ "name": "AwesomeProject", "version": "0.0.1", "private": true, "scripts": { "start": "node node_modules/react-native/local-cli/cli.js start", "test": "jest" }, "dependencies": { "react": "16.5.0", "react-native": "0.57.0", "react-native-sqlite-storage": "^3.3.6" }, "devDependencies": { "babel-jest": "23.6.0", "jest": "23.6.0", "metro-react-native-babel-preset": "^0.45.0", "react-test-renderer": "16.5.0" }, "jest": { "preset": "react-native" } }
I am Writing Down What Instructions I followed, please Try to spot where I am wrong
In setting.gradle
rootProject.name = 'AwesomeProject'
include ':react-native-sqlite-storage' project(':react-native-sqlite-storage').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-sqlite-storage/src/android')
include ':app
'`
In Android/app/build.gradle
dependencies { implementation fileTree(dir: "libs", include: ["*.jar"]) implementation "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}" implementation "com.facebook.react:react-native:+" // From node_modules compile project(':react-native-sqlite-storage') }
In MainApllication.java
...
import org.pgsqlite.SQLitePluginPackage;
......
@Override protected List<ReactPackage> getPackages() { return Arrays.<ReactPackage>asList( new SQLitePluginPackage(), new MainReactPackage() ); }
...Thankyou for helping Me
P.s :- Sorry of My Bad English
The text was updated successfully, but these errors were encountered: