aws-mobile-appsync-sdk-android icon indicating copy to clipboard operation
aws-mobile-appsync-sdk-android copied to clipboard

GraphQL files not generated in FlavourBased Project

Open sandipgh19 opened this issue 4 years ago • 7 comments

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:

  • AppSync SDK Version: 3.1.2

sandipgh19 avatar Feb 12 '21 10:02 sandipgh19

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

richardmcclellan avatar Feb 12 '21 23:02 richardmcclellan

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.

sandipgh19 avatar Feb 13 '21 14:02 sandipgh19

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.

richardmcclellan avatar Feb 13 '21 18:02 richardmcclellan

@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.

sandipgh19 avatar Feb 15 '21 05:02 sandipgh19

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.

jamesonwilliams avatar Feb 17 '21 20:02 jamesonwilliams

@jamesonwilliams is there any plan to support flavours?

sandipgh19 avatar Feb 18 '21 05:02 sandipgh19

@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!

jamesonwilliams avatar Feb 18 '21 05:02 jamesonwilliams