aws-mobile-appsync-sdk-android: AppSync Gradle Plugin Not Compatible with Gradle 6

When I add:

apply plugin: 'com.amazonaws.appsync' to my app's build.gradle

I get this error when I sync:

Caused by: org.gradle.api.internal.plugins.PluginApplicationException: Failed to apply plugin [id 'com.amazonaws.appsync']

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 33 (10 by maintainers)

Most upvoted comments

Really interested in this being resolved. Our team wants to update to AS4 to use new features but at the same time AppSync is stopping us from this

This issue is one of several related issues, regarding the architecture of the AppSync SDK.

This AppSync codebase originated as a fork of the Apollo codebase. The original commits entered this repository as copy-paste of the Apollo code, discarding that project’s git history. As a result, I have only a general idea of when the fork occurred, with respect to Apollo’s commit hashes and release tags. This makes it challenging to maintain the repository, as the upstream codebase evolves.

The best possible solution to this current issue would be to take a dependency on Apollo, instead of cloning it. Or, even just to merge in Apollo’s updates, to this codebase. This way, we’d get the upstream Gradle fixes without needing to re-invent them. This solution is one around repository maintenance, as opposed to identifying deliberate Gradle changes.

Another possible solution would be to fix the Gradle incompatibility directly, further drifting from the Apollo codebase. I assume this is the less costly of the two options, in the short term. I’ve sat down to complete this task a couple of times, but got pulled away to other things before I could complete it.

Unfortunately, I do not think it is possible to “re-up” the plugin from the Apollo source, independently from the other Apollo modules. The plugin has a versioned contract with the other modules, that would break, if they aren’t all updated together.

All of this said, this issue is quickly garnering reactions, and becoming one of our more visible. I will bring it back to my team to assess prioritization. My explanation above is for visibility: we are aware of this issue, and are discussing it. I hope that my explanation of the situation helps maintain your trust.

I appreciate your patience. For the immediate time-being, I do recommend the workaround of using AGP 3.6.3 (the last stable release before 4) and Gradle 5.6.4. You can use Android Studio 4; these are project-specific configurations.

Android Studio 4 is now released. It defaults to Gradle v6.1.1. Some features, such as Jetpack Compose, rely on this version of Gradle.

I have just released the fix in version 3.1.0.

AWS AppSync SDK for Android v3.1.0

Will work on backporting to 2.x. Closing this issue for now.

@ahardin Let’s deal with #116 / #199 as separate concerns.

Hello, any news on this issue ?

Also, will the fix be released on version 2.x too or only 3.x ?

I am not sure why #248 or this one were closed. Gradle 6.0.0 is already in the Android Studio pipeline and it will be the default for many developers in a few months.

Hi @murilodag – this is on our backlog and will be in our next release. Thanks.

Thanks @jamesonwilliams. My team appreciates the visibility and we are currently working with the proposed workaround.

We also understand breaking changes are normal, they will continue to happen and the short term solution might not be the best overall.

The only item pending is estimates for the fix and release. You might not have those yet and it is fine. Let us know when you do.

Downgrading gradle version does not work for me. The only option is to downgrade from Android Studio 4.0. I am unable to work on my project for over a week now.

You can still use Android Studio 4.0, but you will need to downgrade the Android Gradle Plugin in the project level build.gradle file to 3.6.2

@murilodag I had closed #248 because the poster had found a suitable workaround. At the time that ticket was raised, Android Studio 4 was still in canary builds. The stable production version of Android Studio / Gradle Plugin is 3.6.3 as of today, and still defaults to Gradle 5.x. I agree with you that AppSync’s Gradle 6.x incompatibility is gaining increasing urgency, though.

I hacked some more on @jpignata’s https://github.com/awslabs/aws-mobile-appsync-sdk-android/pull/301, and was able to get the plugin generating code again, with a project using Gradle 6.1.1 / Android Gradle Plugin 4.0.0.

Let me know if you’d like to test it out, pre-release. Otherwise, should be going out next release (3.1.0.)

Is anyone from the development team aware of this ? It’s been 6 months since Gradle 6.0 and Android Canary 1 with the AGP 4.0 were released. While downgrading is a temporary fix, we can’t use the latest improvments and tools because of this blocker. It’s a shame that such a huge company can’t fix this faster.

Please consider release also for who are still using v2 and can’t migrate to Appsync v3

I am using Gradle 6.5.1 and build tool 4.1.0-beta01 and I am having an issue with AWS AppSync, any fix yet?

Hello @vlazdra, I tried contacting the assigned developer (@desokroshan), but no answer so far.

I had the same issue, when I updated Android Studio to version 4.0, I got the above mentioned error, as the AS4.0 uses Plugin version 4.0.0 and Gradle version 6.1.1.

The issue is solved by downgrading the plugin version to 3.6.2 and gradle version to 5.6.4, however, Android studio keeps recommending updating Android gradle plugin for best performance and to use the new features.

I downgraded the gradle settings by going to File > Project Structure > Project

My issue has been resolved from downgrading the gradle. It may be closed. Thank you.