Sumchans
Sumchans

Reputation: 3784

Exception: Unsupported Android Plugin version: 4.1.2

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?

Upvotes: 27

Views: 28839

Answers (7)

Andres AC
Andres AC

Reputation: 3

In my case, I solved it by changing the "splits" property to enable = false, in the build.gradle. When we release to production that property is set to true, so i just forgot to set it on false again.

Should be something like this:

splits {
        // Configures multiple APKs based on ABI.
        abi {
            // Enables building multiple APKs per ABI.
            enable false

            // Resets the list of ABIs that Gradle should create APKs for to none.
            reset()

            // Specifies a list of ABIs that Gradle should create APKs for.
            include 'arm64-v8a', 'armeabi-v7a'

            // Specifies that we do not want to also generate a universal APK that includes all ABIs.
            universalApk false
        }
    }

Upvotes: 0

Elias Ayele
Elias Ayele

Reputation: 67

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

Upvotes: 0

Rohit Sainik
Rohit Sainik

Reputation: 561

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

Upvotes: 0

ArtemNovikov
ArtemNovikov

Reputation: 343

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

Upvotes: 1

Rishabh Anand
Rishabh Anand

Reputation: 177

enter image description here

Doing this solved my problem

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

Upvotes: 11

winqoo
winqoo

Reputation: 961

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

Upvotes: 89

T&#244; Minh Tiến
T&#244; Minh Tiến

Reputation: 1177

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

Upvotes: 10

Related Questions