Skip to content
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

Help - Amplify Quick start example for Android #8103

Open
ShanmugaCA opened this issue Nov 19, 2024 · 1 comment
Open

Help - Amplify Quick start example for Android #8103

ShanmugaCA opened this issue Nov 19, 2024 · 1 comment

Comments

@ShanmugaCA
Copy link

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

  • Using Android Studio, followed the steps in https://docs.amplify.aws/android/start/quickstart/
    Android studio used:
    Android Studio Koala | 2024.1.1
    Build #AI-241.15989.150.2411.11948838, built on June 11, 2024
    Runtime version: 17.0.10+0-17.0.10b1087.21-11609105 amd64

  • During step 10 an error observed- ""InvalidCommandError: The Amplify Gen 2 CLI has been renamed to ampx
    Resolution: Rerun using the ampx command name: "

Reproduction steps

  • Choose Android Framework and follow the steps per the Quick start guide available here - https://docs.amplify.aws/android/start/quickstart/

  • All works well till step 7 ... I can see the Auth screen and the logins work as expected. Moved till step 10 and there is an error while executing the - "InvalidCommandError: The Amplify Gen 2 CLI has been renamed to ampx
    Resolution: Rerun using the ampx command name: "

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

FYI - Replaced with App ID

@ykethan
Copy link
Member

ykethan commented Nov 19, 2024

@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

@ykethan ykethan transferred this issue from aws-amplify/amplify-backend Nov 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants