Is there an existing issue?
Build info
- ObjectBox version: 5.4.1
- OS: Windows 11
- Device/ABI/architecture: Android (minSdk 28, targetSdk 36)
Steps to reproduce
- Create an Android project with AGP 9.1.1, Gradle 9.3.1, Kotlin 2.2.10
- Add ObjectBox via
buildscript classpath in root build.gradle.kts and apply id("io.objectbox") in the app module
- Annotate a Kotlin data class with
@Entity and @Id
- Sync Gradle and build the project
Expected behavior
MyObjectBox is generated in build/generated/source/objectbox/ and is importable as com.package.name.MyObjectBox.
Actual behavior
MyObjectBox is never generated. No objectbox-models/default.json schema file is created either. The build completes without errors but the code generation step does not run.
Code
Code
// root build.gradle.kts
buildscript {
dependencies {
classpath("io.objectbox:objectbox-gradle-plugin:5.4.1")
}
}
plugins {
alias(libs.plugins.android.application) apply false
alias(libs.plugins.kotlin.compose) apply false
alias(libs.plugins.hilt) apply false
alias(libs.plugins.ksp) apply false
alias(libs.plugins.kotlin.serialization) apply false
}
// app/build.gradle.kts
plugins {
alias(libs.plugins.android.application)
alias(libs.plugins.kotlin.compose)
alias(libs.plugins.hilt)
alias(libs.plugins.ksp)
alias(libs.plugins.kotlin.serialization)
id("io.objectbox")
}
android {
namespace = "name_space"
compileSdk {
version = release(36) { minorApiLevel = 1 }
}
defaultConfig {
applicationId = "app_id"
minSdk = 28
targetSdk = 36
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
}
// settings.gradle.kts
pluginManagement {
repositories {
google {
content {
includeGroupByRegex("com\\.android.*")
includeGroupByRegex("com\\.google.*")
includeGroupByRegex("androidx.*")
}
}
mavenCentral()
gradlePluginPortal()
}
}
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
}
}
# gradle/libs.versions.toml
[versions]
agp = "9.1.1"
kotlin = "2.2.10"
ksp = "2.2.10-2.0.2"
// UserEntity.kt
@Entity
data class UserEntity(
@Id var id: Long = 0,
.
.
)
</details>
Logs, stack traces
<details><summary>Logs</summary>
</details>
Is there an existing issue?
Build info
Steps to reproduce
buildscriptclasspath in rootbuild.gradle.ktsand applyid("io.objectbox")in the app module@Entityand@IdExpected behavior
MyObjectBoxis generated inbuild/generated/source/objectbox/and is importable ascom.package.name.MyObjectBox.Actual behavior
MyObjectBoxis never generated. Noobjectbox-models/default.jsonschema file is created either. The build completes without errors but the code generation step does not run.Code
Code