When archiving iOS and pushing to App Store I get bitcode issue on version 4.1.0
After running the archive and trying to push the build to the app store I get the following error:
ITMS-90482: Invalid Executable - The executable
'AppName.app/Frameworks/KontaktSDK.framework/KontaktSDK' contains bitcode.
I've hadd to addthis in my podfile to fix it manually:
post_install do |installer|
...
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}"
if File.exist?(framework_path)
system(command)
else
puts "Warning: Framework not found at #{framework_path}"
end
end
framework_paths = [
"../node_modules/react-native-kontaktio/ios/KontaktSDK.framework/KontaktSDK"
]
framework_paths.each do |framework_relative_path|
strip_bitcode_from_framework(bitcode_strip_path, framework_relative_path)
end
end
Additionally I get these warnings:
Upload Symbols Failed
The archive did not include a dSYM for the KontaktSDK.framework with the UUIDs [CF53FEB9-7892-331C-9184-DD1CF30B6EEE].
Ensure that the archive's dSYM folder includes a DWARF file for KontaktSDK.framework with the expected UUIDs.
you can strip the bitcode manualy with this command :
xcrun bitcode_strip -r ./node_modules/react-native-kontaktio/ios/KontaktSDK.framework/KontaktSDK -o ./node_modules/react-native-kontaktio/ios/KontaktSDK.framework/KontaktSDK
I encountered this error too months ago.
I made this sh code for it, just compile your app normally, then you need your certify and mobile provisioning files for using it, on the same folder of your final ipa file. Just run it and the resulting ipa will be ready to upload.
Yes, it is in spanish 😝
#!/bin/bash
set -e
if [ $# -ne 4 ]; then
echo "Uso: $0 <archivo_ipa> <nombre_app_sin_extension> <certificado_distribucion> <perfil_aprovisionamiento>"
exit 1
fi
IPA_FILE="$1"
APP_NAME="$2"
DISTRIBUTION_CERT="$3"
PROVISIONING_PROFILE="$4"
TEMP_DIR="temp_ipa_dir"
ENTITLEMENTS_FILE="entitlements.plist"
echo "Descomprimiendo IPA..."
rm -rf "$TEMP_DIR"
mkdir -p "$TEMP_DIR"
unzip -q "$IPA_FILE" -d "$TEMP_DIR"
APP_PATH=$(find "$TEMP_DIR/Payload" -maxdepth 1 -name "*.app" -print | head -n 1)
if [ -z "$APP_PATH" ]; then
echo "Error: No se pudo encontrar el archivo .app en el IPA"
exit 1
fi
ACTUAL_APP_NAME=$(basename "$APP_PATH")
echo "Nombre real de la app: $ACTUAL_APP_NAME"
echo "Verificando Bundle ID..."
BUNDLE_ID=$(/usr/libexec/PlistBuddy -c "Print :CFBundleIdentifier" "$APP_PATH/Info.plist")
echo "Bundle ID: $BUNDLE_ID"
echo "Extrayendo entitlements del perfil de aprovisionamiento..."
security cms -D -i "$PROVISIONING_PROFILE" > "$TEMP_DIR/profile.plist"
/usr/libexec/PlistBuddy -x -c 'Print :Entitlements' "$TEMP_DIR/profile.plist" > "$TEMP_DIR/$ENTITLEMENTS_FILE"
echo "Entitlements extraídos:"
cat "$TEMP_DIR/$ENTITLEMENTS_FILE"
echo "Eliminando bitcode de los frameworks..."
find "$APP_PATH/Frameworks" -name '*.framework' -type d | while read framework
do
framework_binary=$(basename "$framework" .framework)
echo "Eliminando bitcode de $framework_binary"
xcrun bitcode_strip "$framework/$framework_binary" -r -o "$framework/$framework_binary"
done
echo "Firmando frameworks..."
find "$APP_PATH/Frameworks" -name '*.framework' -type d | while read framework
do
framework_name=$(basename "$framework" .framework)
echo "Firmando: $framework_name"
codesign --force --sign "$DISTRIBUTION_CERT" "$framework/$framework_name"
done
echo "Copiando perfil de aprovisionamiento..."
cp "$PROVISIONING_PROFILE" "$APP_PATH/embedded.mobileprovision"
echo "Firmando la aplicación principal..."
codesign --force --sign "$DISTRIBUTION_CERT" --entitlements "$TEMP_DIR/$ENTITLEMENTS_FILE" "$APP_PATH"
echo "Creando nuevo IPA..."
cd "$TEMP_DIR"
zip -qr "../${IPA_FILE%.*}_signed.ipa" Payload
echo "Limpiando archivos temporales..."
cd ..
rm -rf "$TEMP_DIR"
echo "Proceso completado. Nuevo IPA firmado: ${IPA_FILE%.*}_signed.ipa"