Comments (8)
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.
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.
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.
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.
With compose I meant compose Ui, not compose activity 🙂
from compose-destinations.
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.
@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.
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)
- [Improvement] moduleName could be automatically raname to "main" HOT 1
- Multiple NavGraphs with shared routes on V2 HOT 1
- Sharing a view model between destinations but with a view model factory HOT 3
- Multiple DestinationsNavHost
- upgraded from 2.0.0-beta02 to 2.0.0-beta09 HOT 16
- Crash when using Parcelable class as navigation argument HOT 6
- [KSP] Destinations generation issue HOT 1
- Standalone Sealed Classes as NavArgs in Android HOT 5
- Could not find Navigator with name "BottomSheetNavigator". You must call NavController.addNavigator() for each navigation type HOT 5
- Handle different scheme for debug and release build HOT 1
- Deeplink to nested graph destination not working HOT 2
- Build failed: Only safe or non-null asserted calls are allowed for custom `@NavTypeSerializer` HOT 3
- Destination argument names instead of values are passed when values are null HOT 9
- (Open)ResultRecipient seems to cause recompositions HOT 1
- Pass/Access ContentPadding in Child-Destinations HOT 1
- Original Question: Is this project (basically) dead? Answer: Definitely not! Exciting things are coming! HOT 2
- Could not find navigator with name "BottomSheetNavigator" Using compose 1.7 HOT 1
- Please updrade Navigation to 2.8.0-beta05,this version fixed navhost transition stuck issue. HOT 1
- DestinationsNavHost 'start' parameter ruins Multiple Back Stack HOT 6
- "Cannot detect default value for navigation argument" error when updating from 2.0.0-beta09 to 2.0.0-beta10 HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from compose-destinations.