Issue
So, I'm using Flutter and on running the App, I receive errors like these in the debug console:
Warning: Mapping new ns http://schemas.android.com/repository/android/common/02 to old ns http://schemas.android.com/repository/android/common/01
I did flutter clean
, but no effect.
I tried the answer here: How to change build tools version in Android Studio
But, when I look for build.gradle file, I have two files one in /android and another in /android/app. But both of these do not have any configuration to change buildToolsVersion
.
I did sdkmanager --list_installed
and I hae two build-tools versions:
build-tools;29.0.2 | 29.0.2 | Android SDK Build-Tools 29.0.2 | build-tools/29.0.2
build-tools;30.0.2 | 30.0.2 | Android SDK Build-Tools 30.0.2 | build-tools/30.0.2
What should I do to fix this Warning ?
Also, I am not using Android Studio. I used this guide to install Flutter without Android Studio: How to Install and Configure Flutter Without Android Studio
Solution
Try deleting and reinstalling the SDK platforms. Delete the folders in ~\Android\Sdk\platforms and download the SDKs you need.
Edit: The above somehow resolved the issue before, but I ran into the same problem again when more external packages were updated. This time, deleting the SDK platforms didn't work. Instead, I updated Gradle in two locations in my project:
android/build.gradle
buildscript {
repositories {
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.2.1' // Update this line
...
}
}
Note: 7.2.1 for the Android Gradle Plugin is the latest stable release present at this time in Google's Maven repository. To check for newer versions, visit https://maven.google.com, or the release notes. Under com.android.tools.build > gradle you will find the versions available for Android.
android/gradle/wrapper/gradle-wrapper.properties
...
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-all.zip # Update this line
Updating the plugin in these two spots resolved the issue for me this time. Hope this helps.
Answered By - Leviticus
Answer Checked By - Willingham (JavaFixing Volunteer)