I can't understand why I am getting this error > io.ktor.client.call.NoTransformationFoundExcept...
c

Chad Gregory

over 2 years ago
I can't understand why I am getting this error
io.ktor.client.call.NoTransformationFoundException: No transformation found: class io.ktor.utils.io.ByteBufferChannel (Kotlin reflection is not available) -> interface java.util.List (Kotlin reflection is not available)
Here is the JSON with information redacted
[
  {
    "item": "*Redacted*",
    "description": "*Redacted*",
    "style_code": "",
    "job_number": "*Redacted*",
    "job_quantity": "*Redacted Number*",
    "pcs_hour": "*Redacted Number*",
    "start_date": "2022-10-05 07:30:00.000",
    "due_date": "2022-10-06 00:00:00.000",
    "wo_num": "*Redacted*",
    "wo_line": "*Redacted*",
    "bom": [
      {
        "comp_item": "*Redacted*",
        "comp_qty": "*Redacted Number*",
        "comp_uom": "LB",
        "operation": "10",
        "type": "*Redacted*"
      },
      {
        "comp_item": "*Redacted*",
        "comp_qty": "1.000000",
        "comp_uom": "EA",
        "operation": "10",
        "type": "*Redacted*"
      },
      {
        "comp_item": "*Redacted*",
        "comp_qty": "1.000000",
        "comp_uom": "EA",
        "operation": "10",
        "type": "*Redacted*"
      }
    ]
  }
]
and here is the DataClass
@Serializable
data class Job (
    val item: String = "",
    val description: String = "",
    @SerialName("style_code")
    val styleCode: String = "",
    @SerialName("job_number")
    val jobNumber: Int = 0,
    val machine: String = "",
    @SerialName("job_quantity")
    val jobQuantity: Int = 0,
    @SerialName("pcs_hour")
    val pcsHour: Double = 0.0,
    @SerialName("start_date")
    val startDate: String = "",
    @SerialName("due_date")
    val dueDate: String = "",
    @SerialName("wo_num")
    val woNum: String = "",
    @SerialName("wo_line")
    val woLine: String = "",
    @SerialName("machine_state")
    val machineState: Int = 0,
    @SerialName("machine_state_timestamp")
    val machineStateTimestamp: String = "",
    @SerialName("first_five_good")
    val firstFiveGood: Int = 0,
    @SerialName("production_quantity")
    val productionQuantity: Int = 0,
    @SerialName("scrap_quantity")
    val scrapQuantity: Int = 0,
    val additional: AdditionalInformation = AdditionalInformation(),
    val bom: List<BOM> = emptyList()
) {
    val bomMutable: MutableList<BOM> = bom.toMutableList()
}

@Serializable
data class BOM(
    @SerialName("comp_item")
    val compItem: String = "",
    @SerialName("comp_qty")
    val compQty: String = "",
    @SerialName("comp_uom")
    val compUom: String = "",
    val operation: String = "",
    val type: String = ""
)
and here is the code that get the data for the api
client.get(GroovRoutes.GET_JOBS){
                headers {
                    append("apiKey", apiKey)
                }
            }.body()
Can any one help me out here?
getting an unusual not seen before error when compiling my KMP project in Xcode: ```> Task :compose...
p

Pete Hellyer

over 1 year ago
getting an unusual not seen before error when compiling my KMP project in Xcode:
> Task :composeApp:cinteropInteropIosArm64 FAILED
Exception in thread "main" java.lang.Error: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS17.4.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObjCRuntime.h:615:74: error: unknown type name 'NSUInteger'
	at org.jetbrains.kotlin.native.interop.indexer.UtilsKt.ensureNoCompileErrors(Utils.kt:275)
	at org.jetbrains.kotlin.native.interop.indexer.IndexerKt.indexDeclarations(Indexer.kt:1246)
	at org.jetbrains.kotlin.native.interop.indexer.IndexerKt.buildNativeIndexImpl(Indexer.kt:1229)
	at org.jetbrains.kotlin.native.interop.indexer.IndexerKt.buildNativeIndexImpl(Indexer.kt:1225)
	at org.jetbrains.kotlin.native.interop.gen.jvm.DefaultPlugin.buildNativeIndex(Plugins.kt:33)
	at org.jetbrains.kotlin.native.interop.gen.jvm.MainKt.processCLib(main.kt:311)
	at org.jetbrains.kotlin.native.interop.gen.jvm.MainKt.processCLibSafe(main.kt:243)
	at org.jetbrains.kotlin.native.interop.gen.jvm.MainKt.access$processCLibSafe(main.kt:1)
	at org.jetbrains.kotlin.native.interop.gen.jvm.Interop.interop(main.kt:101)
	at org.jetbrains.kotlin.cli.utilities.InteropCompilerKt.invokeInterop(InteropCompiler.kt:47)
	at org.jetbrains.kotlin.cli.utilities.MainKt.mainImpl(main.kt:23)
	at org.jetbrains.kotlin.cli.utilities.MainKt.main(main.kt:45)
Any pointers?