Tuesday, February 27, 2024
HomeiOS Developmentios - Cocoapods Library not loaded with a number of frameworks when...

ios – Cocoapods Library not loaded with a number of frameworks when testing


Its a bit tough scenario however I will attempt to clarify.

I am utilizing cocoapods and a number of frameworks in my venture. For my easy instance there are frameworks:

Mission MegaWolf with two targets:

Mission Rooster with two targets:

Additionally there’s a pod 'Meals', '2.4' in cocoapods.


MegaWolf have to import Rooster. So in Frameworks and Libraries in MegaWolf goal there may be Rooster with Don't embed possibility.

To MegaWolfTests there are two linked issues – MegaWolf.framework and Pods_Name.framework (autogenerated by pods framework).

Rooster have to import Meals. It is making through cocoapods.

In podfile:

use_frameworks!
inhibit_all_warnings!
workspace 'AnyName.xcworkspace'

goal 'Rooster' do
  platform :ios, $platformVersion
  venture 'Frameworks/Rooster/Rooster.xcodeproj'

  pod 'Meals', '2.4'

  goal 'ChickenTests' do
    pod 'Meals', '2.4'
  finish
finish

Once I construct frameworks to run every thing works.

Once I check ChickenTests every thing works.

But when I check MegaWolfTests it is throw an error in runtime: Library not loaded: @rpath/Meals.framework/Meals. However MegaWolf and MegaWolfTests not utilizing import Meals. They solely import Rooster.

I attempted to use_frameworks! :linkage => :static for goal ‘Rooster’. However I’ve a number of targets and had to make use of static many instances. The exams began to work properly. However when making an attempt to archive there was an error a number of instructions produce Meals that I could not resolve. So if there are >1 linkage => :static with identical pod for various targets – the archive failed.

I’ve tried use_modular_headers! as an alternative of linkage => :static. It convey identical error in runtime Library not loaded.

Evidently chain: MegaWolfTests <- MegaWolf <- Rooster <- Meals

I am unable to perceive the right way to remedy that linking drawback. Any recommendation appreciated.



Supply hyperlink

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments