-
Notifications
You must be signed in to change notification settings - Fork 121
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"createdAt: AWSDateTime" in schema causes Datastore query failure #666
Comments
Hi @jamesonwilliams , @rjuliano, this is the "createdAt: AWSDateTime" issue that we discussed in the Android-help forum. I'm just creating this issue to keep track of it. Please let me know if I'm doing something wrong or if this is a true bug |
Again, thanks so much for doing that. It's easy to lose track of discussions on Discord sometimes. I think this is the correct way to move forward to troubleshoot this issue. Thank you for your patience. |
I'm facing the same issue with Amplify API & Datastore version: 1.3.1. E/MyAmplifyApp: Observation failed.
AmplifyException {message=Error in saving the model: Actividad[id=93d35142-ab8b-46c1-91ba-a353c908dedb], cause=java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String java.time.LocalDateTime.toString()' on a null object reference, 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:923)
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String java.time.LocalDateTime.toString()' on a null object reference
at java.time.OffsetDateTime.toString(OffsetDateTime.java:1906)
at java.lang.String.valueOf(String.java:2924)
at java.lang.StringBuilder.append(StringBuilder.java:132)
at com.amplifyframework.core.model.temporal.Temporal$DateTime.toString(Temporal.java:267)
at java.lang.String.valueOf(String.java:2924)
at com.amplifyframework.datastore.generated.model.Actividad.toString(Actividad.java:156)
at com.amplifyframework.datastore.storage.sqlite.SQLiteStorageAdapter.saveModel(SQLiteStorageAdapter.java:693)
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:923)
E/ActivityRepository: Update failed.
AmplifyException {message=Error in saving the model: Actividad[id=93d35142-ab8b-46c1-91ba-a353c908dedb], cause=java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String java.time.LocalDateTime.toString()' on a null object reference, 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:923)
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String java.time.LocalDateTime.toString()' on a null object reference
at java.time.OffsetDateTime.toString(OffsetDateTime.java:1906)
at java.lang.String.valueOf(String.java:2924)
at java.lang.StringBuilder.append(StringBuilder.java:132)
at com.amplifyframework.core.model.temporal.Temporal$DateTime.toString(Temporal.java:267)
at java.lang.String.valueOf(String.java:2924)
at com.amplifyframework.datastore.generated.model.Actividad.toString(Actividad.java:156)
at com.amplifyframework.datastore.storage.sqlite.SQLiteStorageAdapter.saveModel(SQLiteStorageAdapter.java:693)
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:923) |
Hello,
I'm using Amplify DataStore to talk to an AppSync API in the cloud. When I include
createdAt: AWSDateTime
in my schema, all of my queries will fail.Here's my schema:
This is my query call:
Here's the exception that I get whenever I do query call:
Line 94 is the
getCreatedAt()
call in this function ofTrackItem
:Here are my dependencies:
Thanks
The text was updated successfully, but these errors were encountered: