GeoPackage Feature table addFeature fail

04-09-2024 12:33 AM
New Contributor


I'm currently using Arcgis kotlin 200.3.0

Trying to add feature to my geoPackage feature table with the follow code 

//GeoPacakge Table
geopackagefeaturetable?.load()?.onSuccess {
Log.d("chris share if can add", geopackagefeaturetable!!.canAdd().toString())
Log.d("chris share if isEditable", geopackagefeaturetable!!.isEditable.toString())

val feature = geopackagefeaturetable?.createFeature(featureAttributes, mapPoint)
?: return showError("Error creating feature using attributes")

// add the feature to the feature table
geopackagefeaturetable?.addFeature(feature)?.onSuccess {
// feature added successfully, update count
featureCountTextView.text =
"Total no of features: ${geopackagefeaturetable?.numberOfFeatures}"
// enable table button since at least 1 feature loaded on the GeodatabaseFeatureTable
viewTableButton.isEnabled = true
}?.onFailure {


The issue I have is failure to add feature with error message : message=SQLite read only., additionalMessage=SQLite: 8
Attempt to write a readonly database, errorCode=1008

while geopackagefeaturetable!!.canAdd() and geopackagefeaturetable!!.isEditable() both return true

pls advice

0 Kudos
1 Reply
Esri Contributor


Can you check if you have provided permissions to read/write the geopackage file?  We do not check the file permission as part of canAdd/isEditable calls, they are meant to check the table/geodatabase metadata if they are are any restrictions or not at the table level. As long as the file permissions are available the geopackage table should be editable.


0 Kudos