airbnb / mavericks

Mavericks: Android on Autopilot
https://airbnb.io/mavericks/
Apache License 2.0
5.85k stars 498 forks source link

Using androidx.lifecycle:lifecycle-runtime-ktx:2.6.1 problems #679

Closed ujffdi closed 1 year ago

ujffdi commented 1 year ago

When project reference androidx.lifecycle:lifecycle-runtime-ktx:2.6.1: hint:Class 'HomeFragment' is not abstract and does not implement abstract member public abstract val lifecycle: Lifecycle defined in com.airbnb.mvrx.MavericksView。

image image

At this point, the LifecycleOwner interface inherited from the MavericksView source code points to version 2.6.1。

image

Change it to 2.5.1 to solve the problem.

ujffdi commented 1 year ago

The mavericks version is 3.0.2

alvindizon commented 1 year ago

Seeing the same issue as well. Project can still be built though

alvindizon commented 1 year ago

Any updates for this?

apramana commented 1 year ago

I opened a PR to address this, but please feel free to close it if this is already in progress upstream.

alvindizon commented 1 year ago

Any updates on this?

apramana commented 1 year ago

@rossbacher or @elihart when you have a chance, please review the PR to update dependencies.

martymiller commented 1 year ago

Really hoping you guys release v3.0.7 soon, so these compilation errors clear up. I see the PR is merged. Thanks!

elihart commented 1 year ago

3.0.7 is released. sorry for the delay

martymiller commented 1 year ago

I upgraded to 3.0.7, and I'm still seeing the error. Anyone else?

apramana commented 1 year ago

I upgraded to 3.0.7, and I'm still seeing the error. Anyone else?

@martymiller Your project might have another dependency that is pulling in an older version of the lifecycle dependency that isn't getting resolved to the new one for some reason. Try running ./gradlew :app:dependencies > report.txt and look for old versions of lifecycle-common - for me it was from androidx.test.espresso:espresso-contrib.

martymiller commented 1 year ago

@apramana That did the trick. Thanks!

alvindizon commented 1 year ago

@apramana I ran ./gradlew :app:dependencies and correct me if I'm wrong, I'm still seeing an older version of lifecycle-common being used somewhere in the Mavericks lib:

+--- com.airbnb.android:mavericks-testing:3.0.7
|    +--- com.airbnb.android:mavericks-mocking:3.0.7
|    |    +--- com.airbnb.android:mavericks:3.0.7
|    |    |    +--- com.airbnb.android:mavericks-common:3.0.7
|    |    |    |    +--- org.jetbrains.kotlinx:kotlinx-coroutines-core:{require 1.6.4; reject _} -> 1.7.3
|    |    |    |    |    +--- org.jetbrains.kotlin:kotlin-stdlib-common:1.8.20 -> 1.9.10
|    |    |    |    |    +--- org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.8.20 -> 1.8.22
|    |    |    |    |    |    +--- org.jetbrains.kotlin:kotlin-stdlib:1.8.22
|    |    |    |    |    |    |    +--- org.jetbrains.kotlin:kotlin-stdlib-common:1.8.22 -> 1.9.10
|    |    |    |    |    |    |    \--- org.jetbrains:annotations:13.0
|    |    |    |    |    |    \--- org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.8.22
|    |    |    |    |    |         \--- org.jetbrains.kotlin:kotlin-stdlib:1.8.22 (*)
|    |    |    |    |    \--- org.jetbrains.kotlinx:atomicfu:0.21.0
|    |    |    |    |         \--- org.jetbrains.kotlin:kotlin-stdlib-common:1.8.20 -> 1.9.10
|    |    |    |    \--- org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.8.22 (*)
|    |    |    +--- org.jetbrains.kotlinx:kotlinx-coroutines-core:{require 1.6.4; reject _} -> 1.7.3 (*)
|    |    |    +--- androidx.activity:activity:{require 1.5.1; reject _} -> 1.5.1
|    |    |    |    +--- androidx.annotation:annotation:1.1.0 -> 1.2.0
|    |    |    |    +--- androidx.core:core:1.8.0
|    |    |    |    |    +--- androidx.annotation:annotation:1.2.0
|    |    |    |    |    +--- androidx.annotation:annotation-experimental:1.1.0
|    |    |    |    |    +--- androidx.lifecycle:lifecycle-runtime:2.3.1 -> 2.5.1
|    |    |    |    |    |    +--- androidx.annotation:annotation:1.1.0 -> 1.2.0
|    |    |    |    |    |    +--- androidx.arch.core:core-common:2.1.0 -> 2.2.0 (*)
|    |    |    |    |    |    \---androidx.lifecycle:lifecycle-common:2.5.1
apramana commented 1 year ago

@apramana I ran ./gradlew :app:dependencies and correct me if I'm wrong, I'm still seeing an older version of lifecycle-common being used somewhere in the Mavericks lib:

@alvindizon it looks like there are some dependencies between mavericks and lifecycle-common (i.e. androidx.activity -> androidx.core -> lifecycle-runtime) that are not on the latest version. In retrospect I should have also updated those in Mavericks, but you can also bump them in your own project.