Getting error while adding SwiftKafka using package manager in Swift. Got error like undefined symbol. I have to added target in targets array in package manage package file but still getting error.
How to use swiftKafka library in swift?
Assuming you're writing an app not for macOS, then Kafka cannot be used with mobile applications, mostly because of network switching.
If that is your goal, you should look into alternatives like the Confluent REST Proxy, and use HTTP calls to its API instead.
Related
I have seemingly 2 libraries that are interfering with each other in regards to their usage of SSL.
One is the Tuya SDK which is added via CocoaPods, and the other is a locally added library, for which I don't have the source code.
When the locally added library tries to use SSL, I get a 'EXC_BAD_ACCESS' error, so there is clearly a conflict. (When I run the local library in a separate isolated project on its own, the SSL works fine.)
Is there any way in Swift to specify to only use one of the SSL files? (So that both Tuya and the local library will use the same, single SSL file).
For example I think you can do this in Android with Gradle, using the FirstPick() Packaging Options{}?
This is for Firebase 6.26.0 and 6.27.0 (I've tried both for reasons that will become clear)
I have a Swift application I'm trying to decompose into modules from its current monolith, but so far I have not been able to expose Firebase classes across the modules (i.e frameworks) by installing Firebase pods in each individual module. It will only work when there is only one existing library, and when that library is installed in the application target, where it is instantiated in AppDelegate.
Does anyone know if it's possible to implement Firebase across multiple modules in a single workspace?
Expected results
That Firebase classes will be exposed to all modules in a multi-module Swift application, with one or more copies of the Firebase library present, allowing all modules to call Firebase methods and implement Firebase classes within a single, global instance of FirebaseApp.
Actual results
Either Firebase refuses to instantiate because of the presence of more than one Firebase library in the workspace, or, when only one library is present, Firebase classes cannot be exposed to other modules in the workspace.
What I've done
Installed individual Firebase pods in every module requiring them. On launch I got this error:
.
The default FirebaseApp instance must be configured before the defaultFirebaseApp instance can be initialized
.
According to an answer from a Firebase team member on another StackOverflow post, this is caused by the presence of more than one Firebase library in the workspace.
Installed only one pod to create a "FirebaseProxy" module that both the application target and all other modules could share. By using typealiases and extensions I was able to let classes implement Firebase classes without having to be exposed to the actual Firebase library, for example:
import Firebase
public typealias FirebaseUserProxy = Firebase.User
public extension FirebaseUserProxy {}
So this way an implementing class could use the Firebase.User type by using FirebaseUserProxy instead, and without having to be directly exposed to the Firebase library.
.
However, there were some proxied classes that still seemed to require being exposed to the full library. (My brain is a bit addled from dealing with all this so I've forgotten exactly which ones, I believe it was FirebaseApp.) But even using #_exposed import Firebase in the proxy definition didn't do the trick, and I only got the message Missing required module 'Firebase'.
Same solution as in #2, but using use_frameworks! :linkage => :static in my Podfile. No luck. And yes, I did try using $(SRCROOT)/Stat in my frameworks search paths build settings.
Finally I tried integrating the library directly into my project without using Cocoapods. Here I was using 6.26.0 since the Firebase download link with a 6.27.0 in the URL resulted in a Not Found message, so I manually changed it to 6.26.0 and that downloaded fine
.
I installed the library in the application and in another module, hoping that somehow this method would obscure each library from the other, but ended up with the same error message as in #1... The default FirebaseApp...
.
I also tried using the proxy method from #2, but that resulted in the same error.
.
I had to set :linkage => :static in my Podfile so the installed pods would play nicely with the integrated library. Turning it off resulted in an error.
Alternatives
If I can't get this to work, I may have to refactor my code so that the Firebase-dependent code exists in the application itself instead of a standalone framework module. This would not impact functionality, but it would break the architecture and make the code a good deal more convoluted and brittle.
There is a solution on the Firebase git repo (that I haven't tried), that suggests reverting back to v.6.15.0. I am reluctant to do this though since the most recent release is at 6.27.0 and I don't want to be unable to upgrade and risk using an older version that later releases will undoubtedly break eventually.
Finally
It's disappointing that such a widely used and vital tool can only be used in monolith applications, basically limiting developers to a single, often suboptimal, type of architecture. Have I missed something? Maybe. It wouldn't be the first time. But if anyone can light the way out of my dilemma I would be happy to buy you a beer, and given the current social distancing regulations, consume it on your behalf.
RDP static library works fine if I comment out the code written for OPentok, if I try to work both together it gives BAD_Access Error at run time.
Its possible that there are incompatibilities between the SSL library versions used in each. OpenTok uses boringssl, which happens to export symbol names that are identical to those in openssl.
The project I am working in is a Swift project. I needed to import a Objective C library and installation was only available (advertised) through 'CocoaPods'. I proceeded and installed the required library and built a bridging header.
Now for some reason I have a single random error deep in one of the files in the library. I'm 99% sure this is a problem with my set up as I can't find anyone else using Braintree (a rather popular payment service by PayPal) with the same problem.
Any ideas?
This looks like a consequence of overriding NSObject's description whose definition changed in iOS 8. (See http://www.redwindsoftware.com/blog/post/2014/08/20/NSObject-has-some-new-properties-in-iOS-8.aspx). Is there a more recent release of this library available for you to use?
I am working on a barcode scanner app and would like to integrate ZXingObjC library to my app because ZXing is the only free library that supports data matrix scanning. I have gone through its README file and tried to integrate the library. But its giving some weird errors like "Multiple methods named “encode” found with mismatched result, parameter type or attributes".
So I thought may be those are ARC problems and tried to convert it to ARC but no luck. It is throwing so many errors!!
I am still struggling with integrating this library. It will be really helpful if anyone can help me on this.
The reason stands behind this answer:Defeating the "multiple methods named 'xxx:' found" error.
Please have a look and try casting objects before calling those methods accordingly.