https://kotlinlang.org logo
#multiplatform
Title
# multiplatform
v

Vaibhav Jaiswal

09/23/2023, 9:19 AM
Hey everyone I’d like to know if Paging3 is supported in Compose Multiplatform? From the latest Paging3 release, it says
paging-compose
has moved its code to
common
and ships an Android artifact, matching the multiplatform support of
androidx.compose
.
f

Fyodor Danilov

09/23/2023, 9:23 AM
It is supported in alpha according to changelogs https://developer.android.com/jetpack/androidx/releases/paging#3.3.0-alpha02
v

Vaibhav Jaiswal

09/23/2023, 9:24 AM
But I am getting error when adding paging-compose dependency in commonMain
using the version 3.3.0-alpha02
f

Fyodor Danilov

09/23/2023, 9:40 AM
What error do you get?
u

원석

09/23/2023, 9:40 AM
@Vaibhav Jaiswal I faced the same issue, so I’ve just switched to using
app.cash.paging:paging-runtime-composeui
and it works fine.
v

Vaibhav Jaiswal

09/23/2023, 9:41 AM
@Fyodor Danilov error is
cannot resolve dependency
@원석 are you only using that library only or cash app paging compose common and androidx:paging-common both
v

Vaibhav Jaiswal

09/23/2023, 9:47 AM
Im doing the same, but getting Kotlin Compiler error
Copy code
IrPropertyPublicSymbolImpl for androidx.paging/DEBUG|3092957818876675223[0] is bound ............
@원석 did you face this?
u

원석

09/23/2023, 9:54 AM
It seems I’ve encountered a different issue from yours. When I added the
androidx paging-compose
to the
commonMain
, I encountered the error:
"Could not resolve all dependencies for configuration ':shared:iosArm64CompileKlibraries'."
v

Vaibhav Jaiswal

09/23/2023, 9:55 AM
I face this too, then moved to app.cash.paging-compose-common, but then facing this error when building
u

원석

09/23/2023, 9:56 AM
How about trying
app.cash.paging:paging-runtime-composeui
instead?
v

Vaibhav Jaiswal

09/23/2023, 9:56 AM
will try that
but there error I’m getting seems some issue in AndroidX.Paging
Copy code
Compilation failed: IrPropertyPublicSymbolImpl for androidx.paging/DEBUG|3092957818876675223[0] is already bound: PROPERTY name:DEBUG visibility:public modality:FINAL [const,val]
anyone knows how to fix this?
This error goes away as soon as I remove
Copy code
androidx.paging:paging-common:3.0.0-alpha02
dependency
v

veyndan

09/23/2023, 12:06 PM
Hopefully this'll clarify some things: 1. AndroidX Paging's
paging-common
is multiplatform. It supports the JVM (as before), iOS, macOS, and Linux. 2. AndroidX Paging's
paging-compose
is "multiplatform". I put it in quotes, because it uses KMP under the hood, but the only platform it targets is Android. Depending on AndroidX Paging's
paging-compose
in the
common
source set only makes sense if you're also just targeting Android only (which you're probably not doing). 3. Multiplatform Paging's
paging-compose
is also multiplatform, but supports a bunch more targets than just Android (which is probably what you want). 4. You can mix-and-match AndroidX Paging and Multiplatform Paging artifacts, but they both have to be using the same version. For example, the latest version of AndroidX Paging that Multiplatform Paging supports is
3.2.0-alpha05
. I'm planning on supporting the latest version (
3.3.0-alpha02
) in Multiplatform Paging within the coming days. Once I've tracked
3.3.0-alpha02
in Multiplatform Paging, you'll probably want to depend on Multiplatform Paging's
paging-compose
artifact. If you're explicitly depending on
paging-common
anywhere, you can either depend on AndroidX Paging's
paging-common
, or Multiplatform Paging's
paging-common
(which has a few more targets you may or may not care about). In the meantime, depending on
3.2.0-alpha05
is the safest option.
👍 1
v

Vaibhav Jaiswal

09/23/2023, 12:09 PM
Thanks a lot, this clarified all my doubts
As of now, i got rid of AndroidX’s paging and using
Copy code
app.cash.paging:paging-compose-common
which is working quite well with Compose Multiplatform
🎉 3
v

veyndan

09/25/2023, 11:33 PM
Just tracked
3.3.0-alpha02
in Multiplatform Paging (https://github.com/cashapp/multiplatform-paging/releases/tag/3.3.0-alpha02-0.4.0), so you should be able to upgrade to the latest AndroidX Paging release if you wish!
👍 1
v

Vaibhav Jaiswal

10/01/2023, 9:55 AM
@veyndan I upgraded to 3.3.0-alpha02-0.4.0, and since then I’m getting this error when building iosApp
Copy code
error: Could not find "co.touchlab:stately-isolate"
Copy code
implementation(libs.androidx.paging)
                implementation(libs.paging.compose.common)
This is how my gradle looks
@veyndan sorry to ping you again, can you please help out
s

sasikanth

10/02/2023, 7:55 AM
I had the same issue, once I added stately dependencies to my project it's resolved
Copy code
stately = "2.0.4"

stately-isolate = { module = "co.touchlab:stately-isolate", version.ref = "stately" }
stately-iso-collections = { module = "co.touchlab:stately-iso-collections", version.ref = "stately" }

implementation(libs.stately.isolate)
implementation(libs.stately.iso.collections)
v

veyndan

10/02/2023, 2:07 PM
I'm on vacation at the moment, but will have a look on Wednesday. What @sasikanth said is a good workaround for the time being though!
v

Vaibhav Jaiswal

10/03/2023, 5:59 AM
No issues, enjoy your vacation
@sasikanth thanks, this worked
👍🏾 1
v

veyndan

10/04/2023, 9:47 AM
@Vaibhav Jaiswal I'm just checking this now, and it surprises me! I ripped out Stately in the lastest version of Multiplatform Paging, so it's strange that it's complaining about it not existing. Do you mind checking what happens if you change your imports to the following?
Copy code
implementation("app.cash.paging:paging-common:3.3.0-alpha02-0.4.0")
implementation("app.cash.paging:paging-compose-common:3.3.0-alpha02-0.4.0")
If that works, what happens when you remove the Stately dependencies that Sasikanth mentioned?
v

Vaibhav Jaiswal

10/05/2023, 12:51 PM
It still throws the same error
v

veyndan

10/05/2023, 12:53 PM
Hmm, weird…
Is the project you're working on open-source? If not, do you mind publishing a sample app that recreates it? I'm struggling to recreate the issue myself
v

Vaibhav Jaiswal

10/05/2023, 12:54 PM
I’ll try to replicate it in a sample app If I downgrade to the previous version it fixes,
s

sasikanth

10/05/2023, 12:54 PM
The project I am working on is open source, with the same issue (although it's resolved after adding stately dependencies). I can share it in case you want to experiment it there
v

veyndan

10/05/2023, 12:56 PM
@sasikanth That's great — please do share!
s

sasikanth

10/05/2023, 12:56 PM
v

Vaibhav Jaiswal

10/25/2023, 7:23 AM
@veyndan any update on this?
v

veyndan

10/25/2023, 12:43 PM
I kind've forgot about this tbh. I just tried pulling Twine and building it but I'm getting the following error after a `./gradlew build`:
Copy code
> Task :resources:strings:kspCommonMainKotlinMetadata FAILED
e: java.lang.UnsupportedClassVersionError: cafe/adriel/lyricist/processor/internal/LyricistSymbolProcessorProvider has been compiled by a more recent version of the Java Runtime (class file version 63.0), this version of the Java Runtime only recognizes class file versions up to 61.0
Running
java --version
shows:
Copy code
openjdk 20.0.2 2023-07-18
OpenJDK Runtime Environment Zulu20.32+11-CA (build 20.0.2+9)
OpenJDK 64-Bit Server VM Zulu20.32+11-CA (build 20.0.2+9, mixed mode, sharing)
@sasikanth Have you seen this error before?
s

sasikanth

10/25/2023, 2:46 PM
Yes, I updated the Gradle toolchain version in the build files to 20 as well and that worked. I pushed those changes couple of days ago 🤔
blob thinking upside down 1
7 Views