IOS pod install gcm and pnchartswift

I am using PNChartSwift and GCM in my project. I need to use "use_frameworks!" for PNChartSwift in PodFile, so for GCM I shouldn't use "use_frameworks!" in PodFile

How do I use gcm?

Pod install log error

Using PNChartSwift (0.0.2)
Using STZPopupView (1.0.1)
[!] The 'Pods' target has transitive dependencies that include static binaries: (/Users/Sina/Desktop/MyShatelIOS/MyShatel/Pods/GGLInstanceID/Libraries/libGGLInstanceIDLib.a, /Users/Sina/Desktop/MyShatelIOS/MyShatel/Pods/Google/Libraries/libGGLCloudMessaging.a, /Users/Sina/Desktop/MyShatelIOS/MyShatel/Pods/Google/Libraries/libGGLCore.a, /Users/Sina/Desktop/MyShatelIOS/MyShatel/Pods/GoogleCloudMessa

      

0


source to share


1 answer


Unfortunately, it is not possible to mix static and dynamic libraries, it's all or nothing.

Instead, I suggest you use the original Obj-C PNChart version , which will solve your problem with GCM.

This means that your podfile will look something like this:

pod "PNChart"
pod "Google/CloudMessaging"

      

The only thing you need to do differently when importing PNChart

is add a gentle header importing these libraries. This will make them available anywhere in the code. It will look something like this:

#import <PNChart.h>
#import <Google/CloudMessaging.h>

      


UPDATE 1:



Answer to OP's question on how to identify static / dynamic.


Usually:

  • All dependencies written in Swift are dynamic structures.
  • All dependencies written in Obj-C are static libraries.

Apple does not allow static libraries containing Swift to be created, so the first statement will always be true. The second statement is a bit tricky, as Apple has built many dynamic backend frameworks in Obj-C before. This capability was not available to third-party developers until iOS 8 (at the same time as Swift was released), so don't expect any new structures written in Obj-C to be dynamic as they can also be written to Swift.

Now we are just in a stage of "uncertainty" in the transition between the two languages. In 1-2 years, hopefully most of the third party dependencies will be written in Swift and we don't need to worry about things like static / dyanmic.

If you're interested, you can read about it on the official CocoaPods blog post for the 0.36 release .

0


source







All Articles