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

Slackbot

06/24/2019, 9:06 AM
This message was deleted.
y

yshrsmz

06/24/2019, 9:26 AM
which version of gradle are you using?
it should be 5.3.1 or later
f

Fail

06/24/2019, 10:08 AM
Thank you! I was used 5.1.1
k

kpgalligan

06/24/2019, 11:21 AM
If using native, sqldelight won't work until a new version is published. The coroutines extension depends on kotlinx.coroutines 1.3.0-M1, which hasn't had a 1.3.40 update
f

Fail

06/24/2019, 11:45 AM
Ok. What a solution?
I was updated gradle to 5.4.1... no results.. Error again
k

kpgalligan

06/24/2019, 12:34 PM
Might need to add mavenCentral repo
f

Fail

06/24/2019, 12:37 PM
Yes, it's have
My gradle:
Copy code
buildscript {
    repositories {
        google()
        mavenCentral()
    }
  
    dependencies {
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.40"
        classpath "org.jetbrains.kotlin:kotlin-serialization:1.3.40"
        classpath 'com.squareup.sqldelight:gradle-plugin:1.1.3'

    }
}

plugins {
    id 'kotlin-multiplatform' version '1.3.40'
}
...
apply plugin: 'com.squareup.sqldelight'
...
sqldelight {
    MyDatabase {
        packageName = "ru.trendagent.database"
        sourceFolders = ["sqldelight"]
    }
}


android {
   ...
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat-v7:28.0.0'
    implementation 'com.android.support.constraint:constraint-layout:1.1.3'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
}

kotlin {
    def coroutine_version = "1.3.0-M1"
    def ktor_version = "1.2.2"
    def serializer_version = "0.11.1"
    
    android("android")
library for iPhone device
    iosX64("ios") {
        binaries {
            framework {
                freeCompilerArgs.add("-Xobjc-generics")
            }
        }
    }
    sourceSets {
        commonMain {
            dependencies {
                implementation kotlin('stdlib-common')
                implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core-common:$coroutine_version"
                implementation "org.jetbrains.kotlinx:kotlinx-serialization-runtime-common:$serializer_version"
                implementation "io.ktor:ktor-client-core:$ktor_version"
                implementation "io.ktor:ktor-client-logging:$ktor_version"
                implementation "io.ktor:ktor-client-json:$ktor_version"
                implementation "io.ktor:ktor-client-serialization:$ktor_version"
            }
        }
        ...
    }


}



// This task attaches native framework built from ios module to Xcode project
// (see iosApp directory). Don't run this task directly,
// Xcode runs this task itself during its build process.
// Before opening the project from iosApp directory in Xcode,
// make sure all Gradle infrastructure exists (gradle.wrapper, gradlew).
task copyFramework {
    def buildType = project.findProperty('kotlin.build.type') ?: 'DEBUG'
    def target = project.findProperty('kotlin.target') ?: 'ios'
    dependsOn kotlin.targets."$target".binaries.getFramework(buildType).linkTask

    doLast {

        def srcFile = kotlin.targets."$target".binaries.getFramework(buildType).outputFile
        def targetDir = getProperty('configuration.build.dir')
        copy {
            from srcFile.parent
            into targetDir
            include 'app.framework/**'
            include 'app.framework.dSYM'
        }
    }
}
k

kpgalligan

06/24/2019, 12:44 PM
That's your buidscript repos. From the error it looks like it finds gradle plugin. Also may need to enable metadata
Post other gradle files
f

Fail

06/24/2019, 12:59 PM
Metadatas enabled: settings.gradle:
Copy code
pluginManagement {
    resolutionStrategy {
        eachPlugin {
            if (requested.id.id == "kotlin-multiplatform") {
                useModule("org.jetbrains.kotlin:kotlin-gradle-plugin:${requested.version}")
            }
        }
    }
}
rootProject.name = 'MultiplatformTest'
enableFeaturePreview("GRADLE_METADATA") // IMPORTANT!
include ':app'
I have no other gradle files
4 Views