skip to Main Content

You are applying Flutter’s app_plugin_loader Gradle plugin imperatively using the apply script method, which is deprecated and will be removed in a future release. Migrate to applying Gradle plugins with the declarative plugins block: https://flutter.dev/go/flutter-gradle-plugin-apply

You are applying Flutter’s main Gradle plugin imperatively using the apply script method, which is deprecated and will be removed in a future release. Migrate to applying Gradle plugins with the declarative plugins block: https://flutter.dev/go/flutter-gradle-plugin-apply
enter image description here

I want to run my flutter project

2

Answers


  1. hello please refer to this stackoverflow link

    https://stackoverflow.com/a/78044600

    this thread helped me to solve the issue

    Login or Signup to reply.
  2. You have to change in the app-src/android/build.gradle: file

    here is updated code :

    allprojects {
    repositories {
        google()
        mavenCentral()
    }
    }
    
    rootProject.buildDir = '../build'
    subprojects {
    project.buildDir = "${rootProject.buildDir}/${project.name}"
    }
    subprojects {
    project.evaluationDependsOn(':app')
    }
    
    tasks.register("clean", Delete) {
    delete rootProject.buildDir
    }
    

    and change in the app-src>/android/settings.gradle

    here is updated 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 "{agpVersion}" apply false
    id "org.jetbrains.kotlin.android" version "{kotlinVersion}" apply false
    }
    
    include ":app"
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search