ios - XCFramework by way of Cococpods depending on different XCFramework pods causes crash - codesanitize
-2.6 C
New York
Wednesday, January 8, 2025

ios – XCFramework by way of Cococpods depending on different XCFramework pods causes crash


So I’ve a framework i have to distribute closed supply so I created an XCFramework from it.

I’ve a guardian framework, lets name it FrameworkA, it has a dependency of Framework B, Framework C, and Framework D. Framework B additionally has a dependency on Framework C. I created this chart to assist illustrate:

enter image description here

Im utilizing a dependency supervisor to hyperlink all of this and I want so as to add Cocoapods help (SPM is a separate situation) so this framework can be utilized by RN builders too, so I created some podspecs.

Instance of how podspecs are structured

Pod::Spec.new do |s|
  s.identify             = "ParentFramework"
  s.model          = "1.0.0"
  s.abstract          = "ParentFramework Abstract"
  s.description      = "ParentFramework description"
  s.homepage         = "http://instance.com/"
  s.license          = "Non-public"
  s.creator           = { "Instance" => "[email protected]" }
  s.supply           = { :http => 'https://instance.com/ParentFramework.xcframework.zip' }

  s.platform     = :ios, '16.4'
  s.requires_arc = true
  s.swift_version = '5.0'

  s.dependency 'MyFrameworkB'
  s.dependency 'MyFrameworkC'

  s.vendored_frameworks="ParentFramework.xcframework"

finish
Pod::Spec.new do |s|
  s.identify             = "MyFrameworkB"
  s.model          = "1.0.0"
  s.abstract          = "MyFrameworkB Abstract"
  s.description      = "MyFrameworkB description"
  s.homepage         = "http://instance.com/"
  s.license          = "Non-public"
  s.creator           = { "Instance" => "[email protected]" }
  s.supply           = { :http => 'https://instance.com/MyFrameworkB.xcframework.zip' }

  s.platform     = :ios, '16.4'
  s.requires_arc = true
  s.swift_version = '5.0'

  s.dependency 'MyFrameworkC'

  s.vendored_frameworks="MyFrameworkB.xcframework"

finish

and MyFrameworkC would appear to be

Pod::Spec.new do |s|
  s.identify             = "MyFrameworkC"
  s.model          = "1.0.0"
  s.abstract          = "MyFrameworkC Abstract"
  s.description      = "MyFrameworkC description"
  s.homepage         = "http://instance.com/"
  s.license          = "Non-public"
  s.creator           = { "Instance" => "[email protected]" }
  s.supply           = { :http => 'https://instance.com/MyFrameworkC.xcframework.zip' }

  s.platform     = :ios, '16.4'
  s.requires_arc = true
  s.swift_version = '5.0'

  s.vendored_frameworks="MyFrameworkC.xcframework"

finish

when i add MyFrameworkA to my podfile it can efficiently retrieve MyFrameworkB and my venture will compile and that i can use public/open properties and strategies from my frameworks. When i attempt to compile i get the next error:

dyld[99145]: Image not discovered: _$s14MyFrameworkBE16myFrameworkBMethod7request6resultyAD03AddhI7RequestC_ys6ResultOyAA15GenericResponseCs5Error_pGctF
  Referenced from: <1DA0CCF4-9E68-31D5-AEE0-F007A3D478B5> /Customers/myname/Library/Developer/CoreSimulator/Gadgets/F95AE061-9472-49BE-A4C4-CDD0513BDC1E/information/Containers/Bundle/Software/C1E7F412-2683-4F93-9625-FB1E86FF6470/TestApp.app/Frameworks/MyFrameworkB.framework/MyFrameworkB
  Anticipated in:     <57DF18F9-9F16-3DC5-B464-AAB4BFA5F0B0> /Customers/myname/Library/Developer/CoreSimulator/Gadgets/F95AE061-9472-49BE-A4C4-CDD0513BDC1E/information/Containers/Bundle/Software/C1E7F412-2683-4F93-9625-FB1E86FF6470/TestApp.app/Frameworks/MyFrameworkC.framework/MyFrameworkC

What am i lacking to make this all work?

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest Articles