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!
could it be a namespace/variable naming clash? where is
AppKt
defined?
Robert Munro
06/28/2023, 9:28 AM
or possibly there are a couple of
App
objects in the source - just a guess though ...
s
Sayali N
06/28/2023, 4:32 PM
Hmm.. 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? (edited)
r
Robert Munro
06/28/2023, 5:01 PM
That would likely be a conflict unless you are using expect for the commonMain.
App
. Maybe trying renaming iosMain
App
to
IosApp
?
s
Sayali N
06/28/2023, 6:45 PM
Changing the common main file name worked! Thank you!