react-native-twilio-video-webrtc icon indicating copy to clipboard operation
react-native-twilio-video-webrtc copied to clipboard

TwilioVideo contains bitcode

Open anauk opened this issue 1 year ago • 10 comments

Steps to reproduce

  1. in Xcode -Product-Archive
  2. Upload in AppStore

Expected behaviour

set up in testflight

Actual behaviour

The following issues occurred while distributing your app: Invalid Executable. ...TwilioVideo' contains bitcode.

Environment

  • Node.js. v18.20.4:
  • React Native version 0.74.3:
  • React Native platform + platform version: iOS 13.0

react-native-twilio-video-webrtc

"react-native-twilio-video-webrtc": "^3.2.1", Installing TwilioVideo (4.6.3)

anauk avatar Oct 09 '24 11:10 anauk

Also have this issue

jasonsemkohoag avatar Oct 11 '24 03:10 jasonsemkohoag

@jasonsemkohoag @anauk

This happens because the iOS TwilioVideo framework that the repo uses is an old version - TwilioVideo (4.6.3).

Apple has deprecated bitcode recently since XCode 14 and TwilioVideo iOS SDK version 5.5 has removed the bitcode already.

We are in talks with Twilio about the future of the Programmable Video service and maintainability of this React Native package. We want and may release a new version that will default to their latest version (>= 5.8.2).

In the meantime to make it work using TwilioVideo iOS SDK 4.6.3 you can add the following code to your Podfile:

  # ...

  post_install do |installer|
    # ...

    # Remove Bitcode from TwilioVideo.framework
    bitcode_strip_path = `xcrun --find bitcode_strip`.chop!
    def strip_bitcode_from_framework(bitcode_strip_path, framework_relative_path)
      framework_path = File.join(Dir.pwd, framework_relative_path)
      command = "#{bitcode_strip_path} #{framework_path} -r -o #{framework_path}"
      puts "Stripping bitcode: #{command}"
      system(command)
    end
    framework_paths = [
      "Pods/TwilioVideo/TwilioVideo.xcframework/ios-arm64_armv7/TwilioVideo.framework/TwilioVideo",
    ]

    framework_paths.each do |framework_relative_path|
      strip_bitcode_from_framework(bitcode_strip_path, framework_relative_path)
    end

    # ...
  end

  # ...

Then execute $ pod install and build again.

This should strip the bitcode and validate correctly with Apple.

gastonmorixe avatar Oct 12 '24 18:10 gastonmorixe

Thank you, thank you very much. It was really helpful 😉

On Sat, 12 Oct 2024 at 20:53, Gaston Morixe @.***> wrote:

@jasonsemkohoag https://github.com/jasonsemkohoag @anauk https://github.com/anauk

This happens because the iOS TwilioVideo framework that the repo uses is an old version - TwilioVideo (4.6.3).

Apple has deprecated bitcode recently since XCode 14 https://developer.apple.com/documentation/xcode-release-notes/xcode-14-release-notes#Deprecations and TwilioVideo iOS SDK version 5.5 https://www.twilio.com/docs/video/changelog-twilio-video-ios-version-5x#550-january-5-2023 has removed the bitcode already.

We are in talks with Twilio about the future of the Programmable Video service and maintainability of this React Native package. We want and may release a new version that will default to their latest version (>= 5.8.2).

In the meantime to make it work using TwilioVideo iOS SDK 4.6.3 you can add the following code to your Podfile:

...

post_install do |installer| # ...

# Remove Bitcode from TwilioVideo.framework
bitcode_strip_path = `xcrun --find bitcode_strip`.chop!
def strip_bitcode_from_framework(bitcode_strip_path, framework_relative_path)
  framework_path = File.join(Dir.pwd, framework_relative_path)
  command = "#{bitcode_strip_path} #{framework_path} -r -o #{framework_path}"
  puts "Stripping bitcode: #{command}"
  system(command)
end
framework_paths = [
  "Pods/TwilioVideo/TwilioVideo.xcframework/ios-arm64_armv7/TwilioVideo.framework/TwilioVideo",
]

framework_paths.each do |framework_relative_path|
  strip_bitcode_from_framework(bitcode_strip_path, framework_relative_path)
end

# ...

end

...

Then execute $ pod install and build again.

This should strip the bitcode and validate correctly with Apple.

— Reply to this email directly, view it on GitHub https://github.com/blackuy/react-native-twilio-video-webrtc/issues/750#issuecomment-2408659802, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKLINDNWTOM6UUCMJVPKJGLZ3FV4BAVCNFSM6AAAAABPUIH5V6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIMBYGY2TSOBQGI . You are receiving this because you were mentioned.Message ID: @.*** com>

anauk avatar Oct 13 '24 16:10 anauk

The script to strip bitcode in the podfile might work if you use bare RN or submit to EAS with local prebuild. But building/submitting through EAS fails at submission with "twilio-video contains bitcode" and I'm not sure how to fix this issue. Expo support hasn't been very helpful so far.

sigaits avatar Nov 01 '24 00:11 sigaits

@gastonmorixe thanks, it solved the issue. 😉😉😉

desc-aman avatar Nov 09 '24 06:11 desc-aman

@sigaits Did you find a solution to this issue? I'm running into it as well.

nickfletcherr avatar Feb 14 '25 23:02 nickfletcherr

No. I ended up switching to Zoom.

- sigaits

On Fri, Feb 14, 2025 at 3:18 PM Nick Fletcher @.***> wrote:

@sigaits https://github.com/sigaits Did you find a solution to this issue? I'm running into it as well.

— Reply to this email directly, view it on GitHub https://github.com/blackuy/react-native-twilio-video-webrtc/issues/750#issuecomment-2660449364, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMFSRREUCEAWDSHMNRXDQ732PZ2VHAVCNFSM6AAAAABPUIH5V6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMNRQGQ2DSMZWGQ . You are receiving this because you were mentioned.Message ID: @.*** com> [image: nickfletcherr]nickfletcherr left a comment (blackuy/react-native-twilio-video-webrtc#750) https://github.com/blackuy/react-native-twilio-video-webrtc/issues/750#issuecomment-2660449364

@sigaits https://github.com/sigaits Did you find a solution to this issue? I'm running into it as well.

— Reply to this email directly, view it on GitHub https://github.com/blackuy/react-native-twilio-video-webrtc/issues/750#issuecomment-2660449364, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMFSRREUCEAWDSHMNRXDQ732PZ2VHAVCNFSM6AAAAABPUIH5V6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMNRQGQ2DSMZWGQ . You are receiving this because you were mentioned.Message ID: @.*** com>

sigaits avatar Feb 14 '25 23:02 sigaits

hey folks, if you want to modify the Podfile in an Expo project that uses CNG then you can use config plugins to do that, for example:

const { withPodfile } = require('expo/config-plugins');

const TWILIO_BITCODE_REMOVAL_BLOCK = `
    framework_paths = [
      "Pods/TwilioVideo/TwilioVideo.xcframework/ios-arm64_armv7/TwilioVideo.framework/TwilioVideo",
    ]
    framework_paths.each do |framework_relative_path|
      strip_bitcode_from_framework(bitcode_strip_path, framework_relative_path)
    end
    # This is necessary for Xcode 14, because it signs resource bundles by default
    # when building for devices.
      `;

const withTwilioBitcodeFix = (config) => {
  return withPodfile(config, (config) => {
    config.modResults.contents = config.modResults.contents.replace(
      'installer.target_installation_results.pod_target_installation_results', // Use this as an anchor
      `${TWILIO_BITCODE_REMOVAL_BLOCK}installer.target_installation_results.pod_target_installation_results`
    );
    return config;
  });
};

module.exports = withTwilioBitcodeFix;

note that if you are using an older version of the Expo SDK that does not include withPodfile, you will have to modify the above to use withDangerousMod instead.

then in your app.json (assuming you put that file in /plugins/twilio-bitcode-fix.js):

{
  "expo": {
    "name": "example",
    "plugins": [
      // other plugins..
      "./plugins/twilio-bitcode-fix.js"
    ]
  }
}

now when you run npx expo prebuild -p ios (or EAS Build or whatever you use runs it for you) then it will make the changes that @gastonmorixe shared above in your podfile. note that i did not test whether those changes actually work because i do not use this library, i'm just sharing how you would make those changes with config plugins.

this might be useful to add directly to the config plugin in the repo: https://github.com/blackuy/react-native-twilio-video-webrtc/blob/master/plugin/src/withIosTwilioVideoWebrtc.ts

brentvatne avatar Feb 15 '25 00:02 brentvatne

@jasonsemkohoag @anauk

This happens because the iOS TwilioVideo framework that the repo uses is an old version - TwilioVideo (4.6.3).

Apple has deprecated bitcode recently since XCode 14 and TwilioVideo iOS SDK version 5.5 has removed the bitcode already.

We are in talks with Twilio about the future of the Programmable Video service and maintainability of this React Native package. We want and may release a new version that will default to their latest version (>= 5.8.2).

In the meantime to make it work using TwilioVideo iOS SDK 4.6.3 you can add the following code to your Podfile:

...

post_install do |installer| # ...

# Remove Bitcode from TwilioVideo.framework
bitcode_strip_path = `xcrun --find bitcode_strip`.chop!
def strip_bitcode_from_framework(bitcode_strip_path, framework_relative_path)
  framework_path = File.join(Dir.pwd, framework_relative_path)
  command = "#{bitcode_strip_path} #{framework_path} -r -o #{framework_path}"
  puts "Stripping bitcode: #{command}"
  system(command)
end
framework_paths = [
  "Pods/TwilioVideo/TwilioVideo.xcframework/ios-arm64_armv7/TwilioVideo.framework/TwilioVideo",
]

framework_paths.each do |framework_relative_path|
  strip_bitcode_from_framework(bitcode_strip_path, framework_relative_path)
end

# ...

end

...

Then execute $ pod install and build again.

This should strip the bitcode and validate correctly with Apple.

Will the change mentioned above have any impact on functionality?

shahana0994 avatar Apr 05 '25 11:04 shahana0994

Late on this but thank you!

jasonsemkohoag avatar May 23 '25 00:05 jasonsemkohoag