I was trying to run ./gradlew build
on my kotlin multiplatform project, however the build failed with this error. It seems like the SQLDelight Event database could not be generated.
e: Compilation failed: Front-end Internal error: Failed to analyze declaration Event
File being compiled: (5,1) in /Users/ts-yongkang.chia/Desktop/vikilitics-mobile/shared/build/generated/sqldelight/code/VikiliticsDatabase/com/viki/vikilitics/db/Event.kt
The root cause org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException was thrown at: org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException.invalidWireType(InvalidProtocolBufferException.java:99)
* Source files: Event.kt, EventQueries.kt, VikiliticsDatabase.kt, VikiliticsDatabaseImpl.kt, EventSender.kt, VikiliticsConfig.kt, EventDb.kt, BatchLogger.kt, EventLogger.kt, EventLoggerFactory.kt, SingleLogger.kt, stringToMap.kt, EventLoggerFactory.kt
* Compiler version info: Konan: 1.5.10 / Kotlin: 1.5.10
* Output kind: LIBRARY
The full log file can be viewed on https://gist.github.com/ExtremelySunnyYK/5d237b6e2ef387837cd3dbc40bddf50d
Before I integrated the ios part of the kmp(kotlin multiplatform) project, the android only portion of kmp was building well and the Event Database was generated.
But after I integrated the ios portion with id("com.chromaticnoise.multiplatform-swiftpackage") version "2.0.3"
from
https://johnoreilly.dev/posts/kotlinmultiplatform-swift-package/
The build now fails with the error org.jetbrains.kotlin.protobuf.InvalidProtocolBufferException.invalidWireType(InvalidProtocolBufferException.java:99)
Here are my dependencies version
- Gradle Version : 7.1
- Kotlin Gradle Plugin : 1.5.0
- Android Build Gradle : 4.2
- SQL Delight : 1.5.0
- Android Studio 4.2 Build #AI-202.7660.26.42.7322048, built on April 29, 2021, macOS 10.15.7
I have tried downgrading my android studio version, downgrading gradle version to 6.8 but i have received the same error.