admin管理员组文章数量:1391987
I am working on a multi Module Android project and I want to use the latest navigation library so I can take advantage of the Type Safe Navigation.
Just usual I added the library reference into the libs file and included that into the main module library
navigationVersion = "2.8.9"
androidx-navigation-compose = { group = "androidx.navigation", name = "navigation-compose", version.ref = "navigationVersion" }
dependencies {
implementation(libs.jakewharton.timber)
implementation(libs.androidx.security.cryto.ktx)
implementation(libs.bundlespose)
implementation(libs.androidx.activity.kotlin)
implementation(libs.androidx.core.splashscreen)
implementation(libs.androidx.core.ktx)
implementation(libs.jetbrains.kotlinx.collections.immutable)
implementation(libs.google.android.gms.maps)
implementation(libs.androidx.navigationpose) - HERE IS THE LIBRARY
....
and I am trying to use the typesafe navigation method but it keeps throwing me the issue it does not exist
@Serializable
data object Name
navHostController.navigate(Name)
Error code:
None of the following functions can be called with the arguments supplied.
navigate(Uri) defined in androidx. navigation. NavHostController
navigate(NavDeepLinkRequest) defined in androidx. navigation. NavHostController
navigate(NavDirections) defined in androidx. navigation. NavHostController
navigate(Int) defined in androidx. navigation. NavHostController
navigate(String, NavOptions? = ..., Navigator. Extras? = ...) defined in androidx. navigation. NavHostControlle
Then I noticed for some reason a 2.5.1
version is also presented in the project somehow besides the 2.8.9
version - but when I try to include the NavHostController
it uses it from the 2.5.1
version
There is no 2.5.1
version somehwere for this library reference on the libs.toml
so I have zero clue where they come from.
And while I was checking this I also realized there are a lot of libraries with multiple different versions.
Why so? How could I detect or remove where or how the older versions are included?
I am working on a multi Module Android project and I want to use the latest navigation library so I can take advantage of the Type Safe Navigation.
Just usual I added the library reference into the libs file and included that into the main module library
navigationVersion = "2.8.9"
androidx-navigation-compose = { group = "androidx.navigation", name = "navigation-compose", version.ref = "navigationVersion" }
dependencies {
implementation(libs.jakewharton.timber)
implementation(libs.androidx.security.cryto.ktx)
implementation(libs.bundlespose)
implementation(libs.androidx.activity.kotlin)
implementation(libs.androidx.core.splashscreen)
implementation(libs.androidx.core.ktx)
implementation(libs..jetbrains.kotlinx.collections.immutable)
implementation(libs.google.android.gms.maps)
implementation(libs.androidx.navigationpose) - HERE IS THE LIBRARY
....
and I am trying to use the typesafe navigation method but it keeps throwing me the issue it does not exist
@Serializable
data object Name
navHostController.navigate(Name)
Error code:
None of the following functions can be called with the arguments supplied.
navigate(Uri) defined in androidx. navigation. NavHostController
navigate(NavDeepLinkRequest) defined in androidx. navigation. NavHostController
navigate(NavDirections) defined in androidx. navigation. NavHostController
navigate(Int) defined in androidx. navigation. NavHostController
navigate(String, NavOptions? = ..., Navigator. Extras? = ...) defined in androidx. navigation. NavHostControlle
Then I noticed for some reason a 2.5.1
version is also presented in the project somehow besides the 2.8.9
version - but when I try to include the NavHostController
it uses it from the 2.5.1
version
There is no 2.5.1
version somehwere for this library reference on the libs.toml
so I have zero clue where they come from.
And while I was checking this I also realized there are a lot of libraries with multiple different versions.
Why so? How could I detect or remove where or how the older versions are included?
Share Improve this question asked Mar 15 at 21:32 No_NameNo_Name 3033 silver badges11 bronze badges 1- Any chance you have other dependencies that are brining those in? – tomerpacific Commented Mar 16 at 5:32
1 Answer
Reset to default 1It looks like another library has a dependency on a lower version of the navigation. You can identify the problem by running and analyzing the file:
./gradlew :app:dependencies > dependencies.txt
But if you want to have only one version in the project, you can do so by using resolutionStrategy
:
configurations.all {
resolutionStrategy {
force 'androidx.navigation:navigation-compose:2.8.9'
}
}
More information about the ResolutionStrategy: https://docs.gradle./current/dsl/.gradle.api.artifacts.ResolutionStrategy.html
本文标签: androidMulti module projectMultiple Library VersionsStack Overflow
版权声明:本文标题:android - Multi module project - Multiple Library Versions - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744603023a2615181.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论