Fixed
Status Update
Comments
da...@gmail.com <da...@gmail.com> #2
Can you share your Gradle build file and how room-compiler
is being setup? The error is indicating that the Room processor likely did not run which in turns means the generated implementation of the database was not created and can't be found.
cu...@google.com <cu...@google.com>
ap...@google.com <ap...@google.com> #3
This is my gradle file. I need to re -explain it runs well in Android, iOS, and Desktop's debug.It only crash when runRelease on desktop.
import org.jetbrains.compose.desktop.application.dsl.TargetFormat
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.tasks.KotlinCompilationTask
plugins {
alias(libs.plugins.kotlinMultiplatform)
alias(libs.plugins.androidApplication)
alias(libs.plugins.composeMultiplatform)
alias(libs.plugins.composeCompiler)
alias(libs.plugins.kotlinCocoapods)
alias(libs.plugins.googleKsp)
alias(libs.plugins.kotlinSerialization)
alias(libs.plugins.androidxRoom)
}
kotlin {
androidTarget {
compilerOptions {
jvmTarget.set(JvmTarget.JVM_11)
}
}
iosX64()
iosArm64()
iosSimulatorArm64()
cocoapods {
summary = "Some description for the Shared Module"
homepage = "Link to the Shared Module homepage"
version = "1.0"
ios.deploymentTarget = "13.0"
podfile = project.file("../iosApp/Podfile")
framework {
baseName = "ComposeApp"
isStatic = true
}
}
jvm("desktop")
sourceSets {
val desktopMain by getting
androidMain.dependencies {
implementation(compose.preview)
implementation(libs.androidx.activity.compose)
}
commonMain.dependencies {
implementation(compose.runtime)
implementation(compose.foundation)
implementation(compose.material3)
implementation(compose.ui)
implementation(compose.components.resources)
implementation(compose.components.uiToolingPreview)
implementation(libs.androidx.lifecycle.viewmodel)
implementation(libs.androidx.lifecycle.runtime.compose)
implementation(libs.androidx.navigation)
// Serialization
implementation(libs.kotlinx.serialization.json)
// Room
implementation(libs.androidx.room.runtime)
implementation(libs.androidx.sqlite.bundled)
}
desktopMain.dependencies {
implementation(compose.desktop.currentOs)
implementation(libs.kotlinx.coroutines.swing)
}
}
}
android {
namespace = "xxx"
compileSdk = libs.versions.android.compileSdk.get().toInt()
defaultConfig {
applicationId = "xxx"
minSdk = libs.versions.android.minSdk.get().toInt()
targetSdk = libs.versions.android.targetSdk.get().toInt()
versionCode = 1
versionName = "1.0"
}
packaging {
resources {
excludes += "/META-INF/{AL2.0,LGPL2.1}"
}
}
buildTypes {
getByName("release") {
isMinifyEnabled = false
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
}
dependencies {
debugImplementation(compose.uiTooling)
}
compose.desktop {
application {
mainClass = "xxx.MainKt"
nativeDistributions {
targetFormats(TargetFormat.Dmg, TargetFormat.Msi, TargetFormat.Deb)
packageName = "xxx"
packageVersion = "1.0.0"
}
}
}
dependencies {
kspCommonMainMetadata(libs.koin.ksp.compiler)
listOf(
"kspAndroid",
"kspDesktop",
"kspIosX64",
"kspIosArm64",
"kspIosSimulatorArm64"
).forEach {
add(it, libs.androidx.room.compiler)
}
}
project.tasks.withType(KotlinCompilationTask::class.java).configureEach {
if (name != "kspCommonMainKotlinMetadata") {
dependsOn("kspCommonMainKotlinMetadata")
}
}
kotlin.sourceSets.commonMain {
kotlin.srcDir("build/generated/ksp/metadata/commonMain/kotlin")
}
room {
schemaDirectory("$projectDir/schemas")
}
Description
- A bugreport immediately after the issue occurs.
- Sample project to trigger the issue.
- A screenrecord or screenshots showing the issue (if UI related).
BUILD INFO
- Device type:
- OS version:
- Biometric library version:
STEPS TO REPRODUCE
[Be as specific as possible please]
1. Click on start button
EXPECTED RESULTS
Open Fingerprint dialog
OBSERVED RESULTS
E/AndroidRuntime: FATAL EXCEPTION: main
Process: az.sample.fingerprintchecher, PID: 21140
java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.TextView.setVisibility(int)' on a null object reference
at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3627)
at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3667)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2901)
at android.app.ActivityThread.-wrap11(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1616)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:176)
at android.app.ActivityThread.main(ActivityThread.java:6651)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:547)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:824)
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.TextView.setVisibility(int)' on a null object reference
at androidx.biometric.FingerprintDialogFragment.onCreateDialog(FingerprintDialogFragment.java:186)
at androidx.fragment.app.DialogFragment.onGetLayoutInflater(DialogFragment.java:419)
at androidx.fragment.app.Fragment.performGetLayoutInflater(Fragment.java:1485)
at androidx.fragment.app.FragmentStateManager.createView(FragmentStateManager.java:320)
at androidx.fragment.app.FragmentManager.moveToState(FragmentManager.java:1199)
at androidx.fragment.app.FragmentManager.moveToState(FragmentManager.java:1368)
at androidx.fragment.app.FragmentManager.moveFragmentToExpectedState(FragmentManager.java:1446)
at androidx.fragment.app.FragmentManager.moveToState(FragmentManager.java:1509)
at androidx.fragment.app.BackStackRecord.executeOps(BackStackRecord.java:447)
at androidx.fragment.app.FragmentManager.executeOps(FragmentManager.java:2181)
at androidx.fragment.app.FragmentManager.executeOpsTogether(FragmentManager.java:2004)
at androidx.fragment.app.FragmentManager.removeRedundantOperationsAndExecute(FragmentManager.java:1959)
at androidx.fragment.app.FragmentManager.execPendingActions(FragmentManager.java:1861)
at androidx.fragment.app.FragmentManager.dispatchStateChange(FragmentManager.java:2641)
at androidx.fragment.app.FragmentManager.dispatchResume(FragmentManager.java:2601)
at androidx.fragment.app.FragmentController.dispatchResume(FragmentController.java:269)
at androidx.fragment.app.FragmentActivity.onResumeFragments(FragmentActivity.java:478)
at androidx.fragment.app.FragmentActivity.onPostResume(FragmentActivity.java:467)
at androidx.appcompat.app.AppCompatActivity.onPostResume(AppCompatActivity.java:204)
at android.app.Activity.performResume(Activity.java:7220)
at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3602)
at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3667)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2901)
at android.app.ActivityThread.-wrap11(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1616)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:176)
at android.app.ActivityThread.main(ActivityThread.java:6651)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:547)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:824)
NUMBER OF TIMES YOU WERE ABLE TO REPRODUCE (e.g. 3/10)