Symptoms
Using MobileAsset v7 on a mobile device (Android, iOS, Windows Mobile/CE), the software is installed on the device and initially appears to communicate with the database. However, when syncing or downloading the mobile database, there is an error on the device: "failed to generate database file".
Cause
The Wasp MobileAsset Windows Service is unable to generate the condensed mobile version of the database due to a problem with data.
Note: This error cannot be resolved by wiping out the mobile device then setting it up again, or by uninstalling and reinstalling the MobileAsset program on the PC. It is a database issue.
Troubleshooting
Examine the WaspMobileAssetServices.log file from the PC that runs the Wasp MobileAsset Windows Service. File location:
Windows Vista, 7, 8, Server 2008, 2012:
C:\ProgramData\Wasp Barcode Technologies\MobileAssetWindowsService\7.0.0.0\
Windows XP, Server 2003:
C:\Documents and Settings\All Users\Application Data\Wasp Barcode Technologies\MobileAssetWindowsService\7.0.0.0\
If there is an error with the phrase "UNIQUE constraint failed" or "A duplicate value cannot be inserted into a unique index ", you should be able to fix the problem by using MobileAsset on the PC to edit the list mentioned in the error. For example, in the errors below, the error mentions "departments.department_code", which indicates the list of department codes contains non-unique values. Edit the department list, changing the department code(s) so that each code only appears once in the list. Possible errors:
---------------------------------
2015-09-25 09:49:53.241 7 --------------- ERROR | Error inserting data to SQLite. System.Data.SQLite.SQLiteException (0x80004005): constraint failed
| UNIQUE constraint failed: departments.department_code
---------------------------------
2020-11-18 13:11:26.871 6 --------------- ERROR | Error inserting data to sdf. A duplicate value cannot be inserted into a unique index. [ Table name = departments,Constraint name = UQ__departments__000000000000019A ]
---------------------------------
If there is a different error, Wasp Tech Support will need the error logs and a database backup to research the error.
If the error in your log file does refer to the Department Code, which is the most commonly affected table, and there are too many duplicates to easilly correct manually, see the article below in Related Pages "MobileAsset v7: List > Departments shows departments with duplicate Department Codes" for a script that can be used to automatically change the Department Codes to distinct values.
If the error in your log file does refer to the Department Code, which is the most commonly affected table, and there are too many duplicates to easilly correct manually, see the article below in Related Pages "MobileAsset v7: List > Departments shows departments with duplicate Department Codes" for a script that can be used to automatically change the Department Codes to distinct values.