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

AppSync codegen models throws @Nullable @Nullable #395

Closed sdhuka closed 2 years ago

sdhuka commented 2 years ago

Describe the bug when I try to build my project I always ran into the following error which does appear for every list item:

error: Nullable is not a repeatable annotation type final @Nullable @Nullable List items

To Reproduce Steps to reproduce the behavior: 1) update java poet dependency to 1.13.0. 2) run clean gradle build. 3) Model are generated with duplicate @nullable annotation for list properties.

Expected behavior Only one @nullable annotation should be added.

Environment(please complete the following information):

Logs

> Task :app:compileDebugJavaWithJavac
/Users/.../app/build/generated/source/appsync/com/amazonaws/amplify/generated/graphql/ListDevicesQuery.java:290: error: Nullable is not a repeatable annotation type
    final @Nullable @Nullable List<Item> items;
                    ^
/Users/.../app/build/generated/source/appsync/com/amazonaws/amplify/generated/graphql/ListDevicesQuery.java:300: error: Nullable is not a repeatable annotation type
    public ListDevices(@Nonnull String __typename, @Nullable @Nullable List<Item> items,
                                                             ^
/Users/.../app/build/generated/source/appsync/com/amazonaws/amplify/generated/graphql/ListDevicesQuery.java:311: error: Nullable is not a repeatable annotation type
    public @Nullable @Nullable List<Item> items() {
                     ^
/Users/.../app/build/generated/source/appsync/com/amazonaws/amplify/generated/graphql/ListProjectItemsQuery.java:301: error: Nullable is not a repeatable annotation type
    final @Nullable @Nullable List<Item> items;
tjleing commented 2 years ago

We are currently actively working on this issue -- the Javapoet version bump seems to involve a change in the method of storing annotations that causes an unfortunate interaction with our library.

tjleing commented 2 years ago

Closed in version 3.3.2.

liviu-timar commented 2 years ago

Hi!

I'm using 3.3.2 and I still have the issue. Am I doing something wrong?

implementation 'com.amazonaws:aws-android-sdk-appsync:3.3.2'

@Nonnull @Nonnull is duplicated.

Thanks

luiss2113-dev commented 2 years ago

I have version 3.2.1, and that version has the same error.

Hice una actualización de :

implementation "com.amazonaws:aws-android-sdk-appsync:3.3.2" a nivel app classpath "com.amazonaws:aws-android-sdk-appsync-gradle-plugin:3.3.2" a nivel project

y adicioné: implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.6.10"