SQLite: could not prepare INSERT INTO

I upgraded to SDK 33 and cli 2.21.2 and my app no longer works on an iPhone5 running 10.3.3, either IRL or simulator.

It DOES work on iPhoneXS w/iOS 12.3.1 and iPhone6 running 10.3.1

  1. Did the Document directory move??? The database stores paths to recordings. When the database is read, and we attempt to retrieve the recording we get:
    problem loading the recording: [Error: The AVPlayerItem instance has failed with the error code -1100 and domain “NSURLErrorDomain”.]

  2. When we go to write a new record to the database, we get:
    could not prepare INSERT INTO Recordings ( authorID, name, status,recordingType, recordingPath, AssociatedDrillID, updDT ) VALUES (?,?,?,?,?,?,?)

  • node_modules/expo-sqlite/build/SQLite.js:36:34 in _deserializeResultSet

  • node_modules/expo-sqlite/build/SQLite.js:17:48 in

Expo CLI 2.21.2 environment info:
System:
OS: macOS 10.14.5
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 10.4.1 - /usr/local/bin/node
Yarn: 1.16.0 - ~/.yarn/bin/yarn
npm: 6.9.0 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
IDEs:
Android Studio: 3.4 AI-183.6156.11.34.5522156
Xcode: 10.2.1/10E1001 - /usr/bin/xcodebuild
npmPackages:
expo: ^33.0.0 => 33.0.6
react: 16.8.3 => 16.8.3
react-native: https://github.com/expo/react-native/archive/sdk-33.0.0.tar.gz => 0.59.8
react-navigation: ^3.11.0 => 3.11.0
npmGlobalPackages:
expo-cli: 2.14.0

It seems I have a similar issue. I’m also running iOS 10.3.3 on an iPhone5 and when I try to write to my database I get the same error. It reads the database well enough but when I try to write it give the ‘could not prepare insert’ error.

Hi!

Could either of you share an example snack that I can use to reproduce this behavior on my end? As simple as possible would be best. This looks like it may be an issue on our end, so I want to get to the bottom of it ASAP!

Here is an example that is already made, if you want to work off of that

Also, this may be a related issue (although it’s specifies Android) https://github.com/expo/expo/issues/4537

I won’t be able to reproduce it until at least Monday, but a difference I noticed in package.json immediatly was that I’m using React 16.8.3 and you’re using React 16.5.0. Additionally, I’ve had to change my babel import while upgrading through SDKs, so I don’t have it in my dev dependancies. The link to how I changed my .babelrc is here https://stackoverflow.com/questions/51548239/react-native-app-getting-error-app-js-cannot-read-property-filename-of-undef/53234204#53234204

Sorry, I realize this isn’t super useful. I’m just not able to reproduce it for the time being.

Ah sorry about that React mismatch, I’ll have to upgrade that example project to SDK 33!

I’ve never done a snack, but will give it a shot in an hour or so.

didn’t work in a Snack

I suspect it may be a scenario of:
create db in SDK 32
upgrade to SDK 33
can read the DB but fails on insert.

I will try that later tonight

******UPDATE - totally Borked after upgrade. Can no longer create files on iPhone5 running 10.3.1.

Will still try the “create in SDK 32 / update in SDK 33” scenario, but ouch.

current env:

Expo CLI 3.0.2 environment info:
System:
OS: macOS 10.14.5
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 12.6.0 - /usr/local/bin/node
Yarn: 1.17.3 - ~/.yarn/bin/yarn
npm: 6.9.0 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
IDEs:
Android Studio: 3.4 AI-183.6156.11.34.5522156
Xcode: 10.2.1/10E1001 - /usr/bin/xcodebuild
npmPackages:
expo: ^33.0.0 => 33.0.6
react: 16.8.3 => 16.8.3
react-native: https://github.com/expo/react-native/archive/sdk-33.0.0.tar.gz => 0.59.8
react-navigation: ^3.11.0 => 3.11.0
npmGlobalPackages:
expo-cli: 2.14.0

This modified version of the sample snack prints a different error, but the result is the same. The iOS emulator, my physical Android device both behave as intended, but the iPhone 5 iOS 10.3.3 I’m using to test does not and it prints the error…

Error: “Error code 1: no such table: items” in _@[snack internals] << map@[native code] << [snack internals] << f@[snack internals]

…and does not save. I’ll keep going to see if I can reproduce the exact error eventually.

Looks like the same issue I ran into? SQLite not working on iOS 10

Sorry everyone, I should’ve linked this before when I linked that Android issue:

It seems like this is the same issue, and it has been solved for SDK 34 (which should be released very soon)

1 Like

PS- that example has been updated to SDK 33 :smile:

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.