-
Notifications
You must be signed in to change notification settings - Fork 21
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
Cocoapod: podspec validation fails when using Kermit-crashlytics #207
Comments
Follow-up on this, I've decided to drop usage of kermit-crashlytics and go for a mixed approach of
I don't think kermit-crashlytics is a good approach in the end since Crashlytics dependency is not stated in the podspec in the end and breaks delivery via Cocoapods podspec. |
Sorry, missed this. Brought up just now. In summary, if anybody is searching for this, you'd probably have to put something like
https://kotlinlang.org/docs/native-cocoapods-libraries.html#from-the-cocoapods-repository Cinterop is rather tricky with 3rd party libs and linking. We used to do what Napier does, which is tell you to pass in lambdas to avoid the whole thing, but then we went down the cinterop route (for better or worse). |
Of course, you might have to specify the pod version in Kotlin, which can be frustrating to any iOS team consuming it, because now you're forcing versions on them, but depends on the situation. |
Summary
We are unable to publish our xcframework via cocoapods plugin when integrating kermit-crashlytics
Details
Based on KMMBridgeSample we have reproduced the same module hierarchy to build our KMM module.
We have a main module for iOS that wraps other modules:
We link everything together in a static xcframework for iOS. and publish it via kmmbridge:
We want to add non-fatal reporting for our KMM side and discovered kermit-crashlytics.
We are already using Crashlytics on the native side so we want Crashlytics dependency to be resolved when our KMM module is embedded in our app.
Following Kermit documentation, packaging our xcframework went well. But we encountered an issue when publishing our podspec.
After publishing our xcframework as a Github Release artifact via KMMBridge, Cocoapods tries to validate it before pushing the new podspec.
Validation consists of creating a project, importing the framework and compiling the project.
And here we have an issue, since podspec has no reference to Crashlytics, linking fails due to unresolved symbols.
Reproduction
./gradlew pushRemotePodspec -PGITHUB_PUBLISH_TOKEN=<token> -PGITHUB_REPO=<repo> --no-daemon --stacktrace
Expected result
Podspec can be pushed and we can integrate our module in our app via Podfile
Current state
Publication is blocked with the following error:
We can take the xcframework and drop it in our app manually but this is not ideal (framework is versionned in our repo, error prone manipulation)
Possible Fix
I am currently looking around Cocoapods plugin DSL to inject information in the generated podspec.
I'm trying to add compiler_flags, or specify Crashlytics dependency without using the pod() command since I do not want Crashlytics embedded in our static framework.
Something like that : touchlab/CrashKiOS#46
Another way would be to be able to skip this validation step (--skip-import-validation), but this could hide other issues later on.
Another idea would be to write the podspec manually and to specify a spec.dependency on Crashlytics.
So far I'm stuck and I'm opening this issue to see if I missed something.
Notes
PS1: Thank you for your work, your samples have really helped us along the way so far in setting up a complex KMM module.
PS2: I am opening an issue here since my error is during publication but I may be wrong and should open this in kermit-crashlytics repo instead. Let me know
The text was updated successfully, but these errors were encountered: