Offline works in ios but not android

13415
75
04-22-2014 04:59 PM
CharlesDawley
Occasional Contributor
I have a collector map that works fine in online/offline mode on my iphone.

When I try and use the offline mode on my android tablet the features do not appear.
But when I use the map in online mode the map works as expected.
Tags (2)
75 Replies
CraigWalsh
New Contributor
In our first attempt to use a Trimble Juno running Android we started a municipal drain manhole inspection/collection process. Over the course of 4 days (June 2-5 2014) we have tried to sync each day to no avail, and now have issues with the python approach to reach the data.


Upon trying to sync
Using the .py code we were able to convert several points but not all.

we have collected new points (.py worked on all of these)
we have updated (inspected) existing points (.py only worked on updates on Monday and Tuesday-thursday and Friday's points come up with an error)

The error when running either of the python files (with the temp.xml, and without-same error) is that an OID already exists.(shown below)

the geodatabase input is the collector offline app data, the output gdb is empty.

Any thoughts.


P.S. one other notable item. When trying to sync on day 2 the android app asked for a login and password, to this I entered my credentials and the sync failed (I am publisher and part of the group that own the content) The collector app was signed in by the administrator at the time (ie map was downloaded by administrator permissions) This corresponds with the time of data loss i.e. we can retrieve the updated data and the new points from before this event, but only new points after this event (no updated points).

Thanks in advance
Craig.

error message from Idle shell.

>>>
Input Offline .geodatabase is: " C:\Temp\ArcGIS_Collector\offline_data\DOS_GIS_c3F1YW1pc2gubWFwcy5hcmNnaXMuY29t\5c23151f1e1f472088299308d1fed713\169f38ac-4fe0-481c-89b6-30158ac63aae.geodatabase
Output fgdb is: " C:\Temp\Collector2.gdb

Traceback (most recent call last):
  File "Z:\GIS_Projects\Mobile\AndroidReadScriptV2\AndroidReadScriptV2.py", line 52, in <module>
    main(sys.argv[1:])
  File "Z:\GIS_Projects\Mobile\AndroidReadScriptV2\AndroidReadScriptV2.py", line 45, in main
    arcpy.ImportXMLWorkspaceDocument_management(output_gdb, Temp_xml, "DATA", "")
  File "C:\Program Files (x86)\ArcGIS\Desktop10.2\arcpy\arcpy\management.py", line 1194, in ImportXMLWorkspaceDocument
    raise e
ExecuteError: ERROR 999999: Error executing function.
A row with this OID already exists.
Field is not editable.
Field is not editable.
Field is not editable.
Field is not editable.
...
Field is not editable.
Field is not editable.
Field is not editable.
Field is not editable.
The operation was attempted on an empty geometry.
Failed to execute (ImportXMLWorkspaceDocument).

>>>
0 Kudos
GIS-Cambria
Occasional Contributor II
Craig,

I'm guessing that maybe when the script crashed on you it didn't delete the temp.xml file. You can check the file location that you chose when you ran the script, if the temp.xml is in there delete it and try to run the script again.

Also, if you're running the script on data that has updates, deletes, and new points then it might have problems trying to read "duplicate" features during the import. Try to write these to different FGDBs and then manually open them in ArcMap to find the duplicates and delete/add/update them using editor. I'm not sure this will help you. If you dig into the device folders you might find another .geodatabase called client_delta_######.geodatabase. This might actually contain your adds and deletes? We just imported one that we had and it has a feature called T_1_inserts, and a table named the same. Since we didn't actually update or delete any points collected that day I can't tell you if it would have other features for updates and deletes.
0 Kudos
AndrewMaracini
New Contributor
We are planning an update for the UC which will address this issue.

Here is the python script..watch out for any white spaces that may be generated when copying and pasting..onnce the KB article is released I will point to that support page.

First copy the .geodatabase file to your computer. You can get to the .geodatabase file under the ArcGIS_Collector folder > offline data > folder with user account name associated with downloaded data > folder with the webmap id > copy the .geodatabase and you paste it onto your computer.

#!/usr/bin/python

# Import sys, getopt, arceditor, arcpy modules
import sys, getopt, arceditor, arcpy

def main(argv):
   input_gdb = 'Enter .geodatabase location'
   output_gdb = 'Enter in an existing fgdb location you want data to be exported into'
   try:
      opts, args = getopt.getopt(argv,"hi:o:",["ifile=","ofile="])
   except getopt.GetoptError:
      print 'test.py -i <input_gdb> -o <input_gdb>'
      sys.exit(2)
   for opt, arg in opts:
      if opt == '-h':
         print 'test.py -i <input_gdb> -o <output_gdb>'
         sys.exit()
      elif opt in ("-i", "--ifile"):
         input_gdb = arg
      elif opt in ("-o", "--ofile"):
         output_gdb = arg
   print 'Input gdb is: "', input_gdb
   print 'Output gdb is: "', output_gdb

   Temp_xml = "temp.xml"

   # Delete the xml workspace document if it exists.
   arcpy.Delete_management(Temp_xml)

   # Export XML Workspace Document
   arcpy.ExportXMLWorkspaceDocument_management(input_gdb, Temp_xml, "DATA", "BINARY", "METADATA")

   # Import XML Workspace Document. This assumes that the outputfile geodatabase is EMPTY.
   arcpy.ImportXMLWorkspaceDocument_management(output_gdb, Temp_xml, "DATA", "")

   # Delete the xml workspace document if it exists.
   arcpy.Delete_management(Temp_xml)

if __name__ == "__main__":
   main(sys.argv[1:])


Russ


OK I went to that folder and I see no geodatabase, suggestions?
0 Kudos
RussRoberts
Esri Notable Contributor
Which folder did you go to? You will see a folder with the username and inside that will have a subfolder with the  web map id that will match the one you see in the web map URL when you look at it in the browser and in that folder will be the .geodatabase file. Copy the web map folder on to your desktop and in the script enter the file location to the .geodatabase on your computer and have a .gdb ready to transfer it into.

Russ
0 Kudos
KeaganAllan
New Contributor III
Good day,

Sorry if I am hijacking this thread a little.
I am having a similar issue with regards to syncing my Offline Data through the Collector on an Android Device.

I have used the two methods mentioned here to use the Python Script.

Firstly the Toolbox - Once running I get an Error 000732:Input Data Element Dataset: "C:\temp\Temp.XML" does not exist

The second method, running through the Python GUI gives me the same Error 000732 error message. Removing the "Delete Temp_xml" portion of the code gives me a 999999 error.

I am hoping someone has had similar issues and has a possible solution?

Kind regards,
K
0 Kudos
RebeccaHorsburgh
New Contributor II
Just want to add that I downloaded the tool and it worked great! A huge relief that we could get the edits off the tablets. The only difference I did was copied the client_data######.geodatabase file from the tablet, it kept throwing back errors when I attempted the other one. Thanks very much for this tool!
0 Kudos
FayeWyatt
New Contributor III

Hello,

I also wanted to say thank you for the tool. It helped me recover some of the data that was trapped on my Android tablet. Unfortunately some of the data that I collected was in a geodatabase with other files that had their attributes edited rather than collecting new features. When I try to recover this geodatabase I get the same error 999999  A row with this OID already exists.

Will there be any way to recover this data in the future, or is it lost forever?

Many thanks

Faye

0 Kudos
Michaelvan_Eggermond1
New Contributor

Hi there,

We encountered a similar issue. We exported the geodatabase from the device to XML and wrote a simple script to assign new objectid's (after tring a dozen other options). The new object id's are incremented to avoid any duplicates. In our case the OID was not of relevance for the data set. Subsequently, the import of the XML succeeded. Just let me know if you're interested in the script.

0 Kudos
EdwardGlover
New Contributor III

Hi Michael,

Because my sync issues are related to edited data, when I run the script I get the following error:

A row with this OID already exists. Failed to execute (ImportXMLWorkspaceDocument).

I am very interested in your script, because it seems as though it addresses the duplicate OID error I get.  Could you share your script with me and elaborate on exporting the geodatabase from the device to XML as well.

Thanks in advance.

Ed

0 Kudos
JonWalker
New Contributor

Hi Michael -

Would you feel comfortable sharing your script?  Assigning new object IDs to the XML would help us recover some data. Your help would be greatly appreciated!

Thanks,

Jon

0 Kudos