Hello all. I have a KMM app that runs smoothly in ...
# multiplatform
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!
1
Code for reference:
r
could it be a namespace/variable naming clash? where is
AppKt
defined?
or possibly there are a couple of
App
objects in the source - just a guess though ...
s
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
That would likely be a conflict unless you are using expect for the commonMain.
App
. Maybe trying renaming iosMain
App
to
IosApp
?
s
Changing the common main file name worked! Thank you!
169 Views