Unsupported Architectures
See original GitHub issueWhen I try to submit the bundle to the TestFlight I get this error.
[Transporter Error Output]: ERROR ITMS-90087: "Unsupported Architectures. The executable for NativeRTC.app/Frameworks/WebRTC.framework contains unsupported architectures '[x86_64, i386]'."
[13:44:54]: [Transporter Error Output]: ERROR ITMS-90209: "Invalid Segment Alignment. The app binary at 'NativeRTC.app/Frameworks/WebRTC.framework/WebRTC' does not have proper segment alignment. Try rebuilding the app with the latest Xcode version."
[13:44:54]: [Transporter Error Output]: ERROR ITMS-90125: "The binary is invalid. The encryption info in the LC_ENCRYPTION_INFO load command is either missing or invalid, or the binary is already encrypted. This binary does not seem to have been built with Apple's linker."
[13:44:54]: [Transporter Warning Output]: WARNING ITMS-90080: "The executable 'Payload/NativeRTC.app/Frameworks/WebRTC.framework' is not a Position Independent Executable. Please ensure that your build settings are configured to create PIE executables. For more information refer to Technical Q&A QA1788 - Building a Position Independent Executable in the iOS Developer Library."
[13:44:55]: Transporter transfer failed.
[13:44:55]: WARNING ITMS-90080: "The executable 'Payload/NativeRTC.app/Frameworks/WebRTC.framework' is not a Position Independent Executable. Please ensure that your build settings are configured to create PIE executables. For more information refer to Technical Q&A QA1788 - Building a Position Independent Executable in the iOS Developer Library."
I’m looking at this stackoverflow question. Any help much appreciated 😃
Edit 1:
As far as I can see x86_64 architecture is for iPad simulators while i386 is for iPhone simulators, both are 32 and 64bit compatible.
Edit 2:
Here they talk about Archive validation error: Invalid Segment Alignment and one of the answers refers to:
In my case I was submitting an app that include a framework I had built that was a universal framework - created using lipo (for use with both device and simulator).
After replacing the universal compiled framework with device compiled framework, validation was successful.
Edit 3:
Using lipo --info
, you can see WebRTC.framework/WebRTC
have multiple architectures indeed i386 x86_64 armv7 arm64
.
> lipo -info NativeRTC.xcarchive/Products/Applications/NativeRTC.app/Frameworks/WebRTC.framework/WebRTC
Architectures in the fat file: NativeRTC.xcarchive/Products/Applications/NativeRTC.app/Frameworks/WebRTC.framework/WebRTC are: i386 x86_64 armv7 arm64
Edit 4.
From this article looks like https://github.com/oney/react-native-webrtc/blob/master/ios/WebRTC.framework/WebRTC has been complied with i386 x86_64 armv7 arm64
architectures. You can see it by cloning it and running lipo -detailed_info ios/WebRTC.framework/WebRTC
.
I’m gonna try to remove i386 x86_64
.
Edit 5. Running:
cd node_modules/react-native-webrtc/ios/WebRTC.framework/
lipo -remove i386 WebRTC -o WebRTC && lipo -remove x86_64 WebRTC -o WebRTC
Solves the problem. I’m gonna test however if it still works on simulators.
Edit 6. Nope! I get the following error:
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_RTCConfiguration", referenced from:
objc-class-ref in libRCTWebRTC.a(RCTConvert+WebRTC.o)
blabla
Edit 7.
So clearly there some issues, at least on my side. Is anyone experiencing the same problems?
Edit 8.
Apparently is an app store submission bug http://www.openradar.me/radar?id=6409498411401216
Edit 9.
I created this little script which helps me jump between architectures during dev and app store release.
'use strict';
const fs = require('fs');
const exec = require('child_process').execSync;
const WEBRTC_BIN_PATH = `${__dirname}/node_modules/react-native-webrtc/ios/WebRTC.framework`;
const ARCH_TYPES = ['i386','x86_64','armv7','arm64'];
if(process.argv[2] === '--extract' || process.argv[2] === '-e'){
console.log(`Extracting...`);
ARCH_TYPES.forEach(elm => {
exec(`lipo -extract ${elm} WebRTC -o WebRTC-${elm}`,{cwd:WEBRTC_BIN_PATH});
});
exec('cp WebRTC WebRTC-all',{cwd:WEBRTC_BIN_PATH});
console.log(exec('ls -ahl | grep WebRTC-',{cwd:WEBRTC_BIN_PATH}).toString().trim());
console.log('Done!');
}
if(process.argv[2] === '--simulator' || process.argv[2] === '-s'){
console.log(`Compiling simulator...`);
exec(`lipo -o WebRTC -create WebRTC-x86_64 WebRTC-i386`,{cwd:WEBRTC_BIN_PATH});
console.log(exec('ls -ahl | grep WebRTC',{cwd:WEBRTC_BIN_PATH}).toString().trim());
console.log('Done!');
}
if(process.argv[2] === '--device' || process.argv[2] === '-d'){
console.log(`Compiling device...`);
exec(`lipo -o WebRTC -create WebRTC-armv7 WebRTC-arm64`,{cwd:WEBRTC_BIN_PATH});
console.log(exec('ls -ahl | grep WebRTC',{cwd:WEBRTC_BIN_PATH}).toString().trim());
console.log('Done!');
}
Issue Analytics
- State:
- Created 7 years ago
- Reactions:6
- Comments:15 (3 by maintainers)
Top GitHub Comments
Did you follow this guide to a T?
I was having similar issues, and I think setting
Enable Bitcode
toNo
will help you.I was having this same issue, even after trying the script included here. (Thanks for that, though!) The tiny script in this post fixed the arch issue reliably without having to run anything manual, and resolved all of the other validation issues I was having (!!!): http://ikennd.ac/blog/2015/02/stripping-unwanted-architectures-from-dynamic-libraries-in-xcode/
Thanks for this library, by the way!