nextgis / mobile.forestviolate.user

:construction_worker: Мобильное приложение для сообщения о лесонарушениях
GNU General Public License v3.0
0 stars 3 forks source link

Падение при вводе точки #39

Closed BishopGIS closed 8 years ago

BishopGIS commented 8 years ago

Видимо попыталось дважды добавить. Нужно после нажатия на кнопку отправить блокировать кнопки или закрывать интерфейс отправки.

02-04 16:55:20.696 26634-26634/com.nextgis.safeforest D/nextgismobile: MessageActivity, saveMessage(), point: X: 4182254.7499999995, Y: 7497068.499999997
02-04 16:55:20.741 26634-26634/com.nextgis.safeforest E/SQLiteDatabase: Error inserting mdate=1454590520698 status=1 _geom_2=[B@43e5c6d8 mtype=2 contact=null, null message=test author=polimax@mail.ru _geom_18=[B@43563e90 _id=10000000 _geom_16=[B@42617b20 _geom=[B@4247f7f8 _geom_4=[B@42565df8 _geom_14=[B@423ac030 _geom_6=[B@42e160d0 _geom_12=[B@426778d8 _geom_8=[B@423a7af8 _geom_10=[B@4252c198
  android.database.sqlite.SQLiteConstraintException: PRIMARY KEY must be unique (code 19)
      at android.database.sqlite.SQLiteConnection.nativeExecuteForLastInsertedRowId(Native Method)
      at android.database.sqlite.SQLiteConnection.executeForLastInsertedRowId(SQLiteConnection.java:972)
      at android.database.sqlite.SQLiteSession.executeForLastInsertedRowId(SQLiteSession.java:788)
      at android.database.sqlite.SQLiteStatement.executeInsert(SQLiteStatement.java:86)
      at android.database.sqlite.SQLiteDatabase.insertWithOnConflict(SQLiteDatabase.java:1603)
      at android.database.sqlite.SQLiteDatabase.insert(SQLiteDatabase.java:1473)
      at com.nextgis.maplib.map.VectorLayer.insertInternal(VectorLayer.java:1284)
      at com.nextgis.maplib.map.NGWVectorLayer.insertInternal(NGWVectorLayer.java:243)
      at com.nextgis.maplib.map.VectorLayer.insert(VectorLayer.java:1262)
      at com.nextgis.maplib.map.VectorLayer.insert(VectorLayer.java:1362)
      at com.nextgis.maplib.datasource.LayerContentProvider.insert(LayerContentProvider.java:165)
      at android.content.ContentProvider$Transport.insert(ContentProvider.java:220)
      at android.content.ContentResolver.insert(ContentResolver.java:1195)
      at com.nextgis.safeforest.activity.CreateMessageActivity.sendMessage(CreateMessageActivity.java:320)
      at com.nextgis.safeforest.activity.CreateMessageActivity.onClick(CreateMessageActivity.java:380)
      at android.view.View.performClick(View.java:4640)
      at android.view.View$PerformClick.run(View.java:19421)
      at android.os.Handler.handleCallback(Handler.java:733)
      at android.os.Handler.dispatchMessage(Handler.java:95)
      at android.os.Looper.loop(Looper.java:146)
      at android.app.ActivityThread.main(ActivityThread.java:5487)
      at java.lang.reflect.Method.invokeNative(Native Method)
      at java.lang.reflect.Method.invoke(Method.java:515)
      at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1283)
      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1099)
      at dalvik.system.NativeStart.main(Native Method)
BishopGIS commented 8 years ago

С падением вообще странная ситуация. Сейчас добавляется без этой ошибки, но потом просиходит следующее. Интерфейс не меняется, поле так и остается активным. Через какое-то время появлется диалог "Сохрани лес остановлено", видимо при синхронизации чего-то падает.

BishopGIS commented 8 years ago

Отловил. Вот стектрес

02-04 17:42:58.711 13905-13940/com.nextgis.safeforest:sync D/nextgismobile: onPerformSync
02-04 17:42:59.021 13905-13940/com.nextgis.safeforest:sync W/dalvikvm: threadid=12: thread exiting with uncaught exception (group=0x41cc1c08)
02-04 17:42:59.021 13905-13940/com.nextgis.safeforest:sync E/AndroidRuntime: FATAL EXCEPTION: SyncAdapterThread-1
       Process: com.nextgis.safeforest:sync, PID: 13905
       java.lang.ClassCastException: java.lang.Long cannot be cast to java.lang.Integer
 at com.nextgis.safeforest.util.MapUtil.removeOutdatedChanges(MapUtil.java:122)
 at com.nextgis.safeforest.datasource.FVSyncAdapter.sync(FVSyncAdapter.java:40)
 at com.nextgis.maplib.datasource.ngw.SyncAdapter.onPerformSync(SyncAdapter.java:118)
 at android.content.AbstractThreadedSyncAdapter$SyncThread.run(AbstractThreadedSyncAdapter.java:259)
02-04 17:42:59.046 13905-13905/com.nextgis.safeforest:sync D/nextgismobile: SyncAdapter - sync is canceled, sleep
02-04 17:43:09.046 13905-13905/com.nextgis.safeforest:sync D/nextgismobile: SyncAdapter - sleep for SYNC_CANCELED is ended