Mapping new ns http://schemas.android.com/repository/android/common/02 to old ns解决方法

佘缪文
2023-12-01

在运行Flutter应用程序时,调试控制台中打印了如下错误:

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/addon2/03 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/repository2/03 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/03 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/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

上述错误是,将新 ns 映射到旧 ns,可以尝试删除并重新安装 SDK 平台。根本的解决方案是升级gradle。首先,打开gradle-wrapper.properties,修改gradle版本。

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

然后,再修改android/build.gradle。

dependencies {
    classpath 'com.android.tools.build:gradle:7.0.4'
}
 类似资料: