pushpalroy / JetLime

A Kotlin Multiplatform library to display a timeline view. šŸ‹
https://jetlime.pushpalroy.com
MIT License
460 stars 24 forks source link

App Crashed! #27

Closed kagg886 closed 8 months ago

kagg886 commented 8 months ago

i am a beginner in jetpack compose :( this day i found this timeline widget and use it to my project, then error

stacktrace is here:

Process: com.kagg886.sylu_eoa, PID: 6115
java.lang.NoSuchMethodError: No virtual method at(Ljava/lang/Object;I)Landroidx/compose/animation/core/KeyframesSpec$KeyframeEntity; in class Landroidx/compose/animation/core/KeyframesSpec$KeyframesSpecConfig; or its super classes (declaration of 'androidx.compose.animation.core.KeyframesSpec$KeyframesSpecConfig' appears in /data/app/~~qBHPTfY6VIlRkYxnXc1QpA==/com.kagg886.sylu_eoa-Y2-Eit3cP7Btj6Y0Lvvz_Q==/base.apk)
    at androidx.compose.material3.ProgressIndicatorKt$CircularProgressIndicator$endAngle$1.invoke(ProgressIndicator.kt:371)
    at androidx.compose.material3.ProgressIndicatorKt$CircularProgressIndicator$endAngle$1.invoke(ProgressIndicator.kt:369)
    at androidx.compose.animation.core.AnimationSpecKt.keyframes(AnimationSpec.kt:649)
    at androidx.compose.material3.ProgressIndicatorKt.CircularProgressIndicator-LxG7B9w(ProgressIndicator.kt:369)
    at com.kagg886.sylu_eoa.screen.page.ClassTablePageKt.Loading(ClassTablePage.kt:174)
    at com.kagg886.sylu_eoa.ComposableSingletons$MainActivityKt$lambda-3$1.invoke(MainActivity.kt:41)
    at com.kagg886.sylu_eoa.ComposableSingletons$MainActivityKt$lambda-3$1.invoke(MainActivity.kt:26)
    at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:109)
    at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:35)
    at androidx.compose.runtime.RecomposeScopeImpl.compose(RecomposeScopeImpl.kt:192)
    at androidx.compose.runtime.ComposerImpl.recomposeToGroupEnd(Composer.kt:2556)
    at androidx.compose.runtime.ComposerImpl.skipCurrentGroup(Composer.kt:2827)
    at androidx.compose.runtime.ComposerImpl.doCompose(Composer.kt:3314)
    at androidx.compose.runtime.ComposerImpl.recompose$runtime_release(Composer.kt:3265)
    at androidx.compose.runtime.CompositionImpl.recompose(Composition.kt:938)
    at androidx.compose.runtime.Recomposer.performRecompose(Recomposer.kt:1155)
    at androidx.compose.runtime.Recomposer.access$performRecompose(Recomposer.kt:127)
    at androidx.compose.runtime.Recomposer$runRecomposeAndApplyChanges$2$1.invoke(Recomposer.kt:583)
    at androidx.compose.runtime.Recomposer$runRecomposeAndApplyChanges$2$1.invoke(Recomposer.kt:551)
    at androidx.compose.ui.platform.AndroidUiFrameClock$withFrameNanos$2$callback$1.doFrame(AndroidUiFrameClock.android.kt:41)
    at androidx.compose.ui.platform.AndroidUiDispatcher.performFrameDispatch(AndroidUiDispatcher.android.kt:109)
    at androidx.compose.ui.platform.AndroidUiDispatcher.access$performFrameDispatch(AndroidUiDispatcher.android.kt:41)
    at androidx.compose.ui.platform.AndroidUiDispatcher$dispatchCallback$1.doFrame(AndroidUiDispatcher.android.kt:69)
    at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1384)
    at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1394)
    at android.view.Choreographer.doCallbacks(Choreographer.java:1013)
    at android.view.Choreographer.doFrame(Choreographer.java:904)
    at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1366)
    at android.os.Handler.handleCallback(Handler.java:942)
    at android.os.Handler.dispatchMessage(Handler.java:99)
    at android.os.Looper.loopOnce(Looper.java:211)
    at android.os.Looper.loop(Looper.java:300)
    at android.app.ActivityThread.main(ActivityThread.java:8294)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:580)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1028)
    Suppressed: kotlinx.coroutines.internal.DiagnosticCoroutineContextException: [androidx.compose.runtime.PausableMonotonicFrameClock@f935398, androidx.compose.ui.platform.MotionDurationScaleImpl@4c317f1, StandaloneCoroutine{Cancelling}@dc2cfd6, AndroidUiDispatcher@cc9e257]

my gradle config is here:

plugins {
    id("com.android.application")
    id("org.jetbrains.kotlin.android")
}

android {
    namespace = "com.kagg886.sylu_eoa"
    compileSdk = 34

    defaultConfig {
        applicationId = "com.kagg886.sylu_eoa"
        minSdk = 28
        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}"
        }
    }
}

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("androidx.lifecycle:lifecycle-viewmodel-compose:2.7.0")
    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")
    implementation("androidx.navigation:navigation-compose:2.7.7")

    implementation("io.github.pushpalroy:jetlime:2.1.0")

    implementation("androidx.datastore:datastore-preferences-core:1.0.0")
    implementation("androidx.datastore:datastore:1.0.0")
    implementation("androidx.datastore:datastore-preferences:1.0.0")

    implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.3")
    implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.6.1")

    implementation(project(":apiv2"))
    implementation(project(":utils"))
}

XD

kagg886 commented 8 months ago

Follow-up: It worked fine when I copied the source code from the jetlime folder in my project.

pushpalroy commented 8 months ago

@kagg886 Thanks for reporting the issue. I'll have a look at it.

pushpalroy commented 8 months ago

@kagg886 From your stack trace it seems like the error is related to CircularProgressIndicator and has nothing to do with the JetLime library. You can try upgrading your Compose BOM version as suggested in this thread here or try to find the exact cause of the crash.

kagg886 commented 8 months ago

it works fine on compose bom: "2024.02.00" thanks :D