Skip to content
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

Linker error when using ApolloSQLite with bitcode enabled #498

Closed
mochimoshi opened this issue Apr 4, 2019 · 1 comment
Closed

Linker error when using ApolloSQLite with bitcode enabled #498

mochimoshi opened this issue Apr 4, 2019 · 1 comment

Comments

@mochimoshi
Copy link

#475 was merged recently, which made Apollo + ApolloSQLite compatible on Xcode 10.2. However, this also included changes in build settings to explicitly enabling Bitcode and setting Bitcode generation modes on physical iOS devices in Apollo and ApolloSQLite in Configuration/Shared/Workspace-Universal-Framework.xcconfig. This leads to a linker error:

Ld ~/Library/Developer/Xcode/DerivedData/SampleProject/Build/Products/Debug-iphoneos/ApolloSQLite.framework/ApolloSQLite normal arm64 (in target: ApolloSQLite)
    cd ~/base/SampleProject/Data/OpenSource/apollo-ios
    export IPHONEOS_DEPLOYMENT_TARGET=9.0
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch arm64 -dynamiclib -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS12.2.sdk -L ~/Library/Developer/Xcode/DerivedData/SampleProject/Build/Products/Debug-iphoneos -F~/Library/Developer/Xcode/DerivedData/SampleProject/Build/Products/Debug-iphoneos -F~/Library/Developer/Xcode/DerivedData/SampleProject/Build/Products/Debug-iphoneos -filelist ~/Library/Developer/Xcode/DerivedData/SampleProject/Build/Intermediates.noindex/ApolloSQLite.build/Debug-iphoneos/ApolloSQLite.build/Objects-normal/arm64/ApolloSQLite.LinkFileList -install_name @rpath/ApolloSQLite.framework/ApolloSQLite -Xlinker -rpath -Xlinker /usr/lib/swift -Xlinker -rpath -Xlinker @executable_path/Frameworks -Xlinker -rpath -Xlinker @loader_path/Frameworks -miphoneos-version-min=9.0 -dead_strip -Xlinker -object_path_lto -Xlinker ~/Library/Developer/Xcode/DerivedData/SampleProject/Build/Intermediates.noindex/ApolloSQLite.build/Debug-iphoneos/ApolloSQLite.build/Objects-normal/arm64/ApolloSQLite_lto.o -Xlinker -export_dynamic -Xlinker -no_deduplicate -fembed-bitcode -Xlinker -bitcode_verify -Xlinker -bitcode_hide_symbols -Xlinker -bitcode_symbol_map -Xlinker ~/Library/Developer/Xcode/DerivedData/SampleProject/Build/Products/Debug-iphoneos -fapplication-extension -fobjc-link-runtime -fprofile-instr-generate -L/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos -Xlinker -add_ast_path -Xlinker ~/Library/Developer/Xcode/DerivedData/SampleProject/Build/Intermediates.noindex/ApolloSQLite.build/Debug-iphoneos/ApolloSQLite.build/Objects-normal/arm64/ApolloSQLite.swiftmodule -framework SQLite -framework Apollo -compatibility_version 1 -current_version 1 -Xlinker -dependency_info -Xlinker ~/Library/Developer/Xcode/DerivedData/SampleProject/Build/Intermediates.noindex/ApolloSQLite.build/Debug-iphoneos/ApolloSQLite.build/Objects-normal/arm64/ApolloSQLite_dependency_info.dat -o ~/Library/Developer/Xcode/DerivedData/SampleProject/Build/Products/Debug-iphoneos/ApolloSQLite.framework/ApolloSQLite

ld: bitcode bundle could not be generated because '~/Library/Developer/Xcode/DerivedData/SampleProject/Build/Products/Debug-iphoneos/SQLite.framework/SQLite' was built without full bitcode. All frameworks and dylibs for bitcode must be generated from Xcode Archive or Install build file '~/Library/Developer/Xcode/DerivedData/SampleProject/Build/Products/Debug-iphoneos/SQLite.framework/SQLite' for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

The best solution seems to be submitting a change to https://github.com/stephencelis/SQLite.swift/ so that their framework also enables bitcode generation on devices in debug builds, but in the meantime, can Bitcode generation (at least for iOS devices) be set to marker instead of bitcode in debug? This is blocking me from building my project onto my device.

For reference, I'm using git submodules at add Apollo and ApolloSQLite into my project.

Thanks!

@mochimoshi
Copy link
Author

Fixed by #499

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