AmityCoreClient.newUserRepository().updateUser - error

I’m trying to update my photo & name in Amity

        await AmityCoreClient.newUserRepository().updateUser(userMail).avatarFileId(file1.fileUrl).update().then((AmityUser user) async {          ......

with the following parameters
userMail =
file1.fileUrl =

The error - Parameters validation error!
In the log -
[log] *** DioError ***:
[log] uri:
[log] DioError [DioErrorType.response]: Http status error [422]

Hi @meridork ,

Which platform(s) & version does this occur in?

Thank you,
Amity Support

I’m working with Flutter
debugging with Android studio & Android mobile device
Amity - amity_sdk: ^0.23.0
Flutter version 3.10.6

Please point me a way to update my avatar,
Do I need to upload image and then update the user
in the command
AmityCoreClient.newUserRepository().updateUser(email).avatarFileId(file1.fileId).update().then((AmityUser user)

Or in one step like following?
AmityCoreClient.newUserRepository().updateUser(email).avatarFileId(image).update().then((AmityUser user)

Hi @meridork ,

For this it’s AmityCoreClient.newUserRepository().updateUser(email).avatarFileId(avatarFileId).update().then((AmityUser user)
Please refer to User - Amity Docs

Does this resolve your issue?

Amity Support