Exception: Unsupported Android Plugin version: 4.1.2

Viewed 19084

I know this might have been asked before, I have recently installed Solus Linux on my computer and I am trying to get Andoird Studio working on it for some time, so far I am not having any luck. First Issue - I am not able to add Flutter to the PATH Second Issue - I am getting this error when running the project enter image description here

Could somebody here help me with both issues?

6 Answers

Maybe it can help future devs. I had similar problem with the exception

Unsupported Android Plugin version 4.1.3

In my case I had to specify build flavor for the app:

flutter run --flavor <flavor-name>

then it worked

I think at the moment, there is a problem of incompatible version.

Reference: from this thread

To fix it, I revert back Android Plugin from 4.1.2 to 4.1.0.

Modify the root build.gradle:

buildscript {
  ext.kotlin_version = '1.4.20'
  repositories {
    google()
    jcenter()
}

dependencies {
    classpath 'com.android.tools.build:gradle:4.1.0'
    classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
    ...
  }
}

Note: I, currently, use Gradle 6.7

enter image description here

Doing this solved my problem

  • Added dev as Build flavor
  • Added --debug as Additional build args

In my case, I had to edit my configuration settings:

  1. go to "Edit configurations"
  2. choose the config you're trying to run
  3. fill in the "Build flavor" accordingly

Worked for me

if your are performing integration test in flutter with flavors then you should run this command to test flutter drive --flavor dev \ --driver=test_driver/integration_driver.dart \ --target=integration_test/login_page/login_integration_test.dart

For me, it was about the flavor configuration. I have main, develop, and production flavors I haven't set up configuration for main so when main is selected this error is happened

Related