标题 导入module报错Namespace not specified. Please specify a namespace in the module’s build.gradle file like so:

解决办法:打开导入的module的build:gradle

android {
    namespace 'com.example.XXX'
    compileSdk 33

    defaultConfig {
        applicationId "com.example.XXX"
        minSdk 16
        targetSdk 33
        versionCode 1
        versionName "1.0"

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }

    buildTypes {
        release {
          。。。
        }
    }
    compileOptions {
      。。
    }
}

dependencies {
。。。
}

把 namespace 'com.example.XXX’和 applicationId "com.example.XXX"改成被导入的project的namespace 'com.example.XXX’和 applicationId “com.example.XXX”

一般也会报版本不对,也把 compileSdk 33 targetSdk 33 minSdk 16也改成被导入的project的同款

-------------------------------------------------好记性不如烂笔头这里记一记地

Logo

旨在为数千万中国开发者提供一个无缝且高效的云端环境,以支持学习、使用和贡献开源项目。

更多推荐