Unsuported Android Plugin version: 3.5.3. After upgrading flutter 1.12.13+hotfix.5-ThrowExceptions

Exception or error:

I have upgraded the flutter to 1.12.13+hotfix.5 and after that I am getting the error Unsuported Android Plugin version: 3.5.3.

When I downgrade the gradle build to 3.5.2, 3.5.1, 3.5.0+, it shows below error:

Finished with error: Gradle build failed to produce an .apk file. It’s likely that this file was generated under C:\Users\TiwariA\Documents\X-Project\build, but the tool couldn’t find it.

Below is the screenshot of flutter doctor result:

enter image description here

Getting below warnings in Console

Note: C:\Users\TiwariA\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\package_info-0.4.0+13\android\src\main\java\io\flutter\plugins\packageinfo\PackageInfoPlugin.java uses or overrides a deprecated API.

Note: Recompile with -Xlint:deprecation for details.

Note: C:\Users\TiwariA\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\device_info-0.4.1+4\android\src\main\java\io\flutter\plugins\deviceinfo\DeviceInfoPlugin.java uses or overrides a deprecated API.

Note: Recompile with -Xlint:deprecation for details.

Note: C:\Users\TiwariA\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\firebase_core-0.4.3+1\android\src\main\java\io\flutter\plugins\firebase\core\FirebaseCorePlugin.java uses or overrides a deprecated API.

Note: Recompile with -Xlint:deprecation for details.

Note: Some input files use or override a deprecated API.

Note: Recompile with -Xlint:deprecation for details.

Note: C:\Users\TiwariA\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\cloud_firestore-0.13.0+1\android\src\main\java\io\flutter\plugins\firebase\cloudfirestore\CloudFirestorePlugin.java uses unchecked or unsafe operations.

Note: Recompile with -Xlint:unchecked for details.

Note: C:\Users\TiwariA\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\firebase_messaging-6.0.9\android\src\main\java\io\flutter\plugins\firebasemessaging\FirebaseMessagingPlugin.java uses or overrides a deprecated API.

Note: Recompile with -Xlint:deprecation for details.

Note: Some input files use unchecked or unsafe operations.

Note: Recompile with -Xlint:unchecked for details.

Note: Some input files use or override a deprecated API.

Note: Recompile with -Xlint:deprecation for details.

Note: Some input files use unchecked or unsafe operations.

Note: Recompile with -Xlint:unchecked for details.

Note: C:\Users\TiwariA\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\path_provider-1.5.1\android\src\main\java\io\flutter\plugins\pathprovider\PathProviderPlugin.java uses or overrides a deprecated API.

Note: Recompile with -Xlint:deprecation for details.
C:\Users\TiwariA\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\shared_preferences-0.5.6\android\src\main\java\io\flutter\plugins\sharedpreferences\SharedPreferencesPlugin.java:25: warning: [deprecation] getFlutterEngine() in FlutterPluginBinding has been deprecated
setupChannel(binding.getFlutterEngine().getDartExecutor(), binding.getApplicationContext());
^
1 warning
Note: Some input files use or override a deprecated API.

Note: Recompile with -Xlint:deprecation for details.

Note: Some input files use or override a deprecated API.

Note: Recompile with -Xlint:deprecation for details.

Finished with error: Unsuported Android Plugin version: 3.5.3.

How to solve:

I’ve encountered the same issue.

It is weired but it was because if define productFlavors in my app/build.gradle and not passing --flavor to flutter run. (eg. flutter run --flavor myApp

After adding it it worked for me…

###

I got the same issue, resolved by removing source folder and cloning again. I tried every git clean up commands but none of them worked until completely removing and cloning again.

###

This question is not that old, but I have a better solution that the proposed solution. Yes, I believe that the problem the OP is running into is the productFlavors problem. However my solution is a bit more automated/future-proof. Android Studio actually provides a way for you to supply the android flavor, as long as you have an updated flutter plugin. Here is how:

  1. Open your flutter project.

  2. Open the Run menu

  3. Select ‘Edit Configurations…’
    Shows Run menu with an arrow pointing to Edit Configurations

  4. In the Edit Configurations screen, select the Flutter -> main.dart configuation (or whichever config you want to edit) from the left side panel

  5. In the right panel, where you edit the settings, you will see a field called ‘Build flavor:’. Type in the name of your flavor and hit ‘OK’
    Edit Configurations screen, with an arrow pointing to Build flavors field

I really hope this helps someone.

###

In my case,I changed the name of the debug apk which cause this problem.
Delete the following code then successed.

applicationVariants.all { variant ->
    variant.outputs.all {
        if (variant.buildType.name == "release") {
            outputFileName = "....apk"
        } else {
            outputFileName = "${defaultConfig.versionName}.apk" //delete this code
        }
    }
}

Leave a Reply

Your email address will not be published. Required fields are marked *