Stylianos Gakis
03/29/2023, 9:46 AM2023.01.00
which brings in androidx.compose.material:material:1.3.1
. Some of my other deps, is bringing in 1.4.0-alpha04
apparently, which had some breaking change in rememberModalBottomSheetState
.
Now I wonder, since gradle resolves 1.4.0-alpha04 instead at runtime, shouldn’t I also be getting that warning in my source code, so that the breaking change doesn’t let me compile in the first place?
Also jumping to sources when on that function brings me to 1.3.1. But running the app actually crashes at runtime since it’s using 1.4.0-alpha where it’s complaining that I am not passing a non-null parameter to the function.
Shouldn’t I be unable to compile in the first place instead in these cases?Yang
03/29/2023, 10:14 AMYang
03/29/2023, 10:15 AMStylianos Gakis
03/29/2023, 10:25 AMconfirmStateChange
does not have a default paramater value anymore. In 1.3.1 it was confirmStateChange: (ModalBottomSheetValue) -> Boolean = { true }
.
And in 1.4.0 there’s another function signature, where now the confirmValueChange
does have the default parameter again.
But actually no, it is my own code which is trying to consume this API, not in the library. Specifically this line here.
So I really don’t quite understand how all these things interact with each other 😵💫
In the first place though, I’d have expected my IDE when doing Cmd + B on it to redirect me to the sources of 1.4.0-alpha, shouldn’t that be the case? Since gradle has resolved that as the chosen version? Because it doesn’t do that either.Yang
03/29/2023, 11:14 AMYang
03/29/2023, 11:16 AMStylianos Gakis
03/29/2023, 11:17 AMYang
03/29/2023, 11:18 AMYang
03/29/2023, 11:19 AMStylianos Gakis
03/29/2023, 11:20 AMYang
03/29/2023, 11:21 AMStylianos Gakis
03/29/2023, 11:21 AMCan you check dependency insight?By this you mean doing like
./gradlew :app:dependencies > outputFile.txt
right? And looking through it? Because that’s what I didYang
03/29/2023, 11:22 AMYang
03/29/2023, 11:23 AMStylianos Gakis
03/29/2023, 11:26 AMYang
03/29/2023, 11:29 AMStylianos Gakis
03/29/2023, 11:37 AMYang
03/29/2023, 11:38 AMAlbert Chang
03/29/2023, 4:11 PMStylianos Gakis
03/29/2023, 4:15 PMColton Idle
03/30/2023, 5:17 AMStylianos Gakis
03/30/2023, 8:59 AMandroidx.compose.material:material:1.4.0-alpha04
dependency.
I wish I could read the build scan I made to realize if this is in fact true, but I literally can’t understand reading through it 😂 That popup on the right side of the attached pic should probably be able to tell me, but I straight up don’t understand it 😵💫
The pic attached shows that :app was using the alpha dep, but :feature-businessmodel was seeing only 1.3.1, so the code in there did not know that it’d crash, but in the end, the app since it needs the alpha dep would make that module also use it, so the result is runtime crash.
So that was it, and til that this is possible to happen when you got a multi-module setup, I had no idea.Albert Chang
03/30/2023, 9:17 AM./gradlew -q :app:dependencies --configuration releaseRuntimeClasspath
to get a text-based dependency graph so that you can find which dependency pulls in the alpha version by searching for androidx.compose.material:material:1.4.0-alpha04
.Stylianos Gakis
03/30/2023, 9:18 AMAlbert Chang
03/30/2023, 9:32 AMColton Idle
03/30/2023, 6:27 PM