```buildscript { repositories { google...
# touchlab-tools
k
Copy code
buildscript {
    repositories {
        google()
        mavenCentral() //<-- This
        jcenter()
    }
    dependencies {
        classpath(Deps.android_gradle_plugin)
        classpath(Deps.SqlDelight.gradle)
        classpath(Deps.cocoapodsext)
        classpath("org.jetbrains.kotlin:kotlin-serialization:${Versions.kotlin}")

        classpath(kotlin("gradle-plugin", Versions.kotlin))
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build gradle files
    }
}
v
@kpgalligan really appreciate your prompt response. Yes indeed i added that mavenCentral and to classpath
Copy code
plugins {
    kotlin("native.cocoapods") version "1.4.10"
org.gradle.internal.exceptions.LocationAwareException: Build file '/Users/vballem/Documents/projects/PHILIPS/on/SleepPlus/SourceCode/Sleep-iOS/shared/Code/build.gradle.kts' line: 16 Plugin [id: 'co.touchlab.native.cocoapods'] was not found in any of the following sources:
the main idea is... i wanted to encrypt the DB in mulitplaform .. using the sqldelight plugin...
m also big fan of you Keven for ur contribution towards KMM .. following ur stuff closly 🙂
somehow , i could not able to crack this encryption part for ios
followed the KaMPKitSQLCipher sample...
works great for android.. but not for ios
k
kotlin("native.cocoapods") version "1.4.10"
That’s pointing at the JetBrains cocoapods plugin. We have a fork of that.
v
oh. sorry.. its id("co.touchlab.native.cocoapods")
Copy code
plugins {
    kotlin("multiplatform") version "1.4.10"
    kotlin("plugin.serialization") version "1.4.10"
    id("co.touchlab.native.cocoapods") 
}
my project is a kmm library template..not the style of kampkit
our teams wanted separate android /ios repos.. and kotlin-shared as a separate repo..
k
OH, that’ll probably make things tricky. Ihaven’t really looked at the KMM templates
v
thats the only difference i could see compared to
was using fine for the last one year
so tried once with kotlin("native.cocoapods") version "1.4.10"
Copy code
cocoapods {
    // Configure fields required by CocoaPods.
    summary = " Shared KMP"
    frameworkName = "shared"
    setVersion("0.0.1")
    pod("SQLCipher", "~> 4.0")
}
Copy code
implementation("co.touchlab:sqliter:0.7.1") {
    version {
        strictly("0.7.1")
    }
}
and passed the "key" to Native driver
but the error that i am getting is...
otlin.Exception: android/database/sqlite/SQLiteConstraintException - FOREIGN KEY constraint failed (code 787) at 0 Sleep+ 0x0000000105bc1dc7 kfun:kotlin.Throwable#<init>(kotlin.String?){} + 87 at 1 Sleep+ 0x0000000105bbb645 kfun:kotlin.Exception#<init>(kotlin.String?){} + 85 at 2 Sleep+ 0x0000000105cd9256 ThrowSql_SQLiteException + 566 at 3 Sleep+ 0x0000000105f707b2 _ZN7android23throw_sqlite3_exceptionEiPKcS1_ + 1234 at 4 Sleep+ 0x0000000105f70b1a _ZN7android23throw_sqlite3_exceptionEP7sqlite3PKc + 58 at 5 Sleep+ 0x0000000105f70d09 SQLiter_SQLiteConnection_nativeResetStatement + 41 at 6 Sleep+ 0x0000000105ce1151 kfun:co.touchlab.sqliter.NativeStatement#resetStatement(){} + 193 at 7 Sleep+ 0x0000000105ce098d kfun:co.touchlab.sqliter.NativeStatement#execute(){} + 349 at 8 Sleep+ 0x0000000105cd4da7 kfun:co.touchlab.sqliter.concurrency.ConcurrentDatabaseConnection.ConcurrentStatement#execute(){} + 519 at 9 Sleep+ 0x0000000105ce4c33 kfun:com.squareup.sqldelight.drivers.native.ConnectionWrapper.execute$lambda-0#internal + 547 at 10 Sleep+ 0x0000000105ce5684 kfun:com.squareup.sqldelight.drivers.native.ConnectionWrapper.$execute$lambda-0$FUNCTION_REFERENCE$141.invoke#internal + 100 at 11 Sleep+ 0x0000000105ce56f9 kfun:com.squareup.sqldelight.drivers.native.ConnectionWrapper.$execute$lambda-0$FUNCTION_REFERENCE$141.$<bridge-UNNN>invoke(-1:0){}#internal + 89 at 12 Sleep+ 0x0000000105ce3678 kfun:com.squareup.sqldelight.drivers.native.NativeSqliteDriver.accessConnection$lambda-6#internal + 232 at 13 Sleep+ 0x0000000105ce3d83 kfun:com.squareup.sqldelight.drivers.native.NativeSqliteDriver.$accessConnection$lambda-6$FUNCTION_REFERENCE$135.invoke#internal + 195 at 14 Sleep+ 0x0000000105ce8b0b kfun:com.squareup.sqldelight.drivers.native.SinglePool#access(kotlin.Function1<10,00>){0§<kotlin.Any?>}0:0 + 651 at 15 Sleep+ 0x0000000105ce2e91 kfun:com.squareup.sqldelight.drivers.native.NativeSqliteDriver#accessConnection(kotlin.Boolean;kotlin.Function1<com.squareup.sqldelight.drivers.native.ThreadConnection,0:0>){0§<kotlin.Any?>}0:0 + 833 at 16 Sleep+ 0x0000000105ce4714 kfun:com.squareup.sqldelight.drivers.native.ConnectionWrapper#execute(kotlin.Int?;kotlin.String;kotlin.Int;kotlin.Function1&lt;com.squareup.sqldelight.db.SqlPreparedStatement,kotlin val nativeDriver = NativeSqliteDriver( DatabaseConfiguration( name = DB_NAME, journalMode = journalMode, version = SleepPlusDatabase.Schema.version, foreignKeyConstraints = true, create = { connection -> wrapConnection(connection) { println("FAFA db creation") SleepPlusDatabase.Schema.create(it) } }, upgrade = { connection, oldVersion, newVersion -> wrapConnection(connection) { println("FAFA db wrap migration") SleepPlusDatabase.Schema.migrate(it, oldVersion, newVersion) } } ,key = "somekey" ) )