-
-
Notifications
You must be signed in to change notification settings - Fork 19
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
A problem occurred configuring project ':kmp'. > Sentry Cocoa Framework not found at /user/path/.../ #318
Comments
hey, this is definitely a docs issue and an error message issue, you have to add the Sentry-Cocoa dependency via SPM first if you use a regular framework. we should mention it in the error message as well |
I added Sentry SPM dependency to the iosApp and the problem persists. I also tried with Sentry-Dynamic and the result is the same. |
Seems to only start working if I add the cocoapods plugin but according to this comment it shouldn't be needed |
@franmontiel if you add the cocoapods plugin it will work because our gradle plugin detects this and installs the sentry-cocoa dependency via the cocoapods plugin. can you show your kmp gradle config? in case you changed something
|
The Here the gradle file as it is failing right now import org.jetbrains.kotlin.gradle.dsl.JvmTarget
plugins {
alias(libs.plugins.kotlinMultiplatform)
alias(libs.plugins.androidLibrary)
id("io.sentry.kotlin.multiplatform.gradle") version "0.10.0"
}
kotlin {
androidTarget {
compilations.all {
compileTaskProvider.configure {
compilerOptions {
jvmTarget.set(JvmTarget.JVM_1_8)
}
}
}
}
listOf(
iosX64(),
iosArm64(),
iosSimulatorArm64()
).forEach {
it.binaries.framework {
baseName = "shared"
isStatic = false
}
}
sourceSets {
commonMain.dependencies {
//put your multiplatform dependencies here
}
commonTest.dependencies {
implementation(libs.kotlin.test)
}
}
}
android {
namespace = "io.bridify.sentrytest"
compileSdk = 35
defaultConfig {
minSdk = 24
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
}
|
Thanks! I was able to reproduce it. The issue is that in newer versions the sentry-cocoa artifacts changed the folder names
turned into
I will add a fix for this |
If you want to try it out for now you can for example use the sentry-cocoa version |
With version For what I am understanding we required the Sentry library to be build in a specific folder location (that I believe it does not coincide with the XCode default build folder). Could that be the cause? I tried moving my DerivedData folder to a different place and using |
I tested it locally on a new project with by default the gradle plugin will use the xcodeproj to determine where the build folder is located via if for some reason that deviates you'll need to update the can you paste here the location where the framework is by default? (before you moved it) |
This is were the error message says it is looking for the frameworks
No matter where I configure Derived data and build folders location that it will always show me those locations in the error. It could mean that the code that find the frameworks is faulty or for some reason the error message is using a different path. This is for me the default derived data folder were I can find the frameworks:
|
I am also thinking, it is DerivedData folder reliable to depend on? Could it happen that the folder is deleted and we might end-up in a catch-22 situation where KMP project needs the framework files but those are not build because KMP part is failing? |
yeah that doesn't look right can you execute |
if you update or reload the SPM package dependencies that should restore the framework files without you needing to actually compile the project in any case this is a best effort solution since there is no official support for a Kotlin SPM plugin right now. if you manually set up the SDK you would also have to do these steps -> find the framework location and set up linking manually |
BUILD_DIR = /Users/fj/AndroidStudioProjects/SentryTest/iosApp/build That's really weird, as if I check it from XCode it is inside DerivedData folder. By the way, in my case, the SourcePackages is not in the build folder but in the DerivedData folder |
hmm looks like this is the issue, on my end in the output are there any other fields that point to the derived data? we might be able to use those as a fallback |
For what I see there is no value that points to the DerivedData folder. For the moment to make it work without needing to change my project configuration to use Cocoapods I've done the following:
sentryKmp {
autoInstall {
linker {
frameworkPath.set(rootProject.file("iosApp/Frameworks/").absolutePath)
}
}
}
@buenaflor could you please let me know when the plugin is fixed so I can be able to use the latest version of the library? Thanks so much for your help |
thanks for the info I will look into a way to get the derived data path reliably and fix the folder name missmatch that way you can use a higher cocoa version as well Unlikely though that a fix will be out this week, most likely next monday |
@franmontiel do you mind sending me the output of |
email sent. |
update: I'm working on the fix as we speak, I'll see to it that it's out soon |
Just a quick note here, sentry-kmp 0.10.0 is NOT compatible with sentry-cocoa 8.37.0 due to (atleast one) renamed api You have to use sentry-kmp 0.9.0 with sentry-cocoa 8.36.0 for now. |
Thanks for the info, yes right now until I release the gradle plugin fix I recommend this combination |
@franmontiel just published 0.11.0, could you try out if it fixes the problem |
Hi @buenaflor! Thank you for your work on this library. I've tested out 0.11.0 and it doesn't fix the issue for me on iOS 😔 The app crashes when launching right after building (debug mode) with the following error:
|
@remarkjt can you share your gradle config |
Here's my build.gradle.kts with sensitive info replaced with placeholders and irrelevant lines removed.
|
Platform
Apple
Installed
None
Version
0.1.0
Steps to Reproduce
Expected Result
Sentry is added to my KMP project and let me build it.
Actual Result
Cannot sync gradle, the following error appears:
A problem occurred configuring project ':shared'.
The text was updated successfully, but these errors were encountered: