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

Remove bitcode for ios? #3

Open
mzhu22 opened this issue Nov 15, 2024 · 2 comments
Open

Remove bitcode for ios? #3

mzhu22 opened this issue Nov 15, 2024 · 2 comments

Comments

@mzhu22
Copy link

mzhu22 commented Nov 15, 2024

Hi, thanks for making this library!

I used the SDK in a React Native app, working with Expo and EAS. I can successfully build the app for iOS, and make an archive. However, I cannot upload it to TestFlight/App Store because it fails validation with:

Invalid Executable. The executable 'MyApp.app/Frameworks/ConnectIQ.framework/ConnectIQ' contains bitcode.

I'm wondering if you've run into this before, and if you have any ideas for removing bitcode from the iOS code? Thanks!

@cjsmith
Copy link
Owner

cjsmith commented Nov 16, 2024

Hmm. I think the quick fix would be to either run xcrun -sdk iphoneos bitcode_strip -r YOUR_EXECUTABLE or put something like this in your ios/Podfile or somehow strip out the bitcode

post_install do |installer|
     
    installer.pods_project.targets.each do |target|
      if target.name == 'ConnectIQ'
        `xcrun -sdk iphoneos bitcode_strip -r ios/Pods/ConnectIQ/ConnectIQ.xcframework/ios-arm64/ConnectIQ.framework/ConnectIQ -o ios/Pods/ConnectIQ/ConnectIQ.xcframework/ios-arm64/ConnectIQ.framework/ConnectIQ`
        `xcrun -sdk iphoneos bitcode_strip -r ios/Pods/ConnectIQ/ConnectIQ.xcframework/ios-arm64_x86_64-simulator/ConnectIQ.framework/ConnectIQ -o ios/Pods/ConnectIQ/ConnectIQ.xcframework/ios-arm64_x86_64-simulator/ConnectIQ.framework/ConnectIQ`
     end
end

I think the proper thing to do would be for me to update https://github.com/cjsmith/connectiq-companion-app-sdk-ios/blob/main/ConnectIQ.podspec. to do this in the upstream dependency.

The even more proper thing would be to get the cocoapods support merged into Garmin's official connectiq-companion-app-sdk-ios and have them do it there, or change the build settings there to not build with bitcode.

I will try do to the proper fix when I have time.

@mzhu22
Copy link
Author

mzhu22 commented Nov 16, 2024

Cool, thanks for the help!

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

2 participants