1

When I run the app in the Xamarin Android player it works just fine, but when I run on a device I am getting the following error:

Error 1 (sqlite): CREATE TABLE main."custScanned" ( z_rv INTEGER NULL UNIQUE REFERENCES "z$rv$1483152329"(z_rv) DEFERRABLE INITIALLY DEFERRED, "Id" integer primary key NOT NULL, "custNumber" text COLLATE NOCASE, "scannedDate" text COLLATE NOCASE ): table "custScanned" already exists jni/../../../../..//build/android/core/jni/../../../../src/core/sg/sg_sqlite.c:304 jni/../../../../..//build/android/core/jni/../../../../src/core/client/zum_sync.c:558 jni/../../../../..//build/android/core/jni/../../../../src/core/client/zum_sync.c:2219 jni/../../../../..//build/android/core/jni/../../../../src/core/client/zum_sync.c:3889 jni/../../../../..//build/android/core/jni/../../../../src/core/client/zum_sync.c:4382 jni/../../../../..//build/android/core/jni/../../../../src/core/client/zum_sync.c:7703 jni/../../../../..//build/android/core/jni/../../../../src/core/client/zum_sync.c:7763 jni/../../../../..//build/android/core/jni/../../../../src/core/client/zum_sync.c:8871 jni/../../../../..//build/android/core/jni/../../../../src/core/client/zum_sync.c:9227

When I look at the LogCat on the device it says table custScanned already exists. I thought that was the point of syncing: to send data to the server and add data from the server to an existing table on the device.

Demitrian
  • 3,200
  • 1
  • 24
  • 41
RdDragon
  • 67
  • 6

2 Answers2

2

I resolved it with help from Zumero support. I was creating the table at startup that is why the error was happening.

RdDragon
  • 67
  • 6
2

While Zumero does want to sync your client tables with their server-side counterparts, it wants to create those tables itself on initial sync. So (as you discovered) you need to start with an empty SQLite database, or with a non-existent database — Zumero will create it for you on initial sync. Presumably the Android player did not have a pre-existing SQLite database, or at least did not have this table.

Zumero needs to create the housekeeping tables and other data, and get the client-side schema just right, in order to track history, merge changes, etc. with the server. Without that information, there's no way to reconcile the structure and contents of a pre-existing database with the server-side data.

Paul Roub
  • 36,322
  • 27
  • 84
  • 93