I have successfully setup a continuous delivery for an iOS framework. it compiles the project from the repo and created an output Project.framework file, but when I integrate the framework with an iOS app project it failed with error message like this: âSwift Compiler Error: Missing required modules: âAlamofireâ, âCommonCryptoâ, âSwinjectââ, which I use for internal dependency in the framework.
But strangely, when I compile the framework with my local computer, the output framework can be integrated well and is working fine as expected.
After do some digging with this framework output, I found out there is some slight difference on the fat library using this command:
lipo -detailed_info Project.framework/Project
The output from Bitrise:
Fat header in: Project.framework/Project
fat_magic 0xcafebabe
nfat_arch 4
architecture i386
cputype CPU_TYPE_I386
cpusubtype CPU_SUBTYPE_I386_ALL
offset 4096
size 920480
align 2^12 (4096)
architecture x86_64
cputype CPU_TYPE_X86_64
cpusubtype CPU_SUBTYPE_X86_64_ALL
offset 925696
size 959136
align 2^12 (4096)
architecture armv7
cputype CPU_TYPE_ARM
cpusubtype CPU_SUBTYPE_ARM_V7
offset 1900544
size 2296452
align 2^14 (16384)
architecture arm64
cputype CPU_TYPE_ARM64
cpusubtype CPU_SUBTYPE_ARM64_ALL
offset 4210688
size 2296000
align 2^14 (16384)
The output from local:
Fat header in: Project.framework/Project
fat_magic 0xcafebabe
nfat_arch 4
architecture i386
cputype CPU_TYPE_I386
cpusubtype CPU_SUBTYPE_I386_ALL
offset 4096
size 931936
align 2^12 (4096)
architecture x86_64
cputype CPU_TYPE_X86_64
cpusubtype CPU_SUBTYPE_X86_64_ALL
offset 937984
size 970592
align 2^12 (4096)
architecture armv7
cputype CPU_TYPE_ARM
cpusubtype CPU_SUBTYPE_ARM_V7
offset 1916928
size 2296680
align 2^14 (16384)
architecture arm64
cputype CPU_TYPE_ARM64
cpusubtype CPU_SUBTYPE_ARM64_ALL
offset 4227072
size 2296224
align 2^14 (16384)
Notice the different size and offset.
Both bitrise and my computer seems to have same version for each spec:
- xcodebuild -version. => Xcode 9.4.1 Build version 9F2000
- xcrun -version => xcrun version 43.
- xcodeproj --version => 1.5.9
- xcode-select --version => xcode-select version 2349.
- carthage version => 0.30.1
The command I use to compile the project is this:
carthage update --no-build --platform ios && carthage build --no-skip-current --platform ios
Is there any step I missed to make sure it compiles the same output?
Thanks
[[ UPDATE ]]
Turns out there is something I missed in the first place.
So, I wanted to create a library using Carthage dependency manager and planned to make it available for CocoaPods using the binary and private repository. The error âSwift Compiler Error: Missing required modules: âAlamofireâ, âCommonCryptoâ, âSwinjectâ caused by missing dependency in the Pofile of the app.
I guess the size of each architecture doesnât matter.