Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unbound public symbol IrSimpleFunctionPublicSymbolImp error in iOS build #3175

Closed
sunildhiman90 opened this issue May 17, 2023 · 14 comments
Closed
Assignees
Labels
bug Something isn't working compiler Compiler plugin related reproduced

Comments

@sunildhiman90
Copy link

Describe the bug
After adding voyager library in compose multiplatform project, getting this error in ios build:

Unbound public symbol IrSimpleFunctionPublicSymbolImpl: cafe.adriel.voyager.navigator.tab/Tab.icon.<get-icon>|-5764684600227404327[0]
Unbound public symbol IrSimpleFunctionPublicSymbolImpl: cafe.adriel.voyager.navigator.tab/Tab.options.<get-options>|7766868889533212780[0]
Unbound public symbol IrSimpleFunctionPublicSymbolImpl: cafe.adriel.voyager.navigator.tab/Tab.title.<get-title>|371973571756195065[0]
Unbound public symbol IrSimpleFunctionPublicSymbolImpl: androidx.compose.foundation.lazy/LazyListScope.item|-2398404341226065315[0]
Unbound public symbol IrSimpleFunctionPublicSymbolImpl: androidx.compose.foundation.lazy/LazyListScope.items|8564101490881923997[0]
Unbound public symbol IrSimpleFunctionPublicSymbolImpl: androidx.compose.foundation.lazy/LazyListScope.stickyHeader|431226128286809998[0]

This could happen if there are two libraries, where one library was compiled against the different version of the other library than the one currently used in the project. Please check that the project configuration is correct and has consistent versions of dependencies.
error: Compilation finished with errors

Affected platforms
Select one of the platforms below:

  • iOS

Versions

  • Kotlin version*: 1.8.20
  • Compose Multiplatform version*: 1.4.0
  • voyager: 1.0.0-rc06

To Reproduce
Steps and/or the code snippet to reproduce the behaviour:

  1. I have created a reproducer for this issue, please checkout this fork:
    https://github.com/sunildhiman90/compose-multiplatform-template-with-navigation
    and choose the branch with-voyager-navigation
  2. Try to build for iosApp.
  3. It should reproduce this bug
@adtarassov
Copy link

I have same problem

@eymar
Copy link
Member

eymar commented May 22, 2023

There is a workaround:
The idea is to not use cocoapods in shared module, but create an extra module iosEntryPoint with cocoapods but without Compose. iosEntryPoint should only provide a ViewController:

fun AppController() = MainViewController()

And then in can be used in ContentView.swift:

func makeUIViewController(context: Context) -> UIViewController {
        Main_iosKt.AppController()
    }

Created a patch which can be applied to the reproducer you provided: https://gist.github.com/eymar/c488eeed7df85d2024fa33090d1a66ca

@adtarassov
Copy link

adtarassov commented May 26, 2023

@sunildhiman90
Hi, you can use internal class instead of class for Tab.
It helped me.

@sunildhiman90
Copy link
Author

@sunildhiman90
Hi, you use internal class instead of class for Tab.
It helped me.

Hi@adtarassov, Thanx, yes that will also fix this issue, But it may arise in other libraries as well. Then we will have to make similar changes in other libraries as well. So thats why as of now i did workaround mentioned here: #3175 (comment)

Because i wanted a central common fix/workaround for this. So If we do this workaround, Then we will not have to worry about this issue anymore in other libraries until its fix available in compose.

@sunildhiman90
Copy link
Author

Hi @eymar, Actually after using that approach of separate iosEntryPoint module: #3175 (comment), now i am facing this issue in ios app:

org.jetbrains.compose.resources.MissingResourceException: Missing resource with path: add_post_icon.png

Resources are missing i think now. do we have any workaround for that? May be its not able to copy resources for ios. But they are working fine in all other platforms.

@paringer
Copy link

paringer commented Aug 9, 2023

Hi, I have same problem, with voyager navigation, final data class TabOptions, used inside interface Tab, is not exported, it is either: does not open, final class, which was wrapped somehow unsuccessfully, or does not have generated getters and setters, or getters and setters are not exported, or interfaces can not have val fields after being exported, or may be empty get inside Tab class field options creates an issue ? I have no idea, what wrong with compiler. It helped to use internal but I can not use object construction for tabs

@babramovitch
Copy link

Setting it to internal gets it compiling for me as well

@joelkanyi
Copy link

Adding the internal keyword on my Tabs worked:

internal object HomeTab : Tab {

@shriharsha-srb
Copy link

+1

@fajarazay
Copy link

Adding the internal keyword on my Tabs worked:

internal object HomeTab : Tab {

worked like a charm 👍

@kochchy
Copy link

kochchy commented Mar 12, 2024

cant have tab internal because it is in another module, any other solution?

@eymar
Copy link
Member

eymar commented Mar 13, 2024

Please try to use voyager 1.1.0-alpha03 and Compose Multiplatform 1.6.0 in all of your modules

The issue was fixed in the compiler plugin a while ago, but the libraries should also be recompiled and I see that latest alpha of Voyager depends on CM 1.6.0-rc02 - so it should work IMO

This way no "add internal" workarounds should be necessary

@eymar
Copy link
Member

eymar commented Mar 13, 2024

I'm closing this issue as fixed.

@eymar eymar closed this as completed Mar 13, 2024
@okushnikov
Copy link
Collaborator

Please check the following ticket on YouTrack for follow-ups to this issue. GitHub issues will be closed in the coming weeks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working compiler Compiler plugin related reproduced
Projects
None yet
Development

No branches or pull requests

10 participants