sentry-kotlin-multiplatform icon indicating copy to clipboard operation
sentry-kotlin-multiplatform copied to clipboard

Linker command failed error at XCode build time

Open oblakr24 opened this issue 1 year ago • 2 comments

Platform

Apple

Installed

CocoaPods

Version

0.9.0

Steps to Reproduce

Kotlin 2.0.20

project build.gradle.kts: kotlin("native.cocoapods") version "2.0.20" apply false

module build.gradle.kts:

kotlin("native.cocoapods") version "2.0.20"

pod setup:

    cocoapods {
        version = "1.0"
        name = "SentryKMP"

        specRepos {
            url("https://github.com/Kotlin/kotlin-cocoapods-spec.git")
        }
        pod("Sentry") {
            version = "~> 8.25"
            linkOnly = true
            extraOpts += listOf("-compiler-option", "-fmodules")
        }
    }

gradle.properties:

kotlin.apple.deprecated.allowUsingEmbedAndSignWithCocoaPodsDependencies=true

Expected Result

Project builds successfully.

Actual Result

Getting this error when trying to build (only happens if I import the Sentry classes and use them in my code, but not otherwise): Image

oblakr24 avatar Oct 05 '24 08:10 oblakr24

Same problem, waiting for a solution

D10NGYANG avatar Oct 05 '24 16:10 D10NGYANG

could you try sentry cocoa 8.36.0 with kotlin 2.0.21-RC?

are you on xcode 16?

buenaflor avatar Oct 05 '24 16:10 buenaflor

I am having the same issue with pod GoogleSignIn, waiting for a solution as well

misskbar avatar Oct 28 '24 03:10 misskbar

kotlin:2.0.21, sentry-kotlin-multiplatform:0.10.0, same issue

D10NGYANG avatar Oct 31 '24 03:10 D10NGYANG

podfile = project.file("../iosApp/Podfile")

add this file

# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'

target 'iosApp' do
  # Comment the next line if you don't want to use dynamic frameworks
  use_frameworks!
  platform :ios, '15.3' # The version should be the same as the one declared in the build.gradle.kts file
  pod 'composeApp', :path => '../composeApp'

  # Pods for iosApp
  # Others external dependencies used to import them in a Swift file
  # pod 'MQTTClient' # Not needed because I will use the lib in my Kotlin code and not in the Swift code

  # We need to have all pods at the SAME iOS version
  post_install do |installer|
    installer.pods_project.targets.each do |target|
      target.build_configurations.each do |config|
        config.build_settings["IPHONEOS_DEPLOYMENT_TARGET"] = "15.3"
      end
    end
  end
end

can run on iOS , but when I init sentry , get :

*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[Sentry.SentryReplayOptions setMaskAllText:]: unrecognized selector sent to instance 0x3031609b0'
*** First throw call stack:
(0x18ed407cc 0x18c0132e4 0x18ee468c8 0x18ecdeb08 0x18ecde430 0x10b0bf024 0x10b0bf848 0x10b0bf934 0x1097b1f94 0x10b0a3268 0x10b0a3300 0x10b0a33ec 0x1097b1f94 0x10b0be6cc 0x10b0be758 0x10b0be844 0x1097b1f94 0x10b0a2780 0x104105348 0x10b0c0384 0x10b0a2620 0x10b0be5fc 0x10b0bfb64 0x10b0a31a8 0x10b0a3080 0x10b0b6c20 0x108e42158 0x1097b6134 0x10965bbc4 0x1097b6220 0x1098e74ac 0x10990cbb4 0x10985825c 0x1097b6220 0x10965bdfc 0x1097b6220 0x1098dff3c 0x109910308 0x10a4e4640 0x10a4e53cc 0x10a4e549c 0x1097b33b0 0x10a4e3950 0x10a4e37ec 0x10a513a50 0x10a4f9ee0 0x10a5e5444 0x10a56594c 0x10a55a88c 0x10a55d034 0x10a55d15c 0x1097b69c0 0x10a5b915c 0x10a5b91f4 0x10a5b931c 0x1097b69c0 0x10a5af29c 0x10a5ae0e0 0x10a5b8c9c 0x10a5b7e88 0x10a5ba4a0 0x1914b1688 0x1907e7c28 0x1907e77b4 0x19083e914 0x1907bd7c4 0x19164c6a0 0x18ed236e4 0x18ed11910 0x18ed10fd4 0x18ed10830 0x1dacf01c4 0x191876eb0 0x1919255b4 0x193479f98 0x19345a664 0x19345d490 0x108dd857c 0x108dd862c 0x1b46feec8)
libc++abi: terminating due to uncaught exception of type NSException

D10NGYANG avatar Oct 31 '24 04:10 D10NGYANG

update Sentry to '8.39.0' can fix it

    cocoapods {
        version = "1.0"
        summary = "Some description for the Shared Module"
        homepage = "Link to the Shared Module homepage"
        // Make sure you use the proper version according to our Cocoa SDK Version Compatibility Table.
        ios.deploymentTarget = "15.3"
        podfile = project.file("../iosApp/Podfile")
        pod("Sentry") {
            version = "8.39.0"
            linkOnly = true
            extraOpts += listOf("-compiler-option", "-fmodules")
        }
        framework {
            baseName = "ComposeApp"
            isStatic = true
        }
    }

👍

D10NGYANG avatar Oct 31 '24 06:10 D10NGYANG

can you provide a repro sample where it doesnt work?

buenaflor avatar Dec 13 '24 13:12 buenaflor

closing as stale/solved, please respond with more details if you still experience problems with this

kahest avatar Mar 10 '25 19:03 kahest