Build size has increased after including alibaba short video sdk - alibaba-cloud

I used alibaba short video editing pod. Due which build size has increased more than 30 MB.
How can I reduce build size.
Below is the pods used.
pod 'AlivcCore', :path => 'AlivcCore/'
pod 'AlivcRecord', :path => 'AlivcRecord/'
pod 'AlivcEdit', :path => 'AlivcEdit/'```

Related

How do I access a branch via a Podfile's source statement?

Scenario: I have a source which by default is the master branch of that source. I want to be able to access a custom branch.
platform :ios, '11.0'
#use_modular_headers!
source 'https://gitw.RicSite.com/digital/mobile/ios/NativeApps/Fast/Ric-Cocoapods.git', :branch => 'AlamoFire/5.4.2'
source 'https://github.com/CocoaPods/Specs.git'
The 'source' doesn't allow for an extra parameter: 'branch'.
But I don't want to access the 'master' (default) until I merge.
Is there a solution?
Try
pod 'YourPod', :git=> 'https://gitw.RicSite.com/digital/mobile/ios/NativeApps/Fast/Ric-Cocoapods.git', :branch=> 'AlamoFire/5.4.2'
for the pod you need. This is how I do this

How to specify a username for a private pod

I am setting up a private pod that will be used across our team. In my podfile I have something like:
pod 'MySDK', :git => 'https://myusername#bitbucket/...git'
Is there a way to replace myusername with the username that downloaded the current project.
I can get the current username by parsing the url from
git config --get remote.origin.url
Plan B is to make a script that modifies the podfile before running pod install. I am curious if I can make it without this extra step?
This is what I came up, below is part of my podfile
#try to keep the current git user in the pod url
remoteUrl = %x|git config --get remote.origin.url|
username = remoteUrl.scan(/[A-Z0-9._%+-]+#[A-Z0-9.-]+\.[A-Z]{2,4}/i).first
podUrl = "https://#{username}/mycompany/myrepo.git"
puts podUrl
pod 'MySDK', :git => podUrl, :commit => 'commitid'
Works great for me! Respect to all cocopods devs that made it so customizable!

pod install error: The name of the given podspec `Yoga` doesn't match the expected one `yoga`

I'm getting the following error while doing pod install.
The name of the given podspec `Yoga` doesn't match the expected one `yoga`
Inside the Podfile these are the only lines with the word yoga and they are in lowercase...so I don't know what's causing this problem..
pod 'yoga',
:path => "../node_modules/react-native/ReactCommon/yoga",
:inhibit_warnings => true
How to solve?
It looks like it should be pod 'Yoga'. See https://github.com/facebook/react-native/blob/master/ReactCommon/yoga/Yoga.podspec#L18
When you .podfile pod '<name>' is not equal .podspec <variable>.name = "name" you get
The name of the given podspec `<name>` doesn't match the expected one

How can I silence warnings from all pods except local pods?

I'm assuming something along the lines of
post_install do |installer|
# Debug symbols
installer.pod_project.targets.each do |target|
target.build_configurations.each do |config|
if ? == ?
config.build_settings['?'] = '?'
end
end
end
end
I encountered a similar problem today and figured out two ways to achieve this depending on the complexity of your dependencies.
The first way is simple and should work if your local development pods are in your main pod file and not nested in another dependency. Basically inhibit all the warnings as per usual, but specify false on each local pod:
inhibit_all_warnings!
pod 'LocalPod', :path => '../LocalPod', :inhibit_warnings => false
pod 'ThirdPartyPod',
The second way which is more comprehensive and should work for complex nested dependencies is by creating a whitelist of your local pods and then during post install, inhibit the warnings of any pod that is not part of the whitelist:
$local_pods = Hash[
'LocalPod0' => true,
'LocalPod1' => true,
'LocalPod2' => true,
]
def inhibit_warnings_for_third_party_pods(target, build_settings)
return if $local_pods[target.name]
if build_settings["OTHER_SWIFT_FLAGS"].nil?
build_settings["OTHER_SWIFT_FLAGS"] = "-suppress-warnings"
else
build_settings["OTHER_SWIFT_FLAGS"] += " -suppress-warnings"
end
build_settings["GCC_WARN_INHIBIT_ALL_WARNINGS"] = "YES"
end
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
inhibit_warnings_for_third_party_pods(target, config.build_settings)
end
end
end
This will now only inhibit 3rd party dependencies but keep the warnings on any local pods.
Podfile Solution
While ignore_all_warnings is an all or none proposition, you can :inhibit_warnings => true on any individual pod in the Podfile.
# Disable warnings for each remote Pod
pod 'TGPControls', :inhibit_warnings => true
# Do not disable warnings for your own development Pod
pod 'Name', :path => '~/code/Pods/'
There's CocoaPods plugin, https://github.com/leavez/cocoapods-developing-folder that has inhibit_warnings_with_condition. Citing the README:
🔸 Inhibit warnings for specific pods
Add the following to your podfile
plugin 'cocoapods-developing-folder'
inhibit_warnings_with_condition do |pod_name, pod_target|
# your condition written in ruby, like:
# `not pod_name.start_with? "LE"` or
# `['Asuka', 'Ayanami', 'Shinji'].include? pod_name`
end
pod_target is a instance of Pod::PodTarget class, containing many more
info than the name. You can use it to set up complex rules.
This function will override the warning inhibition settings by the
original methods, like: inhibit_all_warnings!, pod 'Ayanami',
:inhibit_warnings => true
So if you know the names of the local pods you can filter them like shown in the above example. Or you can try something like this (that tries to exploit the fact that local pods are not under Pods directory):
inhibit_warnings_with_condition do |pod_name, pod_target|
pod_target.file_accessors.first.root.to_path.start_with? pod_target.sandbox.root.to_path
end
Beware that, if I get the last statement there correctly, it will rule out inhibit_all_warnings! and :inhibit_warnings from effect (I checked the implementation and it looks like it's indeed the case). So you can not use both inhibit_warnings_with_condition and inhibit_all_warnings! or :inhibit_warnings, but at the end, that kind of makes sense.

RestKit 0.2 not logging

I'm updating my app to use RestKit 0.2pre3, but on the process I lost the logging system that RestKit provides, it simply doesn't show anything anymore. I use cocoapods to install RestKit.
This is my Podfile
platform :ios , '5.1'
pod 'SSPullToRefresh'
pod 'MBProgressHUD'
pod 'Facebook-iOS-SDK'
pod 'TestFlightSDK'
pod 'SDWebImage'
pod 'KISSmetrics'
pod 'CustomBadge'
pod 'GoogleAnalytics-iOS-SDK'
pod 'JSONKit'
pod 'LibComponentLogging-Core'
pod 'LibComponentLogging-LogFile'
pod 'LibComponentLogging-qlog'
pod 'LibComponentLogging-pods'
pod 'RestKit/Testing'
pod 'RestKit'
pod 'OHAttributedLabel'
And, of course, in my code I'm calling
RKLogConfigureByName("RestKit", RKLogLevelTrace);
RKLogConfigureByName("RestKit/Network", RKLogLevelTrace);
RKLogConfigureByName("RestKit/CoreData", RKLogLevelDebug);
I can even make successful request and get objects mapped, but I can't watch what is my server returning, how the mapping process is performed or anything and this is vital.
I think the problem is that something is misconfigured in LCL but I can't find any clues about it.
Any ideas where the problem could be?
After a long debugging I found that LCL now comes with a set of default configurations and on LCLLogFileConfig.h I had:
// Tell LCLLogFile whether it should mirror the log messages to stderr.
#define _LCLLogFile_MirrorMessagesToStdErr /* (BOOL) */ \
NO
I set it to YES and now everything is working fine.
This behavior is caused by the following 2 pods in the Podfile:
pod 'LibComponentLogging-pods'
pod 'LibComponentLogging-LogFile'
The LibComponentLogging-pods pod causes an integration of RestKit's logging with the LibComponentLogging files which are installed via the Podfile, e.g. RestKit's log components can now be configured via the standard lcl_configure... configuration functions and RestKit will use the log writer which is configured via the Podfile (instead of its built-in log writer).
The LibComponentLogging-LogFile pod chooses the file-based log writer for LibComponentLogging. By default, this log writer doesn't mirror its messages to stderr. _LCLLogFile_MirrorMessagesToStdErr in LCLLogFileConfig.h can be used to change this behavior.

Resources