Open ShanmugaCA opened 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
Environment information
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