Flutter iOS: The bundle xxxxxxx contains disallowed nested bundles - ios

We recently upgraded to Flutter 3.3.7 in our iOS project, and started to get the following error when uploading to TestFlight: Asset validation failed Invalid Bundle. The bundle at 'XXXXXXXXX' contains disallowed nested bundles.
After several intents of understanding the root cause, we managed to create a minimum reproducible example, isolated from the rest of our project: https://github.com/alansteiman/FlutterExample
In this example, Flutter is integrated via Cocoapods using this doc, as a dependency of a framework that is dynamically linked to the main app:

Related

Invalid bundle structure - iOS App Submission Issue

I received the following error after trying to upload my app to AppStore Connect.
Asset validation failed (90171)
Invalid bundle structure. The “Runner.app/PlugIns/ImageNotification.appex/Frameworks/Pods_ImageNotification.framework/Pods_ImageNotification” binary file is not permitted. Your app cannot contain standalone executables or libraries, other than a valid CFBundleExecutable of supported bundles. For details, visit: https://developer.apple.com/documentation/bundleresources/placing_content_in_a_bundle (ID: 9022756e-defb-44d9-ba55-70e01abeab11)
Asset validation failed (90206)
Invalid Bundle. The bundle at 'Runner.app/PlugIns/ImageNotification.appex' contains disallowed file 'Frameworks'. (ID: b889e1b7-84e5-4cdd-b011-c5ef51a78daa)
Asset validation failed (90205)
Invalid Bundle. The bundle at 'Runner.app/PlugIns/ImageNotification.appex' contains disallowed nested bundles. (ID: 6a71e1d9-4c46-4528-aa04-05fcb4bf6fe0)
I was able to solve it by deleting podfile.lock and podfile folder + flutter clean.
An error of mutiple produce came up and i added below line to my podfile
pod 'GoogleUtilities'
And everything works fine afterwards.

The binary file '$myapp$.app/lib/python3.9/site-packages/google/protobuf/internal/_api_implementation.cpython-39-darwin.so' is not permitted

Versions
Python :3.9
MacOS version :12.1
XCode Version :13.1
Cython version :
Describe the bug
I wanted to distribute my app on apple store, I made the validation process and after that I have this two error
don't understand why because before I used the same python library to distribute another application.
what I did different to before is I try to use firebase push notification with pod but not work so a removed it
I use firebase for my database so I install Pyrebase for the request. Like Pyrebase didn't install well i put the folder from GitHub directly on my source folder et install cloud after that to make it work well. but its not the problem because I already used this configuration on other application
Expected behavior
normaly it have to run validation without issue but don't understand why
Logs
App Store Connect Operation Error
Invalid Bundle Structure - The binary file '$myapp$.app/lib/python3.9/site-packages/google/protobuf/pyext/_message.cpython-39-darwin.so' 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.
App Store Connect Operation Error
Invalid Bundle Structure - The binary file '$myapp$.app/lib/python3.9/site-packages/google/protobuf/internal/_api_implementation.cpython-39-darwin.so' 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.

Exposing flutter module as IOS framework results in "Failed to find assets path for "Frameworks/App.framework/flutter_assets"

I am receiving Failed to find assets path for "Frameworks/App.framework/flutter_assets when trying to expose a Flutter project via a framework to another IOS project (Add to App via a Framework).
I created a Flutter project that i now want to expose as a native Framework for IOS. We want to share our project with other companies so that they can integrate it in their IOS application.
I followed the documentation described on https://flutter.dev/docs/development/add-to-app/ios/project-setup and i used option C. This will create an XCFramework of our Flutter module and integrate it in our native IOS Framework which will have an API to work with the flutter project. In that way our IOS Framework can be seen as an Umbrella kind of Framework but also with an exposed API.
So what i created is:
A Flutter module
An IOS Framework
An IOS Project
I build the flutter module using ./flutterw build ios-framework --cocoapods --xcframework --no-universal --output=../WhiteLabelIOSFrameWork/Flutter --verbose into the IOS Framework. I added the libraries to the Framework and i created a codespec file for the Framework with only Flutter as a dependency. Afterwards i added a Podfile to the project and added the Framework as a dependency.
All of this is working (i only needed to upgrade to Flutter 1.24.X to have this fix available https://github.com/flutter/flutter/pull/69736). But when i start my Flutter engine it's unable to find the flutter_assets (Failed to find assets path for "Frameworks/App.framework/flutter_assets).
I tried building the ios-framework directly into our IOS project and skip the in between Framework and then it seems to work. So i think it cannot find the flutter_assets since the App.framework is not in the IOS project itself, but in a Framework in between.
Is there a way to move the flutter_assets path or so? Or any other idea on how to solve this?
Kind regards,
Daan
This issue cause when you create Flutter Engine without FlutterDartProject.
Just add FlutterEngine(name: "your name", project: FlutterDartProject(precompiledDartBundle: Bundle.init(for: Self.self)))

Xcode error when uploading to App Store: “Invalid Bundle structure”

I'm using Xcode to build a native script app for iOS. I've registered an app on iTunes Connect.
when I build the application on Xcode its works well.
All goes well in Xcode until I upload to the App Store. I get the following error:
Your error is related with devDependencies, Since error is showing invalid bundle structure this is because some of your devDependencies is added in the dependencies object inside package.json.
In your case "nativescript-dev-sass": "^1.0.0-rc.2" dependency was added in your package.json just move it from dependecy to devDependency.
Open the project in Finder and search if you have added any .framework file in Project directory besides pod folder. Delete the .framwork file and build,archive again.

Unable to upload iOS update after adding Flurry Analytics? Error: Your app can’t contain standalone executables or libraries

In my Swift iOS application I've just added Flurry Analytics by creating a briding-header.h and importing Flurry.h. I then added SystemConfiguration.framework, CFNetwork.framework, and Security.framework.
I then added libFlurry_6.5.0.a via Targets -> Build Phases -> Link Binary with Libraries after instruction from a Stack Overflow question because it wouldn't build.
After archiving the app I tried to upload it and received this error:
ERROR ITMS-90171: “Invalid Bundle Structure - The binary file
‘APPNAME.app/Flurry/libFlurry_6.5.0.a’ is not permitted. Your app
can’t contain standalone executables or libraries...
Open the Build Phases tab in the target settings for your project.
Make sure that Flurry.framework is not included under Copy Bundle Resources.
From Invalid Bundle Structure.
My case was a bit different. I added an static library to "Embed Frameworks" and I got a couple of errors when I uploaded the app to the app store:
The binary X is not permitted. Your app can't contain standalone executables or libraries, other than a valid CFBundleExecutable of supported bundles
Invalid Swift Support - Doesn't have the correct file type for this location
I removed this dependency and the problem was solved

Resources