Giter VIP home page Giter VIP logo

After updating some Gradle libraries including this one I get "BackendException: Backend Internal error: Exception during psi2ir" on a RootNavGraphDefaultAnimations implementation about compose-destinations HOT 8 CLOSED

alonsd avatar alonsd commented on September 22, 2024
After updating some Gradle libraries including this one I get "BackendException: Backend Internal error: Exception during psi2ir" on a RootNavGraphDefaultAnimations implementation

from compose-destinations.

Comments (8)

alonsd avatar alonsd commented on September 22, 2024 1

Going by the official docs the compose ui and compose tooling are separate and independent of each other, and the only one I have in the same category of compose ui is compose material3 which has a version of 1.1.2 which makes me confused because I used the 1.9.x version of this library since my compose tooling is 1.5.x and everything worked back again. I'll just leave it like that without further investigating since they recommend using the compose BOM which I won't be refactoring to now atm and for me it's good enough that it works.

Seems like Gradle did not automatically suggest the latest 1.9.x version for this library, which made me use incompatible versions and caused this entire mess. If the version suggestions has anything to do with this library it could be a good idea to give it a check. Nonetheless, thanks a lot for your time and effort to help me solve this issue.

from compose-destinations.

raamcosta avatar raamcosta commented on September 22, 2024 1

The confusing part is that you’re saying you don’t have compose ui dependency. That’s as far as I know the main dependency to be able to use compose. I’m guessing you’re using 1.5.x, maybe it’s a transitive dependency from another module?

anyway, glad the issue is solved!

from compose-destinations.

raamcosta avatar raamcosta commented on September 22, 2024

Hi @alonsd

Can you please tell me versions of:

compose destinations
Kotlin
Ksp
Compose
Compose compiler

thanks!

also if you can tell me both after and before the changes you did, awesome!

from compose-destinations.

alonsd avatar alonsd commented on September 22, 2024

Thank you for your response :)

After updating:
animations-core (compose destinations) = "1.8.42-beta"
kotlinGradlePlugin = "1.9.22"
KSP version 1.9.22-1.0.16
activity-compose = "1.8.2"
kotlinCompilerExtensionVersion = "1.5.8"

Before updating:
animations-core (compose destinations) = "1.8.33-beta"
kotlinGradlePlugin = "1.9.0"
KSP version 1.9.21-1.0.16
activity-compose = "1.6.1"
kotlinCompilerExtensionVersion = "1.5.2"

from compose-destinations.

raamcosta avatar raamcosta commented on September 22, 2024

With compose I meant compose Ui, not compose activity 🙂

from compose-destinations.

alonsd avatar alonsd commented on September 22, 2024

With compose I meant compose Ui, not compose activity 🙂

Seems like I don't have compose-ui but only compose.ui:ui-tooling which is 1.5.4 and was 1.4.0-alpha05
I also have compose material3 which is 1.1.2 and was 1.0.1

from compose-destinations.

alonsd avatar alonsd commented on September 22, 2024

@raamcosta I tested the default implementation of RootNavGraphDeaultAnimations like the following -

class ApplicationActivity : AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)

        setAqvContent {
            val windowMetrics: WindowMetrics = WindowMetricsCalculator.getOrCreate().computeCurrentWindowMetrics(LocalContext.current as Activity)
            val screenWidth: Int = windowMetrics.bounds.width()
            DestinationsNavHost(
                navGraph = NavGraphs.root,
                engine = rememberAnimatedNavHostEngine(
                    navHostContentAlignment = Alignment.Center,
                    rootDefaultAnimations = RootNavGraphDefaultAnimations()
                )
            )
        }
    }
}

And it produced the following error -

java.lang.ClassCastException: androidx.compose.animation.AnimatedContentTransitionScopeImpl cannot be cast to androidx.compose.animation.AnimatedContentScope
at com.google.accompanist.navigation.animation.AnimatedNavHostKt$AnimatedNavHost$7$1.invoke(AnimatedNavHost.kt:198)
at androidx.compose.animation.AnimatedContentKt.AnimatedContent(AnimatedContent.kt:787)
at com.google.accompanist.navigation.animation.AnimatedNavHostKt.AnimatedNavHost(AnimatedNavHost.kt:196)
at com.google.accompanist.navigation.animation.AnimatedNavHostKt$AnimatedNavHost$11.invoke(Unknown Source:27)
at com.google.accompanist.navigation.animation.AnimatedNavHostKt$AnimatedNavHost$11.invoke(Unknown Source:10)
at androidx.compose.runtime.RecomposeScopeImpl.compose(RecomposeScopeImpl.kt:169)
at androidx.compose.runtime.ComposerImpl.recomposeToGroupEnd(Composer.kt:2468)
at androidx.compose.runtime.ComposerImpl.skipCurrentGroup(Composer.kt:2737)
at androidx.compose.runtime.ComposerImpl.doCompose(Composer.kt:3352)
at androidx.compose.runtime.ComposerImpl.recompose$runtime_release(Composer.kt:3303)
at androidx.compose.runtime.CompositionImpl.recompose(Composition.kt:781)
at androidx.compose.runtime.Recomposer.performRecompose(Recomposer.kt:1097)
at androidx.compose.runtime.Recomposer.access$performRecompose(Recomposer.kt:124)
at androidx.compose.runtime.Recomposer$runRecomposeAndApplyChanges$2$1.invoke(Recomposer.kt:569)
at androidx.compose.runtime.Recomposer$runRecomposeAndApplyChanges$2$1.invoke(Recomposer.kt:537)
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:1229)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1239)
at android.view.Choreographer.doCallbacks(Choreographer.java:899)
at android.view.Choreographer.doFrame(Choreographer.java:827)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1214)
at android.os.Handler.handleCallback(Handler.java:942)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loopOnce(Looper.java:201)
at android.os.Looper.loop(Looper.java:288)
at android.app.ActivityThread.main(ActivityThread.java:7872)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936)
Suppressed: kotlinx.coroutines.internal.DiagnosticCoroutineContextException: [androidx.compose.runtime.PausableMonotonicFrameClock@b72ea0c, androidx.compose.ui.platform.MotionDurationScaleImpl@4857f55, StandaloneCoroutine{Cancelling}@a614d6a, AndroidUiDispatcher@b00725b]

This is a different error then the one I initially reported in this thread with my own custom animations. My idea was to first check the the bare minimum default implementation like suggested in the documentation, and even there there is still a crash. This time the crash leads to some failed casting.

from compose-destinations.

raamcosta avatar raamcosta commented on September 22, 2024

Hi @alonsd

If you're using compose, there's definitely a compose ui dependency.
Assuming the compose tooling version is the same, then, looking at the readme of this library, you'll see that you should be using 1.9.x to match 1.5.x compose.

from compose-destinations.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.