Skip to content

0x03c-xcode16上传app包的bitcode问题处理

升级xcode16后上传app包报错:

Invalid Executable. The executable 'xxx.app/Frameworks/AlivcConan.framework/AlivcConan' contains bitcode. (ID: ba71e1f9-7867-4cf8-a092-e64059449544)
Invalid Executable. The executable 'xxx.app/Frameworks/AliyunMediaDownloader.framework/AliyunMediaDownloader' contains bitcode. (ID: 811007a8-7371-4eda-90ee-0a2649a1ceba)
Invalid Executable. The executable 'xxx.app/Frameworks/AliyunPlayer.framework/AliyunPlayer' contains bitcode. (ID: 5812adfb-9717-4d53-9336-be22d9cf1839)
Invalid Executable. The executable 'xx.app/Frameworks/RongCallKit.framework/RongCallKit' contains bitcode. (ID: 33be8ee4-fef4-4c7c-9fa1-b586c91c463a)
Invalid Executable. The executable 'xxx.app/Frameworks/AlivcConan.framework/AlivcConan' contains bitcode. (ID: ba71e1f9-7867-4cf8-a092-e64059449544)
Invalid Executable. The executable 'xxx.app/Frameworks/AliyunMediaDownloader.framework/AliyunMediaDownloader' contains bitcode. (ID: 811007a8-7371-4eda-90ee-0a2649a1ceba)
Invalid Executable. The executable 'xxx.app/Frameworks/AliyunPlayer.framework/AliyunPlayer' contains bitcode. (ID: 5812adfb-9717-4d53-9336-be22d9cf1839)
Invalid Executable. The executable 'xx.app/Frameworks/RongCallKit.framework/RongCallKit' contains bitcode. (ID: 33be8ee4-fef4-4c7c-9fa1-b586c91c463a)

原因参考:Fix Bitcode Error in Xcode 16 for iOS Builds | Medium

The problem occurs because Xcode 16 does not allow peer dependencies (like third-party libraries) to be built with bitcode enabled, yet some frameworks may still include it. This causes the build upload to fail.

可以编写脚本处理下有问题的framework:

bash
#!/bin/bash

# 获取当前脚本所在目录
script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)

# 定义数组,使用Pods下的相对路径
paths=("AliPlayerSDK_iOS/AlivcConan.framework/AlivcConan" \
 "AliPlayerSDK_iOS/alivcffmpeg.framework/alivcffmpeg" \
 "AliPlayerSDK_iOS/AliyunMediaDownloader.framework/AliyunMediaDownloader" \
 "AliPlayerSDK_iOS/AliyunPlayer.framework/AliyunPlayer" \
 "RongCloudRTC/RongCloudRTC/RongCallKit.xcframework/ios-arm64_armv7/RongCallKit.framework/RongCallKit" \
 "RongCloudRTC/RongCloudRTC/RongRTCLib.xcframework/ios-arm64_armv7/RongRTCLib.framework/RongRTCLib" \
 "RongCloudRTC/RongCloudRTC/RongCallLib.xcframework/ios-arm64_armv7/RongCallLib.framework/RongCallLib" \
 "RongCloudIM/RongCloudIM/RongChatRoom.xcframework/ios-arm64_armv7/RongChatRoom.framework/RongChatRoom" \
 "RongCloudIM/RongCloudIM/RongCustomerService.xcframework/ios-arm64_armv7/RongCustomerService.framework/RongCustomerService" \
 "RongCloudIM/RongCloudIM/RongDiscussion.xcframework/ios-arm64_armv7/RongDiscussion.framework/RongDiscussion" \
 "RongCloudIM/RongCloudIM/RongIMKit.xcframework/ios-arm64_armv7/RongIMKit.framework/RongIMKit" \
 "RongCloudIM/RongCloudIM/RongIMLib.xcframework/ios-arm64_armv7/RongIMLib.framework/RongIMLib" \
 "RongCloudIM/RongCloudIM/RongIMLibCore.xcframework/ios-arm64_armv7/RongIMLibCore.framework/RongIMLibCore"  \
 "RongCloudIM/RongCloudIM/RongPublicService.xcframework/ios-arm64_armv7/RongPublicService.framework/RongPublicService"  \
 "RtsSDK/RtsSDK.framework/RtsSDK"
) 

# 循环遍历数组
for aaapath in "${paths[@]}"; do
    echo $aaapath
    # 执行命令
    xcrun bitcode_strip -r "$script_dir/Pods/$aaapath" -o "$script_dir/Pods/$aaapath"
done
#!/bin/bash

# 获取当前脚本所在目录
script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)

# 定义数组,使用Pods下的相对路径
paths=("AliPlayerSDK_iOS/AlivcConan.framework/AlivcConan" \
 "AliPlayerSDK_iOS/alivcffmpeg.framework/alivcffmpeg" \
 "AliPlayerSDK_iOS/AliyunMediaDownloader.framework/AliyunMediaDownloader" \
 "AliPlayerSDK_iOS/AliyunPlayer.framework/AliyunPlayer" \
 "RongCloudRTC/RongCloudRTC/RongCallKit.xcframework/ios-arm64_armv7/RongCallKit.framework/RongCallKit" \
 "RongCloudRTC/RongCloudRTC/RongRTCLib.xcframework/ios-arm64_armv7/RongRTCLib.framework/RongRTCLib" \
 "RongCloudRTC/RongCloudRTC/RongCallLib.xcframework/ios-arm64_armv7/RongCallLib.framework/RongCallLib" \
 "RongCloudIM/RongCloudIM/RongChatRoom.xcframework/ios-arm64_armv7/RongChatRoom.framework/RongChatRoom" \
 "RongCloudIM/RongCloudIM/RongCustomerService.xcframework/ios-arm64_armv7/RongCustomerService.framework/RongCustomerService" \
 "RongCloudIM/RongCloudIM/RongDiscussion.xcframework/ios-arm64_armv7/RongDiscussion.framework/RongDiscussion" \
 "RongCloudIM/RongCloudIM/RongIMKit.xcframework/ios-arm64_armv7/RongIMKit.framework/RongIMKit" \
 "RongCloudIM/RongCloudIM/RongIMLib.xcframework/ios-arm64_armv7/RongIMLib.framework/RongIMLib" \
 "RongCloudIM/RongCloudIM/RongIMLibCore.xcframework/ios-arm64_armv7/RongIMLibCore.framework/RongIMLibCore"  \
 "RongCloudIM/RongCloudIM/RongPublicService.xcframework/ios-arm64_armv7/RongPublicService.framework/RongPublicService"  \
 "RtsSDK/RtsSDK.framework/RtsSDK"
) 

# 循环遍历数组
for aaapath in "${paths[@]}"; do
    echo $aaapath
    # 执行命令
    xcrun bitcode_strip -r "$script_dir/Pods/$aaapath" -o "$script_dir/Pods/$aaapath"
done