Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to setup for iOS #4

Open
niyajali opened this issue Nov 25, 2024 · 1 comment
Open

Unable to setup for iOS #4

niyajali opened this issue Nov 25, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@niyajali
Copy link

Hi, I've created a common parcel class for all platforms and used this library for iOS parcelize, but I'm getting the error below while running the app.

common\Parcelize.kt
expect annotation class Parcelize()

expect interface Parcelable

expect annotation class IgnoredOnParcel()
iosMain\Parcelize.kt
actual typealias Parcelize = com.arkivanov.parcelize.darwin.Parcelize

actual typealias Parcelable = com.arkivanov.parcelize.darwin.Parcelable

@Target(AnnotationTarget.PROPERTY)
@Retention(AnnotationRetention.SOURCE)
actual annotation class IgnoredOnParcel actual constructor()
build.gradle.kts

/*
 * Copyright 2024 Mifos Initiative
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at https://mozilla.org/MPL/2.0/.
 *
 * See https://github.com/openMF/mobile-wallet/blob/master/LICENSE.md
 */
plugins {
    alias(libs.plugins.mifospay.kmp.library)
    alias(libs.plugins.kotlin.parcelize)
    alias(libs.plugins.darwin.parcelize)
}

android {
    namespace = "org.mifospay.common"
}

kotlin {

    listOf(
        iosX64(),
        iosArm64(),
        iosSimulatorArm64(),
    ).forEach {
        it.binaries.framework {
            export(libs.kermit.simple)
            export(libs.darwin.parcelize.runtime)
        }
    }

    sourceSets {
        commonMain.dependencies {
            implementation(libs.kotlinx.coroutines.core)
            api(libs.coil.kt)
            api(libs.coil.core)
            api(libs.coil.svg)
            api(libs.coil.network.ktor)
            api(libs.kermit.logging)
            api(libs.squareup.okio)
            api(libs.jb.kotlin.stdlib)
            api(libs.kotlinx.datetime)
        }

        androidMain.dependencies {
            implementation(libs.kotlinx.coroutines.android)
        }
        commonTest.dependencies {
            implementation(libs.kotlinx.coroutines.test)
        }
        iosMain.dependencies {
            api(libs.kermit.simple)
            api(libs.darwin.parcelize.runtime)
        }
        desktopMain.dependencies {
            implementation(libs.kotlinx.coroutines.swing)
            implementation(libs.kotlin.reflect)
        }
        jsMain.dependencies {
            api(libs.jb.kotlin.stdlib.js)
            api(libs.jb.kotlin.dom)
        }

       //  iosX64Main.get().dependsOn(iosMain.get())
       //  iosArm64Main.get().dependsOn(iosMain.get())
       //  iosSimulatorArm64Main.get().dependsOn(iosMain.get())
    }
}

 * Source files: Constants.kt, CurrencyFormatter.kt, DataState.kt, DataStateExtensions.kt, DateHelper.kt, DebugUtil.kt, FileUtils.kt, MifosDispatchers.kt, NavArgsConstants.kt, Parcelize.kt, DispatchersModule.kt, StringExtensions.kt, CurrencyFormatter.native.kt, FileUtils.native.kt, Parcelize.kt, DispatchersModule.native.kt

 * Compiler version: 2.0.21

 * Output kind: LIBRARY

Compilation failed: Required value was null.

	at com.arkivanov.parcelize.darwin.UtilsKt.require(Utils.kt:282)

	at com.arkivanov.parcelize.darwin.DefaultSymbols.<init>(Symbols.kt:139)

	at com.arkivanov.parcelize.darwin.ParcelizeGenerationExtension.generate(ParcelizeGenerationExtension.kt:14)

	at org.jetbrains.kotlin.fir.pipeline.ConvertToIrKt.applyIrGenerationExtensions(convertToIr.kt:442)

	at org.jetbrains.kotlin.fir.pipeline.Fir2IrPipeline.runActualizationPipeline(convertToIr.kt:246)

	at org.jetbrains.kotlin.fir.pipeline.Fir2IrPipeline.convertToIrAndActualize(convertToIr.kt:130)

	at org.jetbrains.kotlin.fir.pipeline.ConvertToIrKt.convertToIrAndActualize(convertToIr.kt:99)

	at org.jetbrains.kotlin.fir.pipeline.ConvertToIrKt.convertToIrAndActualize$default(convertToIr.kt:72)

Build iosApp_2024-11-25T23-24-56.txt

@niyajali niyajali changed the title Unable run on iOS Unable to setup for iOS Nov 25, 2024
@arkivanov
Copy link
Owner

Looks like it's unable to reference kotlin.ULong. The plugin is still on Kotlin 1.9.22, but you are using 2.0.21. I think the plugin needs to be updated first, not sure if I have capacity for this at the moment. Please consider using kotlinx-serialization.

@arkivanov arkivanov added the enhancement New feature or request label Nov 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants