aws-amplify / docs

AWS Amplify Framework Documentation
https://docs.amplify.aws
Apache License 2.0
487 stars 1.06k forks source link

Help - Amplify Quick start example for Android #8103

Open ShanmugaCA opened 3 days ago

ShanmugaCA commented 3 days ago

Environment information

Hello,
Trying to use AWS Amplify example for Android and followed the steps provided in https://docs.amplify.aws/android/start/quickstart/

Facing an error in "step 10 - Test in app":

* Command executed is - npx @aws-amplify/backend-cli generate graphql-client-code --format modelgen --model-target java --out app/src/main/java --app-id <your-amplify-app-id> --branch main

Replaced <your-amplify-app-id> with App ID

* Error observed - "InvalidCommandError: The Amplify Gen 2 CLI has been renamed to ampx
Resolution: Rerun using the ampx command name: "

Describe the bug

Reproduction steps

FYI - Replaced with App ID

ykethan commented 3 days ago

@ShanmugaCA thank you for reporting this. You should be able to generate the client code using the following command.

npx ampx generate graphql-client-code --format modelgen --model-target java --out app/src/main/java --app-id <app-id> --branch main

Transferring the issue to the documentation repository to update the android quickstart guide

note on the fix: we could update the command to following

npx --package @aws-amplify/backend-cli ampx