Fixed
Status Update
Comments
el...@google.com <el...@google.com> #2
Thanks for bringing this to our attention, this is definitely not intended behavior, we'll try and get a fix for it out soon.
ap...@google.com <ap...@google.com> #3
Project: platform/frameworks/support
Branch: androidx-main
Author: elifbilgin <
Link:
Supporting ByteBuffer in non-Android & non-JVM platforms.
Expand for full commit details
Supporting ByteBuffer in non-Android & non-JVM platforms.
Since ByteBuffer is a JVM-only API, it was erroneously used in generated code in non-JVM platforms. It has been replaced altogether with a new ByteArrayWrapper class which holds a byte array and replaces the use of a ByteBuffer by implementing equals() and hashcode().
Bug: 367205685
Test: BaseQueryTest
Relnote: Create internal ByteArrayWrapper class to support Relations with ByteBuffer in non-Android & non-JVM platforms.
Change-Id: I755433b8d624c88a6d645d40cf845d9bd3123398
Files:
- M
room/integration-tests/multiplatformtestapp/src/commonTest/kotlin/androidx/room/integration/multiplatformtestapp/test/BaseQueryTest.kt
- M
room/integration-tests/multiplatformtestapp/src/commonTest/kotlin/androidx/room/integration/multiplatformtestapp/test/SampleDatabase.kt
- M
room/room-compiler/src/main/kotlin/androidx/room/ext/xpoet_ext.kt
- M
room/room-compiler/src/main/kotlin/androidx/room/solver/TypeAdapterStore.kt
- A
room/room-compiler/src/main/kotlin/androidx/room/solver/types/ByteArrayWrapperColumnTypeAdapter.kt
- M
room/room-compiler/src/main/kotlin/androidx/room/vo/RelationCollector.kt
- M
room/room-compiler/src/test/test-data/kotlinCodeGen/relations_byteBufferKey.kt
- M
room/room-runtime/api/restricted_current.txt
- M
room/room-runtime/bcv/native/current.txt
- A
room/room-runtime/src/androidUnitTest/kotlin/androidx/room/util/ByteArrayWrapperTest.kt
- A
room/room-runtime/src/commonMain/kotlin/androidx/room/util/ByteArrayWrapper.kt
Hash: c5fc6b2da2301441f4a320485d6bcd763265ce14
Date: Mon Sep 16 15:43:39 2024
el...@google.com <el...@google.com>
na...@google.com <na...@google.com> #4
The following release(s) address this bug.It is possible this bug has only been partially addressed:
androidx.room:room-compiler:2.7.0-alpha10
androidx.room:room-runtime:2.7.0-alpha10
androidx.room:room-runtime-android:2.7.0-alpha10
androidx.room:room-runtime-macosx64:2.7.0-alpha10
li...@linkly.com.au <li...@linkly.com.au> #5
Issue persists in 2.7.0-alpha11
el...@google.com <el...@google.com> #6
Hi, do you have a sample for us to reproduce the same error on our end? Thanks!
el...@google.com <el...@google.com> #7
Hi, do you have any updates on this for us? Thanks!
el...@google.com <el...@google.com> #8
Closing this issue now, please let us know if the issue persists.
Description
Component used: Room Version used: 2.7.0-alpha-07 (multiplatform) Devices/Android versions reproduced on: No run device needed. Only a Mac to compile on iOS
If this is a bug in the library, we would appreciate if you could attach:
Tested commands :
I'm using a relation with Kotlin Uuid (experimental in 2.0.20) mapped to ByteArray (with UuidTypeAdapter) and stored as BLOB in the database. When I try to run the ksp task to generate iOS code, an error occurs.
I suppose the same issue happens for every non JVM targets.
When I don't use relation (Replace MyEntityEmbed by MyFirstEntity in MyDao), the code compiles correctly.
I think room tries to generate a code near to the one generated for android which uses ByteBuffer to decode BLOBs.