I started a new Kotlin multiplatform app (using the Kotlin Multiplatform Wizard).
I created an iOS Widget, resulting in two targets: the App and the Widget.
I shared some of the App’s files with the Widget target to reuse them.
However, when I started using the shared code within those files, the build failed with an error saying import ComposeApp
cannot be found in the Widget target.
After some debugging, the only solution I found was to copy the Compile Kotlin Framework
build phase from the App target to the Widget target. It works now, the downside is that this approach doubles the app size because each target now includes ComposeApp.
Has anyone else encountered this issue? Is there an easier fix?