Hi I am new to Android and Kotlin environment, I am from native iOS background.
I want to create a Kotlin MultiPlatform app and it is run-on both Android and iOS.
For this I am following this https://kotlinlang.org/docs/tutorials/native/mpp-ios-android.html
After complete the Updating Gradle Scripts process from the above documentation I am facing issue like:
Could not get unknown property 'iosX64' for KotlinTargetPreset container of type org.gradle.api.internal.FactoryNamedDomainObjectContainer.
and my build.gradle file path is /Kotlin_Practice/KTMPDemo/SharedCode/build.gradle
build.gradle
apply plugin: 'kotlin-multiplatform'
kotlin {
targets {
final def iOSTarget = System.getenv('SDK_NAME')?.startsWith("iphoneos") \
? presets.iosArm64 : presets.iosX64
fromPreset(iOSTarget, 'iOS') {
compilations.main.outputKinds('FRAMEWORK')
}
fromPreset(presets.jvm, 'android')
}
sourceSets {
commonMain.dependencies {
api 'org.jetbrains.kotlin:kotlin-stdlib-common'
}
androidMain.dependencies {
api 'org.jetbrains.kotlin:kotlin-stdlib'
}
}
}
// workaround for https://youtrack.jetbrains.com/issue/KT-27170
configurations {
compileClasspath
}
Can I update / downgrade my Gradle ?? How can I fix this above issue? Thank you.
My system Configuration:
Mac mini (Late 2014), macOS High Sierra, v10.13.5.
Android Studio Android Studio 3.1.4
Build #AI-173.4907809, built on July 24, 2018
JRE: 1.8.0_152-release-1024-b01 x86_64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o