I'm starting to learn flutter development. When I run the project for the first time it gives this error.
I've reinstalled android studio and flutter and dart plugins and create new project .
* What went wrong: Could not apply requested plugin [id: 'dev.flutter.flutter-plugin-loader', version: '1.0.0'] as it does not provide a plugin with id 'dev.flutter.flutter-plugin-loader'. This is caused by an incorrect plugin implementation. Please contact the plugin author(s).
> Plugin with id 'dev.flutter.flutter-plugin-loader' not found.
In my case I got the same error after following the migration guide here
The issue was an outdated version of gradle in android/gradle/wrapper/gradle-wrapper.properties. After setting the distribution url to 8.5 it worked. Do the change inside visual Studio in order to better handle the gradle migration.
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-all.zip
I tried many ways but non worked, so after that I simply followed flutter instructions that say , and I will do it in steps :
first in settings.gradle add below code:-
pluginManagement {
def flutterSdkPath = {
def properties = new Properties()
file("local.properties").withInputStream { properties.load(it) }
def flutterSdkPath = properties.getProperty("flutter.sdk")
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
return flutterSdkPath
}()
includeBuild("$flutterSdkPath/packages/flutter_tools/gradle")
repositories {
google()
mavenCentral()
gradlePluginPortal()
}
}
plugins {
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
id "com.android.application" version "7.3.0" apply false
id "org.jetbrains.kotlin.android" version "1.7.10" apply false
}
include ":app"
second in android/build.gradle :- make it simple without any dependancies like this
allprojects {
repositories {
google()
mavenCentral()
}
}
third add these plugins in app build.gradle
plugins {
id "com.android.application"
id "kotlin-android"
// The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins.
id "dev.flutter.flutter-gradle-plugin"
}
hope my answer can help somebody someday
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With