aws-mobile-appsync-sdk-android
aws-mobile-appsync-sdk-android copied to clipboard
GraphQL files not generated in FlavourBased Project
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:
- Create 2 Flavours, let's say A and B.
- Put the graphQL files in flavour A.
- Use AWS version 3.1.2 and Build
- See the building error.
Expected behavior: All GraphQL files needs to generate.
Environment:
- AppSync SDK Version: 3.1.2
@sandipgh19, can you provide the error you are seeing?
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.
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 .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.
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 is there any plan to support flavours?
@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!