Skip to content

importFromJson: "Stringify Json Object not Valid" on Android | {"changes": 0} on iOS #415

Closed Answered by jepiqueau
whitnessme asked this question in Q&A
Discussion options

You must be logged in to vote

@whitnessme Several things were not correct.

  • you cannot use @capacitor-community/[email protected] with capacitor 5
  • the import of the json object is wrong
  • in your schema you have 10 columns and you gave only 9 data for each row
  • in your values the id 4 and id 5 got the same values
  • importFromJson must be used without connection opened.

i change the code of the Home index.tsx as below I have replace the useState by useRef as for unknown reasons i cannot make them working. I have pure react app with Ionic framework and they work well.

import { CapacitorSQLite, SQLiteConnection } from "@capacitor-community/sqlite"
import { useEffect, useState, useRef, useCallback } from "react";
import Link from 

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by jepiqueau
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants