Closed chris6647 closed 2 months ago
Yes, there is no and is not planned the overriding resources feature for now. Because accessors are being generated as code and compiled into Kotlin klibs. The android resources work different an ids are handled during a final app build. It is one of the reasons why android has own library format - AAR, as I understand.
At a glance, it seems like "just" parsing untill the line end, instead of offset and size, would work and would let you override string resources in the same nameSpaces. Would that be an option?
No. You are not able to read bytes from a centre of the file without offset/size
Alright. Well I hope you guys will consider supporting it in the future :) Thanks for your prompt replies!
Please check the following ticket on YouTrack for follow-ups to this issue. GitHub issues will be closed in the coming weeks.
Coming from the Android world, we're used to being able to define a String resource in a feature module, and then have the app override any string keys it may need to. This allows a feature to have defaults, which gets superseeded by the app, as long as they're in the same
publicResClass
.Doing so in Compose Resources does not work, due to the
offset
andsize
parameters which match the initialStringResource
in the feature. When we runtime try to resolve it, it may not match with the final string causing ineligble strings (/empty strings) to be returned, or even crashes if the base64 decoder fails with invalid chars.Any chance for an implementation that supports this, or ideas for a workaround? So far I havn't been able to come up with anything that I can do from my end of the code. Had a hard time chosing between a bug report or enhancement request - but went with bug due to how the issues surface with wrong texts or crashes.
Similar problem as this issue https://github.com/JetBrains/compose-multiplatform/issues/4837 , but another use case, which will hopefully reconsider :)