Flutter - unable to use amity sdk

When adding the pub.dev amity sdk in v0.12.0, you get an error with init’ ing the get_it variables.

It’s impossible to work with it as a dependency.
“Exception has occurred. _AssertionError (‘package:get_it/get_it_impl.dart’: Failed assertion: line 404 pos 9: ‘instanceFactory.isReady’: You tried to access an instance of MessageDbAdapter that is not ready yet)”

Would be great if that could be fixed asap, since we can’t continue our integration, without commenting that line out in your sdk. Which is not usable for production.

Thank you very much!
Best regards, Jörn

Hello @jdde , you need to use sycInitialization: true in the setup call. this will initialise all the dependency in the sync manner.

await AmityCoreClient.setup(
                      option: AmityCoreClientOption(
                          apiKey: <API_KEY>,
                          httpEndpoint: <HTTP_ENDPOINT>),
                      sycInitialization: true,
                    );
2 Likes

@Sorbh Oh awesome! Works!
Feels like I didn’t checked anything :see_no_evil:
But just using the default values results in that error -.-

Searched for a solution and saw an issue in the github repo, which was the same.
Thank you very much for your answer, will reference this question in the github issue :slight_smile:

Enjoy your weekend!