gpt4 book ai didi

ios - 在多个应用程序中使用cocoa touch Framework项目

转载 作者:行者123 更新时间:2023-11-29 00:01:27 26 4
gpt4 key购买 nike

我有两个带有大量冗余代码的ios应用程序,因此我决定将此代码提取到共享的cocoa touch框架中,并在RayWenderlichs tutorial之后添加了此框架项目文件.
我还读了苹果Framework Programming Guide但我无法解决我的问题。

现在陈述:
这两个应用程序都可以在添加的框架下正常工作。

我的问题:
我无法使用目标通用 iOS 设备构建这两个应用程序,只能使用真实设备目标或模拟器。
但这两个应用程序都能够构建< em>Generic iOS Device 在添加框架项目之前。

这是我尝试使用目标 Generic iOS Device 构建时得到的输出:

希望的行为:
我希望应用程序和框架的行为就像 C# 或 Java 中的简单项目库一样。
我不明白为什么会出现这个错误。

Showing Recent Issues
Ld /Users/dkronenberger/Library/Developer/Xcode/DerivedData/VISUSDisplay-cwapquipviigpndwwktvfnqurbsq/Build/Intermediates.noindex/VISUSDisplay.build/Debug-iphoneos/VISUSDisplay.build/Objects-normal/armv7/VISUSRemote normal armv7
cd "/Users/dkronenberger/Documents/gitRepo/Mobile/VISUS/VISUS Display"
export IPHONEOS_DEPLOYMENT_TARGET=10.0
export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch armv7 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.2.sdk -L/Users/dkronenberger/Library/Developer/Xcode/DerivedData/VISUSDisplay-cwapquipviigpndwwktvfnqurbsq/Build/Products/Debug-iphoneos -L/Users/dkronenberger/Documents/gitRepo/Mobile/VISUS/VISUS\ Display -F/Users/dkronenberger/Library/Developer/Xcode/DerivedData/VISUSDisplay-cwapquipviigpndwwktvfnqurbsq/Build/Products/Debug-iphoneos -F/Volumes/SoftwaresAndMedia/Adnan\ Projects/VISUS\ Project/Visus/Visus -F/Applications/Xcode.app/Contents/Developer/Library/Frameworks -F/Users/dkronenberger/Documents/gitRepo/Mobile/VISUS/VISUS\ Display -filelist /Users/dkronenberger/Library/Developer/Xcode/DerivedData/VISUSDisplay-cwapquipviigpndwwktvfnqurbsq/Build/Intermediates.noindex/VISUSDisplay.build/Debug-iphoneos/VISUSDisplay.build/Objects-normal/armv7/VISUSRemote.LinkFileList -Xlinker -rpath -Xlinker @executable_path/Frameworks -miphoneos-version-min=10.0 -dead_strip -Xlinker -object_path_lto -Xlinker /Users/dkronenberger/Library/Developer/Xcode/DerivedData/VISUSDisplay-cwapquipviigpndwwktvfnqurbsq/Build/Intermediates.noindex/VISUSDisplay.build/Debug-iphoneos/VISUSDisplay.build/Objects-normal/armv7/VISUSRemote_lto.o -Xlinker -no_deduplicate -fobjc-arc -fobjc-link-runtime -lz -lstdc++ -framework GameKit -framework AudioToolbox -framework SystemConfiguration -framework Security -framework CFNetwork /Users/dkronenberger/Library/Developer/Xcode/DerivedData/VISUSDisplay-cwapquipviigpndwwktvfnqurbsq/Build/Products/Debug-iphoneos/ConnectionManager.framework/ConnectionManager -framework AVFoundation -framework CoreText -framework QuartzCore -lsqlite3.0 -framework UIKit -framework Foundation -framework CoreGraphics -Xlinker -dependency_info -Xlinker /Users/dkronenberger/Library/Developer/Xcode/DerivedData/VISUSDisplay-cwapquipviigpndwwktvfnqurbsq/Build/Intermediates.noindex/VISUSDisplay.build/Debug-iphoneos/VISUSDisplay.build/Objects-normal/armv7/VISUSRemote_dependency_info.dat -o /Users/dkronenberger/Library/Developer/Xcode/DerivedData/VISUSDisplay-cwapquipviigpndwwktvfnqurbsq/Build/Intermediates.noindex/VISUSDisplay.build/Debug-iphoneos/VISUSDisplay.build/Objects-normal/armv7/VISUSRemote

ld: warning: directory not found for option '-F/Volumes/SoftwaresAndMedia/Afelde Projects/VISUS Project/Visus/Visus'
ld: warning: ignoring file /Users/dkronenberger/Library/Developer/Xcode/DerivedData/VISUSDisplay-cwapquipviigpndwwktvfnqurbsq/Build/Products/Debug-iphoneos/ConnectionManager.framework/ConnectionManager, file was built for arm64 which is not the architecture being linked (armv7): /Users/dkronenberger/Library/Developer/Xcode/DerivedData/VISUSDisplay-cwapquipviigpndwwktvfnqurbsq/Build/Products/Debug-iphoneos/ConnectionManager.framework/ConnectionManager
Undefined symbols for architecture armv7:
"_OBJC_CLASS_$_ConnectionManager", referenced from:
objc-class-ref in AppDelegate.o
objc-class-ref in HomeViewController.o
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)



编辑:
我已经检查了架构验证 enter image description here

最佳答案

显然,您的框架 ConnectionManager.framework 尚未配置为编译 armv7 架构的代码。

您可以尝试更改 ConnectionManager 目标的配置设置:

  • 检查 Valid Architectures 是否包含所有变体:arm64armv7armv7s
  • 尝试将 Build Active Architecture Only 设置为 No 用于 DebugRelase 如果它仍然不起作用.

关于ios - 在多个应用程序中使用cocoa touch Framework项目,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49380903/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com