Reputation: 320
When i run emulator i get this error. I've been struggling for an hour and couldn't figure it out. It started after the new update came. Will it be fixed with the new update or is there a way to fix it? Also would ignoring this error and making an app cause problems?
And last one this part is changed. I used to be able to adjust the versions, now it gives an error when it changes. I mean min and target SDK versions.
defaultConfig {
minSdkVersion flutter.minSdkVersion
targetSdkVersion flutter.targetSdkVersion
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
}
Warning: Mapping new ns http://schemas.android.com/repository/android/common/02 to old ns http://schemas.android.com/repository/android/common/01 Warning: Mapping new ns http://schemas.android.com/repository/android/generic/02 to old ns http://schemas.android.com/repository/android/generic/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/02 to old ns http://schemas.android.com/sdk/android/repo/addon2/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/02 to old ns http://schemas.android.com/sdk/android/repo/repository2/01 Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/02 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01
Upvotes: 3
Views: 3202
Reputation: 51
1. Clean your project
Run flutter clean
command and make sure <project>/build
folder and <project>/android/build
is deleted.
2. Update gradle.properties
Got to gradle-wrapper.properties
file located at <project>/android/gradle
, then set value to distributionUrl
to whatever latest gradle distribution is available, https://services.gradle.org/distributions/gradle-7.4-bin.zip
3. Update project build.gradle
Update your android build.gradle
file located at <project>/android/build.gradle
with new version of Gradle and Kotlin available at this time.
classpath 'com.android.tools.build:gradle:7.1.1' and ext.kotlin_version = '1.6.10'
4. Final Step
Run flutter packages get
command in terminal, then run your flutter app first it may take more time as IDE downloads new files.
Hopefully It helped you
Upvotes: 1
Reputation: 10519
Check the build tools version in the Android module of the Flutter project. It's possible that the version being used doesn't match with build tools installed. What you can do here is bump the build tools version that you're using. To do this, you can navigate to the android
build folder and open the project-level build.gradle, from there check the version configured and update.
dependencies {
classpath 'com.android.tools.build:gradle:4.1.3'
...
}
Upvotes: 0