Skip to content Skip to sidebar Skip to footer

Could Not Create An Instance Of Type Org.gradle.invocation.defaultgradle

I'm unable to build and run my flutter project. Every time I run the project it gives me this error FAILURE: Build failed with an exception. What went wrong: Could not create an

Solution 1:

I tried many solutions but the following worked for me:

  1. Downgraded flutter version from 2.2.3 to 2.2.2
  2. Deleted ~/.android folder and then run the flutter project. Everything worked just fine.

Solution 2:

I am use Flutter 2.5, same issue.

set ./android/build.gradle file to newer version:

classpath 'com.android.tools.build:gradle:7.0.0'

buildscript {
ext.kotlin_version = '1.3.50'
repositories {
    google()
    mavenCentral()
}

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

}

Post a Comment for "Could Not Create An Instance Of Type Org.gradle.invocation.defaultgradle"