Open shoaoki-arent opened 5 months ago
Hi are you able to compile? I am not able to compile even.
@shoaoki-arent
this is the output i am getting on Xcode 15.
A shell task (/usr/bin/xcrun lipo -create /Users/sourabhsingh/Library/Caches/org.carthage.CarthageKit/DerivedData/15.2_15C500b/Eureka/5.5.0/Build/Intermediates.noindex/ArchiveIntermediates/Eureka/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/Eureka.framework/Eureka /Users/sourabhsingh/Library/Caches/org.carthage.CarthageKit/DerivedData/15.2_15C500b/Eureka/5.5.0/Build/Products/Release-iphonesimulator/Eureka.framework/Eureka -output /Users/sourabhsingh/Documents/NEWSDK/19june2024/INSCameraSDK/Carthage/Build/iOS/Eureka.framework/Eureka) failed with exit code 1: fatal error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/lipo: /Users/sourabhsingh/Library/Caches/org.carthage.CarthageKit/DerivedData/15.2_15C500b/Eureka/5.5.0/Build/Intermediates.noindex/ArchiveIntermediates/Eureka/IntermediateBuildFilesPath/UninstalledProducts/iphoneos/Eureka.framework/Eureka and /Users/sourabhsingh/Library/Caches/org.carthage.CarthageKit/DerivedData/15.2_15C500b/Eureka/5.5.0/Build/Products/Release-iphonesimulator/Eureka.framework/Eureka have the same architectures (arm64) and can't be in the same fat output file
Building universal frameworks with common architectures is not possible. The device and simulator slices for "Eureka" both build for: arm64
Please ignore my comments I am able to successfully run the example app.
@sssuourabh Thank you for your comment. I found it difficult to run the sample app, so I decided not to proceed with it. I already have an older version of the INSCameraSDK embedded in my app, so I thought it would be sufficient to just replace it.
By the way, the sample app seems to be embedding a .framework
instead of an .xcframework
, so I don't think it provides any hints for solving the second point in my comment.
@shoaoki-arent actually i figured out how to run the sample app. I haven't used in my app till now. if you need any help on running the sample app drop me a message. Thanks
@sssuourabh Thank you very much.
When you have some time, could you please let me know what you did to get the sample app running? I'm sure it will be helpful to others as well.
Here’s what I have done so far: I tried fixing the path to the framework in the Frameworks directory (I couldn't find NSLogger.framework).
After that, I'm encountering the following error with Eureka. It might be because I am using Xcode 15.2. However, this is the result of testing on a simulator, and the result may be different on a real device.
Compiled module was created by a different version of the compiler '5.9.0.128.108'; rebuild 'Eureka' and try again: /Users/{username}/Library/Developer/Xcode/DerivedData/INSCameraSDKSample-bluetooth-bnxikozjplyitngpcnkyktrpwnet/Index.noindex/Build/Products/Debug-iphoneos/Eureka.framework/Modules/Eureka.swiftmodule/arm64-apple-ios.swiftmodule
Hi, Please follow these steps - In cartfile please update this - binary "https://ios-releases.insta360.com/INSCoreMedia.json" == 1.25.30 github "xmartlabs/Eureka" ~> 5.5
after that go to folder and run carthage update --use-xcframeworks
Just select the framework here and map to right address in right pane selecting the file. Go to build phase and check there is duplicate file addition of appdelegate and NSData+Hex remove them.
Ensure this in embed frameworks in build phase
Hi @shoaoki-arent! I also have Xcode 15.2. As @sssuourabh suggested, you need to update the Cartfile. I also noticed that you have both INSCoreMedia.xcframework and INSCoreMedia.framework. You only need one of them. I removed NSLogger.framework entirely, and everything compiles for me.
@sssuourabh @ravilich86 Thank you very much. I appreciate both of your assistance. I successfully managed to build on the actual device. I was struggling with errors, but after extracting the sample project again and starting over from the beginning, it worked out perfectly. Thank you for the wonderful tip!
P.S. I understand that it is pointless since we are working with an real camera, but when trying to build on the simulator, I encountered an error in INSCameraSDK.xcframework indicating something like "no build for the simulator." Therefore, I have given up on running it on the simulator.
@shoaoki-arent To have a universal framework, you'd need to build another simulator target. This can be an empty target in Xcode with sdk set to iphonesimulator
. Then, you'd have to create a new xcframework
from both architecture.
The resulting xcframework
should contain these files:
Info.plist
ios-arm64
ios-arm64_x86_64-simulator
Although I wish Insta360 would just provide a proper INSCameraSDK.xcframework
and INSCoreMedia.xcframework
with universal architecture for us 😄
@jessearmandse Thank you for the information. Does it actually work in the simulator, or is it solely intended to ensure a successful build?
It's just to ensure a successful build. I guess you could also just link it on Apple Silicon machine, and bypass the simulator entirely.
hi @jessearmandse can you please provide more info on this - https://github.com/Insta360Develop/CameraSDK-iOS/issues/40#issuecomment-2185851367 Need to create a fat binary to build on ios simulator also. @shoaoki-arent @kelvinhkw @capjason
@shoaoki-arent To have a universal framework, you'd need to build another simulator target. This can be an empty target in Xcode with sdk set to
iphonesimulator
. Then, you'd have to create a newxcframework
from both architecture.The resulting
xcframework
should contain these files:Info.plist ios-arm64 ios-arm64_x86_64-simulator
Although I wish Insta360 would just provide a proper
INSCameraSDK.xcframework
andINSCoreMedia.xcframework
with universal architecture for us 😄
@jessearmandse can you please help regarding this? Need to submit build!
The process is not different from the official docs here: Creating a multi platform binary framework bundle
You'd just need to archive the simulator target, then create xcframework from the simulator archived framework and the arm64
framework.
But we don't have the code of INSCameraSDK framework. so how to create an empty target in Xcode with sdk set to iPhonesimulator.? or what are steps to ensure your Xcode project has a scheme that builds only the framework target and its dependencies.? @jessearmandse
You don't need the code to create xcframework, all you need is the binary. The Xcode project has no dependencies, it's just an empty target. You can add any code you want it doesn't matter. All it matters is it's a simulator architecture. Also don't misunderstood this process as running Insta360 SDK on a simulator, this is just to create an xcframework that contains both architecture.
Yes you are correct i am little confused. So my steps should be i create a new project with name of INSCameraSDK with
and then archive it as mentioned in - https://developer.apple.com/documentation/xcode/creating-a-multi-platform-binary-framework-bundle and then use INSCameraSDK from InstaExample to create a xcframework.? Or any other technique please tell me if possible. @jessearmandse
Yup, change the destination appropriately as described there. If the docs are not clear enough, you can refer to this:
How to create xcframework that contains iOS + iOS Simulator platforms
But, basically the fundamentals are already there in Apple docs
okay so do i have to do for both INSCameraSDK ans INSCoreMedia both? @jessearmandse
Ahmm, INSCoreMedia
need a preliminary step to extract the x86_64
architecture, and once you have the arm64
binary, do the same step as INSCameraSDK
Please, read up on why this is the case from Apple official docs for more details, and how I came up with this process. The steps that I did here is not official recommended steps, and depends on your project needs.
Ideally, Insta360 should create this xcframework with both archs. I simply could not wait for them to do so.
https://github.com/Insta360Develop/CameraSDK-iOS/issues/40#issuecomment-2213131040
@jessearmandse i tried this then when i combined and tried build in Simulator in app it says all headers missing from framework. Sometimes it didn't successfully create xcArchives. Please help me if possible, it's urgent. Thanks in advance.
HI @jessearmandse Started by creating a new Project and selecting an Framework with same name as INSCameraSDK and INSCoreMedia.
i have created xcframework successfully for both INSCameraSDK and INSCoreMedia. Before creating xcframework for INSCoreMedia i have extracted the architecture x86_64 from library.
`lipo -remove x86_64 "
Steps to create Xcframework for INSCameraSDK and INSCoreMediaSDK
created 2 archives - iPhoneOS and iphoneSimulator
for iPhoneArchive - copied contents of INSTA360example ->Frameworks -> INSCameraSDK.framework -> contents (Headers, Info.plist, INSCameraSDK, Modules) to iPhoneOS.archive -> Products .> Library -> Frameworks -> INSCameraSDK.framework.
and for iPhoneSimulator archive copied contents of INSTA360example ->Frameworks -> INSCameraSDK.framework -> contents (Headers) -> to iPhoneSimulator.archive -> Products .> Library -> Frameworks -> INSCameraSDK.framework. -> Headers.
REPEated same for INSCoreMediaSDK but i am still having an error. i am sending you the zip file with new xcframeworks. Please have a look. https://drive.google.com/file/d/18sYAe1tQ6b1TqU9yK9HmoI_irRry8EkF/view?usp=sharing Please have a look @jessearmandse
Hi any updates?
I have integrated the Framework from what appears to be the latest SDK version, INSCameraSDKSample-3.0.4_403, into my project. Upon building, I encountered the following issues. Could these issues be specific to my environment?
Previously, I used INSCameraSDK.xcframework and INSCoreMedia.framework from INSCameraSDK-SampleOC-2.9.43_388, and these warnings were not present. Also, INSCoreMedia is a framework, not an xcframework.