question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Amplify getting started tutorial on Android crashes with SQLiteConstraintException

See original GitHub issue

I am following the Ampligy getting started tutorial for Android https://docs.amplify.aws/start/getting-started/add-api/q/integration/android I am at the “Connect to the Cloud” step 5, and when I run the application, it crashes with:

E/Tutorial: Observation failed.
    AmplifyException {message=Error in saving the model: ModelMetadata[id=318f28da-9d30-42b0-bc9e-505d41f9898f], cause=android.database.sqlite.SQLiteConstraintException: UNIQUE constraint failed: ModelMetadata.id (code 1555 SQLITE_CONSTRAINT_PRIMARYKEY), recoverySuggestion=See attached exception for details.}
        at com.amplifyframework.datastore.storage.sqlite.SQLiteStorageAdapter.lambda$save$3$SQLiteStorageAdapter(SQLiteStorageAdapter.java:333)
        at com.amplifyframework.datastore.storage.sqlite.-$$Lambda$SQLiteStorageAdapter$lMf-ZzF10cDUtleQzXsLUxpfzAI.run(Unknown Source:12)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:462)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
        at java.lang.Thread.run(Thread.java:923)
     Caused by: android.database.sqlite.SQLiteConstraintException: UNIQUE constraint failed: ModelMetadata.id (code 1555 SQLITE_CONSTRAINT_PRIMARYKEY)
        at android.database.sqlite.SQLiteConnection.nativeExecuteForLastInsertedRowId(Native Method)
        at android.database.sqlite.SQLiteConnection.executeForLastInsertedRowId(SQLiteConnection.java:938)
        at android.database.sqlite.SQLiteSession.executeForLastInsertedRowId(SQLiteSession.java:790)
        at android.database.sqlite.SQLiteStatement.executeInsert(SQLiteStatement.java:88)
        at com.amplifyframework.datastore.storage.sqlite.SQLiteStorageAdapter.saveModel(SQLiteStorageAdapter.java:717)
        at com.amplifyframework.datastore.storage.sqlite.SQLiteStorageAdapter.lambda$save$3$SQLiteStorageAdapter(SQLiteStorageAdapter.java:315)
        at com.amplifyframework.datastore.storage.sqlite.-$$Lambda$SQLiteStorageAdapter$lMf-ZzF10cDUtleQzXsLUxpfzAI.run(Unknown Source:12) 
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:462) 
        at java.util.concurrent.FutureTask.run(FutureTask.java:266) 
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) 
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) 
        at java.lang.Thread.run(Thread.java:923) 

Find here the project source: tutorial.zip

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

3reactions
Switcher05commented, Oct 15, 2020

Well I was going through the tutorial and encountered this issue. https://docs.amplify.aws/start/getting-started/integrate/q/integration/android#create-a-todo Step 3 worked fine, made changes in step 4 and now it’s broken. Tried undo and rerun step 3 and it’s still failing. Not a good week to be trying to convince my team to use Amplify lol.

10/14 23:43:59: Launching 'app' on Nexus 5X API 29 x86.
$ adb shell am start -n "com.example.todo/com.example.todo.MainActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
Connected to process 20387 on device 'Nexus_5X_API_29_x86 [emulator-5554]'.
Capturing and displaying logcat messages from application. This behavior can be disabled in the "Logcat output" section of the "Debugger" settings page.
I/om.example.tod: The ClassLoaderContext is a special shared library.
D/NetworkSecurityConfig: No Network Security Config specified, using platform default
I/Tutorial: Initialized Amplify
W/RenderThread: type=1400 audit(0.0:44): avc: denied { write } for name="property_service" dev="tmpfs" ino=9472 scontext=u:r:untrusted_app:s0:c133,c256,c512,c768 tcontext=u:object_r:property_socket:s0 tclass=sock_file permissive=0 app=com.example.todo
D/libEGL: Emulator has host GPU support, qemu.gles is set to 1.
W/libc: Unable to set property "qemu.gles" to "1": connection failed; errno=13 (Permission denied)
D/libEGL: loaded /vendor/lib/egl/libEGL_emulation.so
D/libEGL: loaded /vendor/lib/egl/libGLESv1_CM_emulation.so
D/libEGL: loaded /vendor/lib/egl/libGLESv2_emulation.so
W/om.example.tod: Accessing hidden field Lsun/misc/Unsafe;->theUnsafe:Lsun/misc/Unsafe; (greylist, reflection, allowed)
    Accessing hidden method Lsun/misc/Unsafe;->allocateInstance(Ljava/lang/Class;)Ljava/lang/Object; (greylist, reflection, allowed)
I/amplify:aws-datastore: DataStore orchestrator transitioning states. Current mode = STOPPED, target mode = SYNC_VIA_API.
    Starting to observe local storage changes.
I/amplify:aws-datastore: Now observing local storage. Local changes will be enqueued to mutation outbox.
I/amplify:aws-datastore: Starting API synchronization mode.
W/om.example.tod: Accessing hidden method Landroid/view/View;->computeFitSystemWindows(Landroid/graphics/Rect;Landroid/graphics/Rect;)Z (greylist, reflection, allowed)
    Accessing hidden method Landroid/view/ViewGroup;->makeOptionalFitsSystemWindows()V (greylist, reflection, allowed)
I/amplify:aws-datastore: DataStore orchestrator transitioning states. Current mode = LOCAL_ONLY, target mode = SYNC_VIA_API.
I/Tutorial: Observation began.
I/amplify:aws-datastore: DataStore orchestrator transitioning states. Current mode = LOCAL_ONLY, target mode = SYNC_VIA_API.
I/Tutorial: Todo {id=dbd3acc2-52b7-4006-80aa-fec76ce3c2f2, name=Build Android application, priority=null, description=Build an Android application using Amplify}
    Saved item: Build Android application
D/HostConnection: HostConnection::get() New Host Connection established 0xdbb5e190, tid 20425
    HostComposition ext ANDROID_EMU_CHECKSUM_HELPER_v1 ANDROID_EMU_native_sync_v2 ANDROID_EMU_native_sync_v3 ANDROID_EMU_native_sync_v4 ANDROID_EMU_dma_v1 ANDROID_EMU_direct_mem ANDROID_EMU_host_composition_v1 ANDROID_EMU_host_composition_v2 ANDROID_EMU_vulkan ANDROID_EMU_deferred_vulkan_commands ANDROID_EMU_vulkan_null_optional_strings ANDROID_EMU_vulkan_create_resources_with_requirements ANDROID_EMU_YUV420_888_to_NV21 ANDROID_EMU_YUV_Cache ANDROID_EMU_async_unmap_buffer ANDROID_EMU_vulkan_free_memory_sync ANDROID_EMU_vulkan_shader_float16_int8 ANDROID_EMU_vulkan_async_queue_submit GL_OES_EGL_image_external_essl3 GL_OES_vertex_array_object GL_KHR_texture_compression_astc_ldr ANDROID_EMU_gles_max_version_3_1 
W/OpenGLRenderer: Failed to choose config with EGL_SWAP_BEHAVIOR_PRESERVED, retrying without...
D/eglCodecCommon: setVertexArrayObject: set vao to 0 (0) 0 0
D/EGL_emulation: eglCreateContext: 0xdbb1a4e0: maj 3 min 1 rcv 4
D/EGL_emulation: eglMakeCurrent: 0xdbb1a4e0: ver 3 1 (tinfo 0xdbb008c0)
E/eglCodecCommon: glUtilsParamSize: unknow param 0x000082da
    glUtilsParamSize: unknow param 0x000082da
W/Gralloc3: mapper 3.x is not supported
D/HostConnection: createUnique: call
D/HostConnection: HostConnection::get() New Host Connection established 0xdbb5ea50, tid 20425
    HostComposition ext ANDROID_EMU_CHECKSUM_HELPER_v1 ANDROID_EMU_native_sync_v2 ANDROID_EMU_native_sync_v3 ANDROID_EMU_native_sync_v4 ANDROID_EMU_dma_v1 ANDROID_EMU_direct_mem ANDROID_EMU_host_composition_v1 ANDROID_EMU_host_composition_v2 ANDROID_EMU_vulkan ANDROID_EMU_deferred_vulkan_commands ANDROID_EMU_vulkan_null_optional_strings ANDROID_EMU_vulkan_create_resources_with_requirements ANDROID_EMU_YUV420_888_to_NV21 ANDROID_EMU_YUV_Cache ANDROID_EMU_async_unmap_buffer ANDROID_EMU_vulkan_free_memory_sync ANDROID_EMU_vulkan_shader_float16_int8 ANDROID_EMU_vulkan_async_queue_submit GL_OES_EGL_image_external_essl3 GL_OES_vertex_array_object GL_KHR_texture_compression_astc_ldr ANDROID_EMU_gles_max_version_3_1 
D/eglCodecCommon: allocate: Ask for block of size 0x1000
    allocate: ioctl allocate returned offset 0x3ff805000 size 0x2000
D/EGL_emulation: eglMakeCurrent: 0xdbb1a4e0: ver 3 1 (tinfo 0xdbb008c0)
D/eglCodecCommon: setVertexArrayObject: set vao to 0 (0) 1 0
W/om.example.tod: Long monitor contention with owner pool-1-thread-2 (20435) at void com.amplifyframework.api.aws.SubscriptionEndpoint.requestSubscription(com.amplifyframework.api.graphql.GraphQLRequest, com.amplifyframework.core.Consumer, com.amplifyframework.core.Consumer, com.amplifyframework.core.Consumer, com.amplifyframework.core.Action)(SubscriptionEndpoint.java:107) waiters=0 in void com.amplifyframework.api.aws.SubscriptionEndpoint.requestSubscription(com.amplifyframework.api.graphql.GraphQLRequest, com.amplifyframework.core.Consumer, com.amplifyframework.core.Consumer, com.amplifyframework.core.Consumer, com.amplifyframework.core.Action) for 749ms
W/om.example.tod: Long monitor contention with owner pool-1-thread-2 (20435) at void com.amplifyframework.api.aws.SubscriptionEndpoint.requestSubscription(com.amplifyframework.api.graphql.GraphQLRequest, com.amplifyframework.core.Consumer, com.amplifyframework.core.Consumer, com.amplifyframework.core.Consumer, com.amplifyframework.core.Action)(SubscriptionEndpoint.java:107) waiters=1 in void com.amplifyframework.api.aws.SubscriptionEndpoint.requestSubscription(com.amplifyframework.api.graphql.GraphQLRequest, com.amplifyframework.core.Consumer, com.amplifyframework.core.Consumer, com.amplifyframework.core.Consumer, com.amplifyframework.core.Action) for 844ms
I/amplify:aws-datastore: Began buffering subscription events for remote mutations [class com.amplifyframework.datastore.generated.model.Todo] to Cloud models of types [ON_CREATE, ON_UPDATE, ON_DELETE].
I/amplify:aws-datastore: Successfully sync'd down model state from cloud.
I/amplify:aws-datastore: Starting processing subscription data buffer.
I/amplify:aws-datastore: Starting API synchronization mode.
I/amplify:aws-datastore: Began buffering subscription events for remote mutations [class com.amplifyframework.datastore.generated.model.Todo] to Cloud models of types [ON_CREATE, ON_UPDATE, ON_DELETE].
I/amplify:aws-datastore: Successfully sync'd down model state from cloud.
I/amplify:aws-datastore: Starting processing subscription data buffer.
    Starting API synchronization mode.
I/amplify:aws-datastore: Began buffering subscription events for remote mutations [class com.amplifyframework.datastore.generated.model.Todo] to Cloud models of types [ON_CREATE, ON_UPDATE, ON_DELETE].
I/amplify:aws-datastore: Successfully sync'd down model state from cloud.
I/amplify:aws-datastore: Starting processing subscription data buffer.
W/System.err: SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
    SLF4J: Defaulting to no-operation (NOP) logger implementation
    SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
I/amplify:aws-datastore: Started processing the mutation outbox. Pending mutations will be published to the cloud.
I/chatty: uid=10133(com.example.todo) RxSingleSchedul identical 1 line
I/amplify:aws-datastore: Started processing the mutation outbox. Pending mutations will be published to the cloud.
I/amplify:aws-datastore: Successfully enqueued PendingMutation{mutatedItem=Todo {id=dbd3acc2-52b7-4006-80aa-fec76ce3c2f2, name=Build Android application, priority=null, description=Build an Android application using Amplify}, classOfMutatedItem=class com.amplifyframework.datastore.generated.model.Todo, mutationType=CREATE, mutationId=aa22b10a-0e98-11eb-964a-ed18bd2ebcd0, predicate=MatchAllQueryPredicate}
I/amplify:aws-datastore: Mutation outbox has pending mutation for dbd3acc2-52b7-4006-80aa-fec76ce3c2f2, refusing to merge.
I/amplify:aws-datastore: Successfully removed from mutations outboxPendingMutation{mutatedItem=Todo {id=dbd3acc2-52b7-4006-80aa-fec76ce3c2f2, name=Build Android application, priority=null, description=Build an Android application using Amplify}, classOfMutatedItem=class com.amplifyframework.datastore.generated.model.Todo, mutationType=CREATE, mutationId=aa22b10a-0e98-11eb-964a-ed18bd2ebcd0, predicate=MatchAllQueryPredicate}
I/Tutorial: Todo {id=dbd3acc2-52b7-4006-80aa-fec76ce3c2f2, name=Build Android application, priority=null, description=Build an Android application using Amplify}
I/Tutorial: Todo {id=dbd3acc2-52b7-4006-80aa-fec76ce3c2f2, name=Build Android application, priority=null, description=Build an Android application using Amplify}
I/Tutorial: Todo {id=dbd3acc2-52b7-4006-80aa-fec76ce3c2f2, name=Build Android application, priority=null, description=Build an Android application using Amplify}
W/amplify:aws-datastore: Storage adapter subscription ended in error
    AmplifyException {message=Error in saving the model: ModelMetadata[id=dbd3acc2-52b7-4006-80aa-fec76ce3c2f2], cause=android.database.sqlite.SQLiteConstraintException: UNIQUE constraint failed: ModelMetadata.id (code 1555 SQLITE_CONSTRAINT_PRIMARYKEY), recoverySuggestion=See attached exception for details.}
        at com.amplifyframework.datastore.storage.sqlite.SQLiteStorageAdapter.lambda$save$3$SQLiteStorageAdapter(SQLiteStorageAdapter.java:333)
        at com.amplifyframework.datastore.storage.sqlite.-$$Lambda$SQLiteStorageAdapter$JhGtXoPGeJ7lbNvRHxROfLs-WmE.run(Unknown Source:12)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:462)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
        at java.lang.Thread.run(Thread.java:919)
     Caused by: android.database.sqlite.SQLiteConstraintException: UNIQUE constraint failed: ModelMetadata.id (code 1555 SQLITE_CONSTRAINT_PRIMARYKEY)
        at android.database.sqlite.SQLiteConnection.nativeExecuteForLastInsertedRowId(Native Method)
        at android.database.sqlite.SQLiteConnection.executeForLastInsertedRowId(SQLiteConnection.java:879)
        at android.database.sqlite.SQLiteSession.executeForLastInsertedRowId(SQLiteSession.java:790)
        at android.database.sqlite.SQLiteStatement.executeInsert(SQLiteStatement.java:88)
        at com.amplifyframework.datastore.storage.sqlite.SQLiteStorageAdapter.saveModel(SQLiteStorageAdapter.java:717)
        at com.amplifyframework.datastore.storage.sqlite.SQLiteStorageAdapter.lambda$save$3$SQLiteStorageAdapter(SQLiteStorageAdapter.java:315)
        at com.amplifyframework.datastore.storage.sqlite.-$$Lambda$SQLiteStorageAdapter$JhGtXoPGeJ7lbNvRHxROfLs-WmE.run(Unknown Source:12) 
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:462) 
        at java.util.concurrent.FutureTask.run(FutureTask.java:266) 
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) 
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) 
        at java.lang.Thread.run(Thread.java:919) 
E/Tutorial: Observation failed.
    AmplifyException {message=Error in saving the model: ModelMetadata[id=dbd3acc2-52b7-4006-80aa-fec76ce3c2f2], cause=android.database.sqlite.SQLiteConstraintException: UNIQUE constraint failed: ModelMetadata.id (code 1555 SQLITE_CONSTRAINT_PRIMARYKEY), recoverySuggestion=See attached exception for details.}
        at com.amplifyframework.datastore.storage.sqlite.SQLiteStorageAdapter.lambda$save$3$SQLiteStorageAdapter(SQLiteStorageAdapter.java:333)
        at com.amplifyframework.datastore.storage.sqlite.-$$Lambda$SQLiteStorageAdapter$JhGtXoPGeJ7lbNvRHxROfLs-WmE.run(Unknown Source:12)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:462)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
        at java.lang.Thread.run(Thread.java:919)
     Caused by: android.database.sqlite.SQLiteConstraintException: UNIQUE constraint failed: ModelMetadata.id (code 1555 SQLITE_CONSTRAINT_PRIMARYKEY)
        at android.database.sqlite.SQLiteConnection.nativeExecuteForLastInsertedRowId(Native Method)
        at android.database.sqlite.SQLiteConnection.executeForLastInsertedRowId(SQLiteConnection.java:879)
        at android.database.sqlite.SQLiteSession.executeForLastInsertedRowId(SQLiteSession.java:790)
        at android.database.sqlite.SQLiteStatement.executeInsert(SQLiteStatement.java:88)
        at com.amplifyframework.datastore.storage.sqlite.SQLiteStorageAdapter.saveModel(SQLiteStorageAdapter.java:717)
        at com.amplifyframework.datastore.storage.sqlite.SQLiteStorageAdapter.lambda$save$3$SQLiteStorageAdapter(SQLiteStorageAdapter.java:315)
        at com.amplifyframework.datastore.storage.sqlite.-$$Lambda$SQLiteStorageAdapter$JhGtXoPGeJ7lbNvRHxROfLs-WmE.run(Unknown Source:12) 
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:462) 
        at java.util.concurrent.FutureTask.run(FutureTask.java:266) 
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) 
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) 
        at java.lang.Thread.run(Thread.java:919) 
W/amplify:aws-datastore: Failed to sync remote model into local storage: ModelWithMetadata{model=Todo {id=dbd3acc2-52b7-4006-80aa-fec76ce3c2f2, name=Build Android application, priority=null, description=Build an Android application using Amplify}, syncMetadata=ModelMetadata{id='dbd3acc2-52b7-4006-80aa-fec76ce3c2f2', _deleted=null, _version=1, _lastChangedAt=Temporal.Timestamp{timestamp=1602733442401}}}
    AmplifyException {message=Error in saving the model: ModelMetadata[id=dbd3acc2-52b7-4006-80aa-fec76ce3c2f2], cause=android.database.sqlite.SQLiteConstraintException: UNIQUE constraint failed: ModelMetadata.id (code 1555 SQLITE_CONSTRAINT_PRIMARYKEY), recoverySuggestion=See attached exception for details.}
        at com.amplifyframework.datastore.storage.sqlite.SQLiteStorageAdapter.lambda$save$3$SQLiteStorageAdapter(SQLiteStorageAdapter.java:333)
        at com.amplifyframework.datastore.storage.sqlite.-$$Lambda$SQLiteStorageAdapter$JhGtXoPGeJ7lbNvRHxROfLs-WmE.run(Unknown Source:12)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:462)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
        at java.lang.Thread.run(Thread.java:919)
     Caused by: android.database.sqlite.SQLiteConstraintException: UNIQUE constraint failed: ModelMetadata.id (code 1555 SQLITE_CONSTRAINT_PRIMARYKEY)
        at android.database.sqlite.SQLiteConnection.nativeExecuteForLastInsertedRowId(Native Method)
        at android.database.sqlite.SQLiteConnection.executeForLastInsertedRowId(SQLiteConnection.java:879)
        at android.database.sqlite.SQLiteSession.executeForLastInsertedRowId(SQLiteSession.java:790)
        at android.database.sqlite.SQLiteStatement.executeInsert(SQLiteStatement.java:88)
        at com.amplifyframework.datastore.storage.sqlite.SQLiteStorageAdapter.saveModel(SQLiteStorageAdapter.java:717)
        at com.amplifyframework.datastore.storage.sqlite.SQLiteStorageAdapter.lambda$save$3$SQLiteStorageAdapter(SQLiteStorageAdapter.java:315)
        at com.amplifyframework.datastore.storage.sqlite.-$$Lambda$SQLiteStorageAdapter$JhGtXoPGeJ7lbNvRHxROfLs-WmE.run(Unknown Source:12) 
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:462) 
        at java.util.concurrent.FutureTask.run(FutureTask.java:266) 
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) 
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) 
        at java.lang.Thread.run(Thread.java:919) 
    Reading subscriptions buffer has failed.
    AmplifyException {message=Error in saving the model: ModelMetadata[id=dbd3acc2-52b7-4006-80aa-fec76ce3c2f2], cause=android.database.sqlite.SQLiteConstraintException: UNIQUE constraint failed: ModelMetadata.id (code 1555 SQLITE_CONSTRAINT_PRIMARYKEY), recoverySuggestion=See attached exception for details.}
        at com.amplifyframework.datastore.storage.sqlite.SQLiteStorageAdapter.lambda$save$3$SQLiteStorageAdapter(SQLiteStorageAdapter.java:333)
        at com.amplifyframework.datastore.storage.sqlite.-$$Lambda$SQLiteStorageAdapter$JhGtXoPGeJ7lbNvRHxROfLs-WmE.run(Unknown Source:12)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:462)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
        at java.lang.Thread.run(Thread.java:919)
     Caused by: android.database.sqlite.SQLiteConstraintException: UNIQUE constraint failed: ModelMetadata.id (code 1555 SQLITE_CONSTRAINT_PRIMARYKEY)
        at android.database.sqlite.SQLiteConnection.nativeExecuteForLastInsertedRowId(Native Method)
        at android.database.sqlite.SQLiteConnection.executeForLastInsertedRowId(SQLiteConnection.java:879)
        at android.database.sqlite.SQLiteSession.executeForLastInsertedRowId(SQLiteSession.java:790)
        at android.database.sqlite.SQLiteStatement.executeInsert(SQLiteStatement.java:88)
        at com.amplifyframework.datastore.storage.sqlite.SQLiteStorageAdapter.saveModel(SQLiteStorageAdapter.java:717)
        at com.amplifyframework.datastore.storage.sqlite.SQLiteStorageAdapter.lambda$save$3$SQLiteStorageAdapter(SQLiteStorageAdapter.java:315)
        at com.amplifyframework.datastore.storage.sqlite.-$$Lambda$SQLiteStorageAdapter$JhGtXoPGeJ7lbNvRHxROfLs-WmE.run(Unknown Source:12) 
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:462) 
        at java.util.concurrent.FutureTask.run(FutureTask.java:266) 
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) 
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) 
        at java.lang.Thread.run(Thread.java:919) 
I/amplify:aws-datastore: Stopping synchronization with remote API.
    Stopping subscription processor.
I/amplify:aws-datastore: Stopped subscription processor.
1reaction
Jacke-debugcommented, Oct 11, 2020

Same problem. Have gone through the complete tutorial three times now and it did work once.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Android Amplify Authentication with AWSMobileClient crashes ...
After entering my email and password and clicking "sign up", the new user gets created in my cognito user pool in my AWS...
Read more >
Facing this crash on Nexus 5X on aws amplify - Stack Overflow
Fatal Exception: java.lang.NullPointerException: Attempt to invoke virtual method 'java.util.List d.c.g.m.g()' on a null object reference at ...
Read more >
[Solved]-React Native Web crashes with aws-amplify
I believe for your web app client you should be importing like this: import Amplify from 'aws-amplify';. jkeys 3600. Source: stackoverflow.com ...
Read more >
Browse Android-textwatcher Answers - Code Matcher
App crashes on startup on android API 10 but not on API 16 because of Resources$ ... How to get Android resource ID...
Read more >
Android - How can I make my custom view fill the whole screen? ( 10 ...
**So I have to make a random question for my logic quiz and I have a written code here. I do not know...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found