Hello all. I have a KMM app that runs smoothly in ...
# ios
s
Hello all. I have a KMM app that runs smoothly in Android, but when I run the iosApp, the build fails with these errors:
Copy code
Compilation failed: IrClassPublicSymbolImpl for com.example.iosbuildfixapp/ComposableSingletons$AppKt|null[0] is already bound: CLASS OBJECT name:ComposableSingletons$AppKt modality:FINAL visibility:internal superTypes:[]
Copy code
java.lang.IllegalStateException: IrClassPublicSymbolImpl for com.example.iosbuildfixapp/ComposableSingletons$AppKt|null[0] is already bound: CLASS OBJECT name:ComposableSingletons$AppKt modality:FINAL visibility:internal superTypes:[]
Copy code
/Users/sn/AndroidStudioProjects/iosBuildFixApp/iosApp/iosApp/ComposeView.swift:17:9 Cannot find 'AppKt' in scope
Has anyone seen this issue before and know how to fix it? Thank you! Code is attached for reference .
1
s
havent checked your code but you gotta have global vals in the ComposableSingletons and the objc transpiler cannot figure it out a name for that while keeping the other kotlin classes/whatnot inside quick fix : create an object around the global val Update: now i checked and you have the same file
App.kt
both in the common and in the ios sources that collides
s
Ohh okay. I was following

this tutorial for compose multiplatform

(for reference, time stamp 10:40). Is it that both the files, in commonMain and iosMain, should be named something other than App, or that each of those files should have different names?
Changing the common main file name to something else fixed the issue, thank you!!