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

Linker command failed error at XCode build time #278

Open
oblakr24 opened this issue Oct 5, 2024 · 7 comments
Open

Linker command failed error at XCode build time #278

oblakr24 opened this issue Oct 5, 2024 · 7 comments
Labels
Platform: KMP Type: Bug Something isn't working

Comments

@oblakr24
Copy link

oblakr24 commented Oct 5, 2024

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

@D10NGYANG
Copy link

Same problem, waiting for a solution

@buenaflor
Copy link
Contributor

buenaflor commented Oct 5, 2024

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

are you on xcode 16?

@buenaflor buenaflor moved this from Needs Discussion to Needs More Information in Mobile & Cross Platform SDK Oct 7, 2024
@misskbar
Copy link

misskbar commented Oct 28, 2024

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

@D10NGYANG
Copy link

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

@D10NGYANG
Copy link

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
Copy link

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
        }
    }

👍

@buenaflor
Copy link
Contributor

can you provide a repro sample where it doesnt work?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Platform: KMP Type: Bug Something isn't working
Projects
Status: Needs More Information
Development

No branches or pull requests

4 participants