0

I try this one when I try to "sync project with gradle files" a warning pops up but I can't find buildToolsVersion

and I try to search for solution for fix this problem the other is download gradle but I can't install anywhere

then please help me to fix this problem thankyou for your kindness

https://www.img.in.th/image/PQZxbH

2 Answers2

0

ensure your sdk version and build version match up, I had the same issues because my build version in android/app/build.gradle targetSDKVersion wasn't the same as my sdk version in my emulator. I now have them both set to 30 and this went away

flutterloop
  • 546
  • 3
  • 15
0

It might be a little bit late for you but I write a solution for this problem for those who have the same problem:

  1. Go to android/gradle/wrapper/gradle-wrapper.properties and add the replace the distributionUrl=.... with the following line:

distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip

  1. Go to android/build.gradle and replace the com.android.tools.build line with the following:

buildscript { dependencies { classpath 'com.android.tools.build:gradle:7.1.1' } }

  1. Go to android/app/build.gradle and update the android/app/build.gradle. For example:

    android { compileSdkVersion 31}

  2. run flutter clean in the terminal.

This solves the Mapping new ns Problem, but in the future you might want to upgrade your gradle build tools version, compiled SDK Version or gradle version, so these version numbers can be changed but AGP and Gradle versions have to be compatible. here you find which Android Gradle Plugin Version is compatible with which Gradle Version.

moonkin
  • 353
  • 1
  • 10