So Everytime i try to sync my gradle files , i get this error Namespace not specified. Specify a namespace in the module's build file. See https://d.android.com/r/tools/upgrade-assistant/set-namespace for information about setting the namespace.
If you've specified the package attribute in the source AndroidManifest.xml, you can use the AGP Upgrade Assistant to migrate to the namespace value in the build file. Refer to https://d.android.com/r/tools/upgrade-assistant/agp-upgrade-assistant for general information about using the AGP Upgrade Assistant.
I have already upgraded my gradle to 8.2.0 and I still get this error. This is my project level gradle:
buildscript {
dependencies {
classpath("com.google.gms:google-services:4.4.1")
}
}
// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
id("com.android.application") version "8.2.0"
id("org.jetbrains.kotlin.android") version "1.9.22"
id("com.google.gms.google-services") version "4.4.1" apply false
}
and this is my module level gradle:
plugins {
id("com.android.application")
id("org.jetbrains.kotlin.android")
id("com.google.gms.google-services")
kotlin("plugin.serialization") version "1.9.22"
}
android {
namespace = "com.example.prosubscriberapp"
compileSdk = 34
defaultConfig {
applicationId = "com.example.prosubscriberapp"
minSdk = 26
targetSdk = 34
versionCode = 1
versionName = "1.0"
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables {
useSupportLibrary = true
}
}
buildTypes {
release {
isMinifyEnabled = false
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
)
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = "1.8"
}
buildFeatures {
compose = true
}
composeOptions {
kotlinCompilerExtensionVersion = "1.5.1"
}
packaging {
resources {
excludes += "/META-INF/{AL2.0,LGPL2.1}"
}
}
}
val exposedLibraryVersion: String by project
val h2LibraryVersion: String by project
dependencies {
implementation("androidx.core:core-ktx:1.12.0")
implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.7.0")
implementation("androidx.activity:activity-compose:1.8.2")
implementation(platform("androidx.compose:compose-bom:2023.08.00"))
implementation("androidx.compose.ui:ui")
implementation("androidx.compose.ui:ui-graphics")
implementation("androidx.compose.ui:ui-tooling-preview")
implementation("androidx.compose.material3:material3")
implementation ("io.ktor:ktor-server-netty:2.3.7")
implementation ("io.ktor:ktor-serialization:2.3.7")
implementation ("mysql:mysql-connector-java:8.0.23")
implementation("io.ktor:ktor-jackson:1.6.5")
implementation ("io.ktor:ktor-server-core:2.3.7")
implementation ("io.ktor:ktor-server-netty:2.3.7")
implementation ("io.ktor:ktor-gson:2.3.7")
implementation ("io.ktor:ktor-server-core:2.3.7")
implementation ("io.ktor:ktor-server-netty:2.3.7")
implementation ("io.ktor:ktor-locations:2.3.7")
implementation ("io.ktor:ktor-features:2.3.7")
implementation("com.google.apis:google-api-services-gmail:v1-rev110-1.31.0")
implementation("com.google.api-client:google-api-client:1.31.0")
implementation("com.google.oauth-client:google-oauth-client-jetty:1.31.0")
implementation("com.google.apis:google-api-services-gmail:v1-rev110-1.31.0")
implementation ("io.ktor:ktor-gson:1.7.4")
implementation ("javax.sql:javax.sql-api:2.0.1")
implementation ("org.jetbrains.exposed:exposed:0.33.2")
implementation ("org.jetbrains.exposed:exposed-java-time:0.36.2")
implementation("org.jetbrains.exposed:exposed-java-time:0.36.2")
implementation("com.google.firebase:proto-lite-well-known-types:18.0.0")
implementation ("mysql:mysql-connector-java:8.0.23")
implementation ("org.jetbrains.exposed:exposed-core:0.41.1")
implementation ("org.jetbrains.exposed:exposed-dao:0.41.1")
implementation ("org.jetbrains.exposed:exposed-jdbc:0.41.1")
implementation ("org.jetbrains.exposed:exposed:0.33.2")
implementation ("org.jetbrains.exposed:exposed-java-time:0.36.2")
implementation("org.jetbrains.exposed:exposed-java-time:0.36.2")
implementation ("org.jetbrains.exposed:exposed-java-time:0.36.2")
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.9.22")
implementation("org.jetbrains.exposed:exposed-core:0.41.1")
implementation("org.jetbrains.exposed:exposed-dao:0.41.1")
implementation("org.jetbrains.exposed:exposed-jdbc:0.41.1")
implementation("org.jetbrains.exposed:exposed-java-time:0.36.2")
implementation("org.jetbrains.exposed:exposed-core:0.41.1")
implementation("org.jetbrains.exposed:exposed-dao:0.41.1")
implementation("org.jetbrains.exposed:exposed-jdbc:0.41.1")
implementation("mysql:mysql-connector-java:8.0.23")
implementation("com.h2database:h2:2.1.214")
implementation("com.jakewharton.threetenabp:threetenabp:1.3.7")
implementation ("org.jetbrains.kotlinx:kotlinx-serialization-core:1.6.3")
implementation("org.apache.mahout:mahout-math:0.13.0")
implementation("org.apache.mahout:mahout-cf:0.14.0")
implementation ("org.apache.commons:commons-lang3:3.12.0")
implementation("org.apache.mahout:mahout-cf:0.14.0") // Adjust the version according to your Mahout version
implementation ("org.apache.commons:commons-lang3:3.12.0")
implementation ("org.apache.commons:commons-text:1.9")
implementation ("io.github.pickle4j:pickle4j:1.3.0")
implementation ("org.apache.mahout:mahout-cf:0.14.0")
implementation ("org.apache.commons:commons-csv:1.8")
implementation ("io.reactivex.rxjava3:rxjava:3.0.0")
implementation ("io.reactivex.rxjava3:rxandroid:3.0.0")
implementation ("commons-io:commons-io:2.11.0")
implementation("io.ktor:ktor-client-core:1.7.4")
implementation("io.ktor:ktor-client-json-jvm:1.7.4")
implementation("io.ktor:ktor-client-serialization-jvm:1.9.22")
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.9.22")
implementation("io.ktor:ktor-client-content-negotiation:1.9.22")
implementation("io.ktor:ktor-serialization-kotlinx-json:1.9.22")
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.6.3")
implementation(platform("com.google.firebase:firebase-bom:32.7.2"))
implementation("com.google.firebase:firebase-analytics")
implementation("com.google.firebase:firebase-messaging:23.4.1")
implementation("io.ktor:ktor-server-core-jvm:2.3.7")
testImplementation("junit:junit:4.13.2")
androidTestImplementation("androidx.test.ext:junit:1.1.5")
androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1")
androidTestImplementation(platform("androidx.compose:compose-bom:2023.08.00"))
androidTestImplementation("androidx.compose.ui:ui-test-junit4")
debugImplementation("androidx.compose.ui:ui-tooling")
debugImplementation("androidx.compose.ui:ui-test-manifest")
}
This error started happening when I was trying to import JSON serialisation as I am unable to get the ContentNegotiation imports (just context)
I tried to change the imports around but It still gives me the error.How do I get my gradle files to sync and not cause this error?