[bug] Bundle built with tauri ios build contains standalone libraries
Describe the bug
I'm trying to release my mobile app in TestFlight. I'm using Transporter to upload the .ipa but I get the following error:
Invalid bundle structure. The “ScribbleScan.app/libapp.a” 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
I tried building my app with both of these commands but the result is the same:
npx tauri ios build --export-method release-testing
npx tauri ios build --export-method app-store-connect
Reproduction
No response
Expected behavior
No response
Full tauri info output
[✔] Environment
- OS: Mac OS 15.5.0 arm64 (X64)
✔ Xcode Command Line Tools: installed
✔ rustc: 1.87.0 (17067e9ac 2025-05-09)
✔ cargo: 1.87.0 (99624be96 2025-05-06)
✔ rustup: 1.28.2 (e4f3ad6f8 2025-04-28)
✔ Rust toolchain: 1.87.0-aarch64-apple-darwin (overridden by environment variable RUSTUP_TOOLCHAIN)
- node: 22.15.1
- npm: 10.9.2
[-] Packages
- tauri 🦀: 2.2.5
- tauri-build 🦀: 2.0.5
- wry 🦀: 0.48.1
- tao 🦀: 0.31.1
- @tauri-apps/api : 2.2.0 (outdated, latest: 2.5.0)
- @tauri-apps/cli : 2.2.7 (outdated, latest: 2.5.0)
[-] Plugins
- tauri-plugin-fs 🦀: 2.2.0
- @tauri-apps/plugin-fs : 2.2.0 (outdated, latest: 2.3.0)
- tauri-plugin-sql 🦀: 2.2.0
- @tauri-apps/plugin-sql : 2.2.0
- tauri-plugin-dialog 🦀: 2.2.0
- @tauri-apps/plugin-dialog : 2.2.0 (outdated, latest: 2.2.2)
- tauri-plugin-opener 🦀: 2.2.5
- @tauri-apps/plugin-opener : 2.2.5 (outdated, latest: 2.2.7)
- tauri-plugin-http 🦀: 2.3.0
- @tauri-apps/plugin-http : 2.3.0 (outdated, latest: 2.4.4)
[-] App
- build-type: bundle
- CSP: style-src 'unsafe-inline' 'self'; default-src 'self'; img-src 'self' asset: http://asset.localhost; connect-src ipc: http://ipc.localhost
- frontendDist: ../dist
- devUrl: http://localhost:1420/
- framework: React
- bundler: Vite
[-] iOS
- Developer Teams: [redacted]
Stack trace
Additional context
No response
I was able to fix this by removing libapp.a from Build Phases -> Copy Bundle Resources section in XCode:
I'm pretty new to both Tauri and iOS so I'm not sure if this will mess up my dev builds / debugging. I did notice that the resulting .ipa dropped in size from ~100MB to ~5MB (apart from successfully uploading in the Transporter app).
I just got this error all of a sudden.
I had this error too on my first attempt to upload to AppStore Connect and following the official docs. Following @jgonera's advice and deleting libapp.a did the trick but I have the impression that this is not the correct solution.
I'm now seeing both debug and release versions of libapp.a being added to the build. Having both generates a different error. Removing debug and leaving release generates the same error as above.
Removing libapp.a allows the upload to proceed as stated previously, but my app has no CSS once I'm running it through TestFlight. I'm not sure if this is related or a different issue,
that's weird.. when i create a project I don't have the libapp.a in the "copy bundle resources" list... do you know when that was added? is it something that Xcode is doing? that's not needed at all I've shipped a few Tauri apps on testflight with no such problem at all
the libapp.a should only be part of the "Link Binary With Libraries" section, not the "Copy Bundle Resources" one
Both of the libapp.a files are appearing in the "copy bundle" section after I run tauri ios init. I'll delete them but I'm not sure why it's happening in the first place or if that's the reason why my built app has almost no CSS.
I don't think that's the cause of the missing CSS - make sure the dist folder has all the files you need and open the inspector in safari to debug this
For me, running tauri ios init puts libapp.a in the link binaries section (tauri v2). I had a issue with failing simulator builds and deleting the gen/ folder and re-running the ios init command was what fixed it.
I don't think it's related to CSS issues though; that's likely an asset bundling issue or a CSP issue that's preventing your css file from being loaded in the webview.
Cleaning up the gen/apple folder fixes the issue for me ✅