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

Could not install in kotlin multiplatform project via cocoapods #23

Open
omkar-tenkale opened this issue Jun 10, 2024 · 1 comment
Open

Comments

@omkar-tenkale
Copy link

omkar-tenkale commented Jun 10, 2024

When I try to add this library to my kotlin multiplatform project, XCode build fails with error


    cocoapods {
        version = "1.0"
        summary = "Some description for a Kotlin/Native module"
        homepage = "Link to a Kotlin/Native module homepage"

        ios.deploymentTarget = "15.0"
        name = "MyCocoaPod"

        pod("razorpay-customui-pod"){
            version = "2.0.13"
            moduleName = "Razorpay"
            extraOpts += listOf("-compiler-option", "-fmodules") //refer https://kotlinlang.org/docs/native-cocoapods-libraries.html#with-custom-cinterop-options
        }

//        pod("razorpay-pod"){
//            version = "1.3.8"
//            moduleName = "Razorpay"
//            extraOpts += listOf("-compiler-option", "-fmodules") //refer https://kotlinlang.org/docs/native-cocoapods-libraries.html#with-custom-cinterop-options
//        }
    }

Error:


> Task :composeApp:cinteropRazorpayIosSimulatorArm64 FAILED

Exception in thread "main" java.lang.Error: /Users/omkar/Documents/.../mykmpapp/composeApp/build/cocoapods/synthetic/ios/build/Release-iphonesimulator/XCFrameworkIntermediates/razorpay-customui-pod/Razorpay.framework/Headers/Razorpay-Swift.h:398:2: error: unsupported Swift architecture

	at org.jetbrains.kotlin.native.interop.indexer.ModuleSupportKt.getModulesASTFiles(ModuleSupport.kt:80)

	at org.jetbrains.kotlin.native.interop.indexer.ModuleSupportKt.getModulesInfo(ModuleSupport.kt:15)

	at org.jetbrains.kotlin.native.interop.gen.jvm.MainKt.buildNativeLibrary(main.kt:564)

	at org.jetbrains.kotlin.native.interop.gen.jvm.MainKt.processCLib(main.kt:307)

	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)



FAILURE: Build failed with an exception.



* What went wrong:

Execution failed for task ':composeApp:cinteropRazorpayIosSimulatorArm64'.

> Process 'command '/Users/omkar/Library/Java/JavaVirtualMachines/corretto-21.0.2/Contents/Home/bin/java'' finished with non-zero exit value 1

@omkar-tenkale
Copy link
Author

Commenting out both "razorpay-pod" and "razorpay-customui-pod" blocks allows the build to succeed. However, I aim to use only the "razorpay-customui-pod" block.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant