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 not compatible with Android Studio 4 #248

Closed yusufa2z closed 4 years ago

yusufa2z commented 4 years ago

Describe the bug AppSync gradle (apply plugin: 'com.amazonaws.appsync') fails in Android Studio 4.

To Reproduce Steps to reproduce the behavior:

  1. Download https://github.com/aws-samples/aws-mobile-appsync-events-starter-android
  2. Open in Android Studio 4.0 Canary 8
  3. See build error:

    Failed to apply plugin [id 'com.amazonaws.appsync'] Could not create an instance of type com.apollographql.apollo.gradle.GraphQLSourceDirectorySet.

DannyLyubenov commented 4 years ago

I am experiencing a similar problem in Android 3.5.3

As soon as I include "apply plugin: 'com.amazonaws.appsync'", I get a build error - ERROR: Unable to find method 'org.gradle.api.internal.file.DefaultSourceDirectorySet

After running $ ./gradlew clean, I get

Failed to apply plugin [id 'com.amazonaws.appsync'] Could not create an instance of type com.apollographql.apollo.gradle.GraphQLSourceDirectorySet.

DannyLyubenov commented 4 years ago

After some heavy trial and errors, I found the issue. My Gradle version was set by default to 6, so I downgraded it to 5 and I managed to include the appsync plugin just fine.

jamesonwilliams commented 4 years ago

Cool, thanks for the update @DannyLyubenov, and glad you got things working. I haven't played with the canary builds of Android studio 4 yet. Once it becomes a release candidate I think we will want to double check that everything is working. What are the default versions of Gradle and Android Gradle Plugin, in Android Studio 4 Canary 9? Closing #248 for now as this is not currently in production software and since a workaround is provided above.

polson commented 4 years ago

This is still broken in Android Studio 4 Beta 3

Datalization commented 4 years ago

Same issue here, this is critical for my project, Gradle 6.x is required, but AppSync is not working with Gradle 6.x

doc-rj-celltrak commented 4 years ago

Hi, I'm on Android Studio stable release 4.0.2, and this issue still occurs when I try to use Gradle 6.x. My other dependencies recommend Gradle 6, so this is a real problem.

jamesonwilliams commented 4 years ago

@doc-rj-celltrak you have commented on an issue that was closed as a duplicate. Please review #270. Are you using 3.1.x or higher?

doc-rj-celltrak commented 4 years ago

Thanks @jamesonwilliams we were on 3.0.1. We'll try to upgrade.