【问题标题】:In Android Studio Giving Warning of Mapping New ns to old ns在 Android Studio 中警告将新 ns 映射到旧 ns
【发布时间】:2021-11-17 13:57:09
【问题描述】:

当我尝试运行应用程序或重新构建它时,出现以下错误。

(我正在尝试在新的 Android Studio 和 SDK 中运行或重建旧项目)

警告:将新 ns http://schemas.android.com/repository/android/common/02 映射到旧 ns http://schemas.android.com/repository/android/common/01 警告:将新 ns http://schemas.android.com/repository/android/generic/02 映射到旧 ns http://schemas.android.com/repository/android/generic/01 警告:将新 ns http://schemas.android.com/sdk/android/repo/addon2/02 映射到旧 ns http://schemas.android.com/sdk/android/repo/addon2/01 警告:将新 ns http://schemas.android.com/sdk/android/repo/repository2/02 映射到旧 ns http://schemas.android.com/sdk/android/repo/repository2/01 警告:将新 ns http://schemas.android.com/sdk/android/repo/sys-img2/02 映射到旧 ns http://schemas.android.com/sdk/android/repo/sys-img2/01

我的构建 Gradle 如下所示;

apply plugin: 'com.android.application'

android {
    compileSdkVersion 30
    buildToolsVersion '30.0.2'
    defaultConfig {
        applicationId "com.etas.etas"
        minSdkVersion 16
        targetSdkVersion 30
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    //noinspection GradleDependency
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation files('libs/jtds-1.2.7.jar')
    implementation files('libs/ksoap.jar')
    implementation 'com.android.support:appcompat-v7:30.2'
    implementation 'androidx.appcompat:appcompat:1.3.1'
    implementation 'com.android.support:design:30.2'
    implementation 'com.google.firebase:firebase-appindexing:20.0.0'
    implementation 'com.android.support:support-v4:30.2'
}

`

【问题讨论】:

标签: android android-studio


【解决方案1】:

尝试将您的 Gradle 插件升级到最新版本。

  1. 转到path/to/your/flutter_app/android/build.gradle 并在 buildscript 中的依赖项块,您必须更新旧的 将 Gradle 构建到最新版本。
  2. 还将path/to/your/flutter_app/android/gradle/wrapper/gradle-wrapper.properties 文件中的 Gradle distributionUrl 更新为您更新到的相同版本
  3. 使用flutter clean清理你的flutter项目
  4. 再次运行您的项目

【讨论】:

    【解决方案2】:

    尝试删除并重新安装 SDK 平台。

    删除文件夹

    如果您是 Linux 用户:

     ~/Android/Sdk/platforms
    

    如果您是 Windows 用户:

    C:\Users\USERNAME\AppData\Local\Android\Sdk
    

    并下载您需要的 SDK。

    【讨论】:

    • 我是 Windows 用户。我删除并安装了 SDK 平台。但结果是一样的。问题没有解决。
    • 更多信息:我正在尝试在新的 Android Studio 和 SDK 中运行或重建旧项目
    猜你喜欢
    • 2021-06-17
    • 2021-10-06
    • 2021-08-11
    • 2021-10-17
    • 2022-07-14
    • 2022-10-25
    • 2021-10-27
    • 2021-10-22
    • 1970-01-01
    相关资源
    最近更新 更多