Hi. I'm trying to add genercis support to iOS proj...
# multiplatform
d
Hi. I'm trying to add genercis support to iOS project. My build.gradle.kts is:
Copy code
targets {
        final def iOSTarget = System.getenv('SDK_NAME')?.startsWith("iphoneos") \
                              ? presets.iosArm64 : presets.iosX64

        fromPreset(iOSTarget, 'ios') {
            binaries {
                framework('multiplatform-code') {
                    freeCompilerArgs.add("-Xobjc-generics")
                }
            }
        }

        fromPreset(presets.jvm, 'android')
    }
And I'm getting this error:
Copy code
Build file '/..../multiplatform-code/build.gradle' line: 40

* What went wrong:
A problem occurred evaluating root project 'multiplatform-code'.
> Operation is not supported for read-only collection
And line 40 is:
Copy code
freeCompilerArgs.add("-Xobjc-generics")
I dont understand the source of the problem. What exactly "Operation is not supported for read-only collection" is mean?
r
freeCompilerArgs
is a
List
, you can’t add to a list. Try setting it to a new list
freeCompilerArgs = freeCompilerArgs + "-Xobjc-generics"
d
oooooooh
<facepalm>
thanks
s
freeCompilerArgs += “-Xobjc-generics”