https://kotlinlang.org logo
#multiplatform
Title
# multiplatform
c

coolcat

02/05/2019, 3:26 PM
Are there any up-to-date instructions on setting up an iOS/Android multiplatform project since the Kotlin 1.3.20 update? An equivalent of https://kotlinlang.org/docs/tutorials/native/mpp-ios-android.html My current issue: I want to rename the new default “main” iOS framework to a different one. When I add
Copy code
fromPreset(iOSTarget, 'iOS') {
            binaries {
                framework {
                    baseName = 'myname'
                }
            }
            compilations.main.outputKinds('FRAMEWORK')
        }
I see
myname.framework
present in
build/bin/iOS/debugFramework
and
releaseFramework
. But the
build/xcode-frameworks
folder generated by the
packForXCode
task still contains
main.framework
. Should I now be pointing my Xcode project directly to
build/bin/iOS/debugFramework
and
releaseFramework
? Or is it basically simplest to suck it up and rename the references in my iOS code to
main
instead of
myname
?
s

Sam

02/05/2019, 3:36 PM
If you remove the compilations.main line it name your framework after the module name it is built in. You can still change the name to something you like better using baseName if you want. Most frameworks start with a capital letter in iOS/macOS so I used it to give my module a name that blends in better.
Also the new tutorial integrates with Xcode differently. It no longer has a shell framework with just a build script. If you change the name of your framework, you’ll need to change how the packForXCode Gradle task finds your binaries. Search this channel for the term baseName. There’s a thread from Jan 30 started by Aleks Nesterau that has the information to set it up correctly.
b

basher

02/05/2019, 4:15 PM
I had the same issue as well and removing the
compilations.main.outputKinds
line fixed it
r

russhwolf

02/05/2019, 6:13 PM
I think the most up-to-date general multiplatform gradle documentation is at https://kotlinlang.org/docs/reference/building-mpp-with-gradle.html. It's much more general but reading through that can help to find where things need to update when trying to follow the 1.3.0-era tutorial at https://kotlinlang.org/docs/tutorials/native/mpp-ios-android.html