How to silence Xcode 11.4 warnings about MobileCoreServices and AssetsLibrary?
Asked Answered
A

3

15

After upgrading to Xcode 11.4 beta I've got those warnings from Pods subproject (specifically, from YYImage and Branch targets):

Target Integrity: MobileCoreServices has been renamed. Use CoreServices instead.

Target Integrity: AssetsLibrary is deprecated. Consider migrating to Photos instead.

I have inhibit_all_warnings! in my Podfile, but it has no effect on those.

Is there a way to silence those warnings until the creators of those pods will fix them?

Adriel answered 11/2, 2020 at 5:8 Comment(3)
Change podspec's dependencies section, change MobileCoreServices to CoreServicesEpiclesis
This can help if you're willing to fork pod's repository, but AFAIK, there is no way to patch Podspec with Cocoa Pods install hooks.Adriel
I'm having the same issue stemming from a 3rd party library that isn't coming in as a Pod. I really need a way to just be able to turn off that specific warning, but it doesn't seem to exist.Hedonism
A
11

I noticed that manually removing those two frameworks from Pods/Frameworks/iOS project navigator group resolves those warnings. Since both frameworks embedded into iOS itself (not app bundle) removing them doesn't have any effect at runtime. Here is how to do it automatically in Podfile post-install hook:

post_install do |installer|
    installer.pods_project.frameworks_group["iOS"]["MobileCoreServices.framework"].remove_from_project
    installer.pods_project.frameworks_group["iOS"]["AssetsLibrary.framework"].remove_from_project
end

If this leaves a hanging (null) reference, you can do something like:

post_install do |installer|
    framework = installer.pods_project.frameworks_group["iOS"]["MobileCoreServices.framework"]
    framework.referrers.each do |ref|
        if ref.isa == "PBXBuildFile"
            ref.remove_from_project
        end
    end
    framework.remove_from_project
end
Adriel answered 19/3, 2020 at 1:45 Comment(0)
P
4

For mute this warning:

  1. Open Pod target's Build Settings
  2. Select Build Options
  3. Add framework (e.g. AssetsLibrary) to Validate Workspace - Ignored Frameworks

enter image description here

Pathological answered 2/7, 2020 at 10:19 Comment(0)
E
0

change platform :ios, '13.0' to platform :ios, '11.0' in iOS/Podfile

worked like a charm for me!

Earwax answered 21/12, 2021 at 16:3 Comment(1)
Thanks for tuning in, but changing your deployment target just to silence a warning is not a very good idea.Adriel

© 2022 - 2024 — McMap. All rights reserved.