'ERROR ITMS-90171: Invalid Bundle Structure - The binary file [CocoaPods file]

Running into this error when uploading to the App Store:

ERROR ITMS-90171: "Invalid Bundle Structure - The binary file 'mobile.app/Frameworks/Pods_mobile.framework/Pods_mobile' is not permitted. Your app can’t contain standalone executables or libraries, other than a valid CFBundleExecutable of supported bundles. Refer to the Bundle Programming Guide at https://developer.apple.com/go/?id=bundle-structure for information on the iOS app bundle structure."

I searched all similar posts and tried all of these suggestions:
- Always Embed Swift Standard Library = [true, false, $(inherited)]
- Build Phases -> Copy Bundle Resources -> Ensured its free of frameworks
- Ensured provisioning profile is set correctly.
- Build Active Architecture Only = [true, false]

Build Phases: [CP] Embed Pods Frameworks & [CP] Copy Pods Resource seem normal:
"${PODS_ROOT}/Target Support Files/Pods-mobile/Pods-mobile-frameworks.sh"
"${PODS_ROOT}/Target Support Files/Pods-mobile/Pods-mobile-resources.sh"
respectively.

Podfile:

platform :ios, '12.0'
use_frameworks!

target 'mobile' do
  pod ...
end


Solution 1:[1]

I needed to remove Pods_mobile.framework under Embed Frameworks as shown below. I'm not sure how it got there, but assumed it had its purpose since I didn't add it in the first place.

enter image description here

Solution 2:[2]

Just delete the exec file from your bundle and delete the "Executable file" key from your bundle resources. After that archive and validate the the the build it will work.

  1. enter image description here

  2. enter image description here

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Sami
Solution 2 Ashi