我正在使用KotlinDSL进行构建
这是应用程序级构建gradle
plugins {
id("com.android.application")
kotlin("android")
}
android {
namespace = "com.jioads.test"
compileSdk = AppConfig.compile
buildToolsVersion = AppConfig.buildToolsVersion
defaultConfig {
applicationId = (AppConfig.appId)
minSdk = AppConfig.minSdk
targetSdk = AppConfig.target
versionCode = AppConfig.versionCode
versionName = AppConfig.versionName
testInstrumentationRunner = AppConfig.androidTestInstrumentation
}
buildTypes {
getByName("release") {
isMinifyEnabled = false
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
)
}
}
viewBinding {
android.buildFeatures.viewBinding = true
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = "1.8"
}
}
dependencies {
//std lib
implementation(fileTree(mapOf("dir" to "libs", "include" to listOf("*.jar"))))
//app libs
implementation(Dependencies.appLibraries)
//test libs
testImplementation(Dependencies.testLibraries)
androidTestImplementation(Dependencies.androidTestLibraries)
implementation(project(":jio-ads-sdk"))
}
字符串
AGP版本为8.0.2 Gradle版本为8.0
我收到以下错误
Namespace not specified. Please specify a namespace in the module's build.gradle file like so:
android {
namespace 'com.example.namespace'
}
型
2条答案
按热度按时间x8diyxa71#
如果
":jio-ads-sdk"
是android模块,检查模块中是否指定了namespace。k4ymrczo2#
首先,您可以从所有Kotlingradle DSL文件中删除所有命名空间。其次,请在android manifest文件中将命名空间作为包名添加到相应的模块中。
字符串