awslabs / aws-mobile-appsync-sdk-android

Android SDK for AWS AppSync.
https://docs.amplify.aws/sdk/api/graphql/q/platform/android/
Apache License 2.0
105 stars 58 forks source link

GraphQL files not generated in FlavourBased Project #328

Open sandipgh19 opened 3 years ago

sandipgh19 commented 3 years ago

GraphQL files not generated in FlavourBased Project. It's working fine in 3.0.1v. But it's not building in 3.1.2v.

Steps to reproduce the behavior:

  1. Create 2 Flavours, let's say A and B.
  2. Put the graphQL files in flavour A.
  3. Use AWS version 3.1.2 and Build
  4. See the building error.

Expected behavior: All GraphQL files needs to generate.

Environment:

richardmcclellan commented 3 years ago

@sandipgh19, can you provide the error you are seeing?

sandipgh19 commented 3 years ago

As per logs: in v3.0.1: Task :app:generateDebugApolloIR

Task :app:generateDebugApolloClasses

in v3.1.2:

Task :app:generateDebugApolloIR NO-SOURCE Task :app:generateDebugApolloClasses NO-SOURCE

All the Auto generated files are not build.

richardmcclellan commented 3 years ago

When you build your app, Java classes are generated from the queries.graphql, mutations.graphql, and subscriptions.graphql files. Given the NO-SOURCE error you are seeing, my guess is that it cannot find these files.

Check and make sure these .graphql files are present at app/src/main/graphql/com/amazonaws/amplify/generated/graphql. These are generated when you run amplify push, or amplify add codegen as described in this documentation.

sandipgh19 commented 3 years ago

@richardmcclellan .graphql files are present at app/src/A/graphql/amazonaws (A is the flavour name) in the project. It's works well in v3.0.1. But in latest version build never success.

jamesonwilliams commented 3 years ago

Version 3.1 added support for Android Gradle Plugin 4+ (see PR https://github.com/awslabs/aws-mobile-appsync-sdk-android/pull/301). I suspect that work did not consider support for flavors.

sandipgh19 commented 3 years ago

@jamesonwilliams is there any plan to support flavours?

jamesonwilliams commented 3 years ago

@jamesonwilliams is there any plan to support flavours?

4.1.x has been out since last July, and this is the first request we've seen for it. We'll probably prioritize other work until we see further demand. Pull Requests are always welcomed!