Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keep getting "Unsupported Android Plugin version: 3.5.3" error on build #51329

Closed
BradyEdgar94 opened this issue Feb 24, 2020 · 5 comments
Closed

Comments

@BradyEdgar94
Copy link

I am trying to install a Flutter app that another team has been working on for a few weeks and can't get it to run on a simulator for the life of me. I've looked into every issue thread regarding the "Unsupported Android Plugin version: 3.5.3" error for Flutter and still can't fix it. It seems like no matter what changes I make, the error always pops up.

I have update the /android/build.gradle file to use the 3.4.2 version but I still get an error for the 3.5.3 plugin.

dependencies {
  // classpath 'com.android.tools.build:gradle:3.5.3'
  classpath 'com.android.tools.build:gradle:3.4.2'

I have also re-cloned the app, ran update and clean commands but nothing is working. I have also followed the docs from Android and the same problem. No matter what I try I see no improvements or changes.

If anyone has an idea of what us happening, that would be great.

I have also re-installed Android Studio and same issue

@Zazo032
Copy link
Contributor

Zazo032 commented Feb 24, 2020

What version of Android Studio do you have installed? Also, could you provide the output of `flutter doctor -v?

@TahaTesser TahaTesser added the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Feb 24, 2020
@BradyEdgar94
Copy link
Author

@Zazo032 My version of Android Studio is 3.5.3, I did a fresh install to ensure I had an up to date version. Also my flutter doctor response is the following(everything passes):

Bradys-MacBook-Pro-2:Loop-flutter bradyedgar$ flutter doctor -v
[✓] Flutter (Channel stable, v1.12.13+hotfix.8, on Mac OS X 10.15.1 19B88, locale en-NZ)
    • Flutter version 1.12.13+hotfix.8 at /Users/bradyedgar/App_Development/flutter
    • Framework revision 0b8abb4724 (13 days ago), 2020-02-11 11:44:36 -0800
    • Engine revision e1e6ced81d
    • Dart version 2.7.0
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
    • Android SDK at /Users/bradyedgar/Library/Android/sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-29, build-tools 29.0.3
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)
    • All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 11.3)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 11.3, Build version 11C29
    • CocoaPods version 1.8.4
[✓] Android Studio (version 3.5)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 43.0.1
    • Dart plugin version 191.8593
    • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)
[✓] Connected device (1 available)
    • Android SDK built for x86 • emulator-5554 • android-x86 • Android 10 (API 29) (emulator)
• No issues found!

@no-response no-response bot removed the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Feb 24, 2020
@BradyEdgar94
Copy link
Author

Figured it out, turns out there was a missing Gradle flavor I didn't know about. Below is a documentation snippet of how I fixed it from my readme file.

Error: Unsupported Android Plugin version: 3.5.3. flutter

You may encounter this error when running the app for the first time on your Android Simulator. This error seems to be related to using version 3.5.0 or higher for the Android Gradle plugin.

Versioning

First make sure you are using the correct Gradle version for your plugin. If your plugin is 3.5.0 or higher, you must use Gradle version 6.0.1+. You can learn more about updating the Android Gradle plugin here.
You can find your configured Gradle version in the /android/gradle/wrapper/gradle-wrapper.properties file. Make sure the version is 6.0.1 or higher

distributionUrl=https\://services.gradle.org/distributions/gradle-6.0.1-all.zip

After that make sure you are also using the correct plugin version, you can check the version you are using in the /android/build.gradle file. Make sure your plugin version is compatible with your Gradle version. You can update the version on the following line.

classpath 'com.android.tools.build:gradle:3.5.0'
Flavors

You will also need to update the Gradle flavor which can be done by going into Android Studio and where you see the main.dart dropdown at the top of the window.

  • click edit configurations
  • Where you see build flavor: enter in stage
    After that be sure to clean your project with the following commands
flutter clean
flutter pub cache repair

After that run flutter with the --flavor 'stage' flag and you should have fixed the issue.

flutter run --flavor 'stage'

@ArtfulDodgerB92
Copy link

Figured it out, turns out there was a missing Gradle flavor I didn't know about. Below is a documentation snippet of how I fixed it from my readme file.

Error: Unsupported Android Plugin version: 3.5.3. flutter

You may encounter this error when running the app for the first time on your Android Simulator. This error seems to be related to using version 3.5.0 or higher for the Android Gradle plugin.

Versioning

First make sure you are using the correct Gradle version for your plugin. If your plugin is 3.5.0 or higher, you must use Gradle version 6.0.1+. You can learn more about updating the Android Gradle plugin here.
You can find your configured Gradle version in the /android/gradle/wrapper/gradle-wrapper.properties file. Make sure the version is 6.0.1 or higher

distributionUrl=https\://services.gradle.org/distributions/gradle-6.0.1-all.zip

After that make sure you are also using the correct plugin version, you can check the version you are using in the /android/build.gradle file. Make sure your plugin version is compatible with your Gradle version. You can update the version on the following line.

classpath 'com.android.tools.build:gradle:3.5.0'
Flavors

You will also need to update the Gradle flavor which can be done by going into Android Studio and where you see the main.dart dropdown at the top of the window.

  • click edit configurations
  • Where you see build flavor: enter in stage
    After that be sure to clean your project with the following commands
flutter clean
flutter pub cache repair

After that run flutter with the --flavor 'stage' flag and you should have fixed the issue.

flutter run --flavor 'stage'

Following the above advice results in:

The android/app/build.gradle file does not define any custom product flavors. You cannot use the --flavor option.

Think you might be missing an important step here. Do we need to include anything in the build.gradle file?

@lock
Copy link

lock bot commented Apr 25, 2020

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

@lock lock bot locked and limited conversation to collaborators Apr 25, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants