Search code examples
amazon-web-servicesandroid-studiographqlcode-generationaws-amplify

GraphQL - Nullable is not a repeatable annotation type


I use AWS in the project:

implementation('com.amazonaws:aws-android-sdk-appsync:3.0.1')
implementation('org.eclipse.paho:org.eclipse.paho.client.mqttv3:1.2.0')
implementation('org.eclipse.paho:org.eclipse.paho.android.service:1.1.1')
implementation("com.amazonaws:aws-android-sdk-s3:2.16.11")
implementation('com.amazonaws:aws-android-sdk-mobile-client:2.16.3@aar') {
    transitive = true
}
implementation('com.amazonaws:aws-android-sdk-auth-userpools:2.16.3@aar') {
    transitive = true
}

And faced the issue that not able to build application because of issues in generated code:

package com.amazonaws.amplify.generated.graphql;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
....

public static class ListUsers {
final @Nullable @Nullable List<Item> items;

public ListUsers(@Nonnull String __typename, @Nullable @Nullable List<Item> items,
    @Nullable String nextToken) {
  this.__typename = Utils.checkNotNull(__typename, "__typename == null");
  this.items = items;
  this.nextToken = nextToken;
}

public @Nonnull String __typename() {
  return this.__typename;
}

public @Nullable @Nullable List<Item> items() {
  return this.items;
}

and build fails because of error: Nullable is not a repeatable annotation type

what can be the reason? Is it possible to make some workaround to fix this?


Solution

  • I run in exactly the same problem yesterday. The AWS Android team moved my issue request to the AppSync team.

    You can track progress here: https://github.com/awslabs/aws-mobile-appsync-sdk-android/issues/273#