@slavenski
Android developer

Как подключить SqlDelight driver в Multiplatform Kotlin Library?

Добрый день, хочу написать простенькую ORM на Kotlin Native. Создаю проект в студии Multiplatform Library. Нашел драйвер SqlDelight. По документации пытаюсь установить его. Но ничего не выходит.
Вот мой gradle.wrapers:
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

build.gradle:
plugins {
    id 'org.jetbrains.kotlin.multiplatform' version '1.3.41'
}

repositories {
    google()
    mavenCentral()
}

group 'com.example.test'
version '0.0.1'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'maven-publish'
apply plugin: 'com.squareup.sqldelight'

archivesBaseName = 'store-item'

configurations {
    compileClasspath
}
kotlin {
    jvm()

    sourceSets {
        commonMain {
            dependencies {
                implementation kotlin('stdlib-common')
            }
        }
        commonTest {
            dependencies {
                implementation kotlin('test-common')
                implementation kotlin('test-annotations-common')
            }
        }
        jvmMain {
            dependencies {
                implementation kotlin('stdlib-jdk8')
                implementation "com.squareup.sqldelight:sqlite-driver:1.1.4"
            }

        }
        jvmTest {
            dependencies {
                implementation kotlin('test')
                implementation kotlin('test-junit')
            }
        }
    }
}

Gradle ругается: Plugin with id 'com.squareup.sqldelight' not found.
  • Вопрос задан
  • 298 просмотров
Решения вопроса 1
@impostor
Добрый день. Попробуйте до этих строк
plugins {
    id 'org.jetbrains.kotlin.multiplatform' version '1.3.41'
}


Добавить эти строки

buildscript {
    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath "com.squareup.sqldelight:gradle-plugin:1.1.3"
    }
}
Ответ написан
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы