GraphQL - Nullable 不是可重复的注解类型

GraphQL - Nullable is not a repeatable annotation type

我在项目中使用AWS:

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
}

并且由于生成的代码中存在问题而面临无法构建应用程序的问题:

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;
}

并且构建失败,因为 error: Nullable is not a repeatable annotation type

可能是什么原因?是否可以制定一些解决方法来解决此问题?

我 运行 昨天遇到了完全相同的问题。 AWS Android 团队将我的问题请求移交给了 AppSync 团队。

您可以在此处跟踪进度:https://github.com/awslabs/aws-mobile-appsync-sdk-android/issues/273#

我遇到了同样的问题,我的项目没有使用导航库,解决方法是将 Hilt 恢复到 2.35.1 版,Gradle 恢复到 4.2.2 版

dependencies {
    ...
    classpath "com.android.tools.build:gradle:4.2.2"
    classpath "com.google.dagger:hilt-android-gradle-plugin:2.35.1"
}

dependencies {
    // Hilt
    implementation "com.google.dagger:hilt-android:2.35.1"
    kapt "com.google.dagger:hilt-android-compiler:2.35.1"
}