导入module报错Namespace not specified. Please specify a namespace in the module‘s build.gradle file like

标题 导入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的同款

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

猜你喜欢

转载自blog.csdn.net/qq_29862247/article/details/131088532