8000 使用过程中找不到 ClockHandRotationKit · Issue #5 · TopWidgets/SwingAnimation · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

使用过程中找不到 ClockHandRotationKit #5

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
hamstudio opened this issue Jan 23, 2024 · 0 comments
Open

使用过程中找不到 ClockHandRotationKit #5

hamstudio opened this issue Jan 23, 2024 · 0 comments

Comments

@hamstudio
Copy link

我在使用过程中遇到两个问题:

  1. 使用 SPM 集成的情况下,我发现我必须在宿主 App 的 Link Binary with Libraries 中添加 SwingAnimation,否则,在运行小组件的时候,会提示找不到 ClockHandRotationKit:
dyld[18266]: Library not loaded: @rpath/ClockHandRotationKit.framework/ClockHandRotationKit
  Referenced from: /private/var/containers/Bundle/Application/ED21F8A4-CCBE-429D-9019-70193AF27BF0/MyHostApp.app/PlugIns/MyWidgetExtension.appex/MyWidgetExtension
  Reason: tried: '/usr/lib/swift/ClockHandRotationKit.framework/ClockHandRotationKit' (no such file), 

'/private/var/containers/Bundle/Application/ED21F8A4-CCBE-429D-9019-70193AF27BF0/MyHostApp.app/PlugIns/MyWidgetExtension.appex/Frameworks/ClockHandRotationKit.framework/ClockHandRotationKit' (no such file),
 '/private/var/containers/Bundle/Application/ED21F8A4-CCBE-429D-9019-70193AF27BF0/MyHostApp.app/PlugIns/MyWidgetExtension.appex/../../Frameworks/ClockHandRotationKit.framework/ClockHandRotationKit' (no such file),
 '/usr/lib/swift/ClockHandRotationKit.framework/ClockHandRotationKit' (no such file), 

'/private/var/containers/Bundle/Application/ED21F8A4-CCBE-429D-9019-70193AF27BF0/MyHostApp.app/PlugIns/MyWidgetExtension.appex/Frameworks/ClockHandRotationKit.framework/ClockHandRotationKit' (no such file), 
'/private/var/containers/Bundle/Application/ED21F8A4-CCBE-429D-9019-70193AF27BF0/MyHostApp.app/PlugIns/MyWidgetExtension.appex/../../Frameworks/ClockHandRotationKit.framework/ClockHandRotationKit' (no such file),
 '/System/Library/Frameworks/ClockHandRotationKit.framework/ClockHandRotationKit' (no such file)

但是,如果我在宿主 App 中添加了这个的话,由于我们的 App 需要支持iOS 12和iOS 13,在这些设备上运行就会crash:

dyld: warning: could not load inserted library '/System/Library/PrivateFrameworks/GPUToolsCapture.framework/GPUToolsCapture' into hardened process because image not found
dyld: Library not loaded: /System/Library/Frameworks/WidgetKit.framework/WidgetKit
  Referenced from: /private/var/containers/Bundle/Application/7A3242AE-A045-4377-BC7D-9875D932ACBB/WDBuyerUniv.app/Frameworks/ClockHandRotationKit.framework/ClockHandRotationKit
  Reason: image not found

此外,由于众所周知的原因,SPM 的包经常拉不下来,于是,我就将它制作成 pod:

Pod::Spec.new do |s|
  s.name             = 'MySwingAnimation'
  s.version          = '0.1.0'
  s.summary          = 'A short description of MySwingAnimation.'

  s.description      = <<-DESC
TODO: Add long description of the pod here.
                       DESC

  s.homepage         = 'https://gitlab.xxxx.net/xxx/MySwingAnimation'
  s.license          = { :type => 'MIT', :file => 'LICENSE' }
  s.author           = { 'xxx' => 'xx@xxx.com' }
  s.source           = { :git => 'ssh://git@gitlab.xxxx.net/xxx//MySwingAnimation.git', :tag => s.version.to_s }

  s.ios.deployment_target = '12.0'

  s.source_files = 'MySwingAnimation/Classes/**/*'
  s.swift_versions = ['5.1', '5.2', '5.3', '5.4', '5.5','5.9']

  s.vendored_frameworks = 'Frameworks/ClockHandRotationKit.xcframework'
  
  s.xcconfig = { 'EXCLUDED_ARCHS' => 'armv7','BUILD_LIBRARY_FOR_DISTRIBUTION' => 'YES' }
  s.attributes_hash['extended'] ||= {'cocoapods-binary-source-swithcer' => '~> 1.0.0', "is_xcframework" => "true"}
end

打包成 XCFramewwork 之后,针对小组件引入依赖 MySwingAnimation , 运行时还是出现了类似的错误:

dyld[18355]: Library not loaded: @rpath/ClockHandRotationKit.framework/ClockHandRotationKit
  Referenced from: /private/var/containers/Bundle/Application/429403CF-8F9D-4CE4-B98D-4D856A5692D2/MyHostApp.app/PlugIns/MyWidgetExtension.appex/MyWidgetExtension
  Reason: tried: '/usr/lib/swift/ClockHandRotationKit.framework/ClockHandRotationKit' (no such file), 
  '/private/var/containers/Bundle/Application/429403CF-8F9D-4CE4-B98D-4D856A5692D2/MyHostApp.app/PlugIns/MyWidgetExtension.appex/Frameworks/ClockHandRotationKit.framework/ClockHandRotationKit' (no such file),
   '/private/var/containers/Bundle/Application/429403CF-8F9D-4CE4-B98D-4D856A5692D2/MyHostApp.app/PlugIns/MyWidgetExtension.appex/../../Frameworks/ClockHandRotationKit.framework/ClockHandRotationKit' (no such file),
    '/usr/lib/swift/ClockHandRotationKit.framework/ClockHandRotationKit' (no such file),
     '/private/var/containers/Bundle/Application/429403CF-8F9D-4CE4-B98D-4D856A5692D2/MyHostApp.app/PlugIns/MyWidgetExtension.appex/Frameworks/ClockHandRotationKit.framework/ClockHandRotationKit' (no such file), 
  '/private/var/containers/Bundle/Application/429403CF-8F9D-4CE4-B98D-4D856A5692D2/MyHostApp.app/PlugIns/MyWidgetExtension.appex/../../Frameworks/ClockHandRotationKit.framework/ClockHandRotationKit' (no such file), 
  '/System/Library/Frameworks/ClockHandRotationKit.framework/ClockHandRotationKit' (no such file)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant
0