Closed insidewhy closed 1 year ago
Thanks for reporting. There will be a new release later today where compileOptions are specified already for all plugins as it was done last week. Also there will be a requirement to use at least 4.2 Android Gradle plugin. It is great that you have updated your project to 7.0 already as 4.1.0 is really old one and shouldn't be used as of today.
Closing as new version is released
We saw in the Changelog.md for release
2.0.2
the following log:But we seem to still be getting the error shown in the github issue title. I was able to hack around it by editing
~/.pub-cache/hosted/pub.dev/connectivity_plus-3.0.6/android/build.gradle
and adding the following to theandroid
section:We were eventually able to work around this properly by upgrading to gradle 7.3, for info on how we did this please see the end of this report.
This could be fixed for older versions of gradle by adding the configuration above to your
android/build.gradle
, otherwise I think the documentation should be updated to specify what the minimum gradle requirements are so others don't lose as much time diagnosing this as I have.Platform
Android 12
Plugin
connectivity_plus
Version
3.0.6
Flutter SDK
3.7.12
Steps to reproduce
In our case connectivity_plus 3.0.6 is a transitive dependency of graphl_flutter 5.1.2
When we try to build (via
flutter build apk
) we get this error:Yet we have the following in
android/app/build.gradle
:Other relevant config seems to be:
javac
is version 11:Code Sample
No response
Logs
Flutter Doctor
Checklist before submitting a bug
flutter pub upgrade
flutter clean
Our eventual solution
We had to edit
android/build.gradle
and changeclasspath 'com.android.tools.build:gradle:4.1.0'
toclasspath 'com.android.tools.build:gradle:7.0.0'
.Then we edited
android/gradle/wrapper/gradle-wrapper.properties
and changeddistributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip
todistributionUrl=https\://services.gradle.org/distributions/gradle-7.3-all.zip
.Then we edited
gradle/wrapper/gradle-wrapper.properties
and changeddistributionUrl=https\://services.gradle.org/distributions/gradle-6.8-bin.zip
todistributionUrl=https\://services.gradle.org/distributions/gradle-7.3-bin.zip
.