tauri icon indicating copy to clipboard operation
tauri copied to clipboard

[bug] `tauri ios build` failed to build `.ipa` file when manually managing signing in "Signing & Capabilities" section

Open winjeysong opened this issue 1 year ago • 1 comments

Describe the bug

I can build .ipa file successfully when enabling "Automatically managing signing" in "Signing & Capabilities" section. But when I manually manage signing for submission to App Store Connect with an "Apple Distribution" cert provisioning profile, tauri ios build failed to build. Error message below:

/* com.apple.ibtool.document.warnings */
/Users/xxx/Documents/tauri-mobile-test/myapp/src-tauri/gen/apple/LaunchScreen.storyboard:Y6W-OH-hqX: warning: “View Controller“ is unreachable because it has no entry points, and no identifier for runtime access via -[UIStoryboard instantiateViewControllerWithIdentifier:]. [9]
note: Run script build phase 'Build Rust Code' will be run during every build because the option to run the script phase "Based on dependency analysis" is unchecked. (in target 'myapp_iOS' from project 'myapp')
2024-08-18 19:12:43.170 xcodebuild[76886:26475812] [MT] IDEDistribution: -[IDEDistributionLogging _createLoggingBundleAtPath:]: Created bundle at path "/var/folders/s0/rk_dbzpn1hld677qdxd588dc0000gn/T/myapp_iOS_2024-08-18_19-12-43.170.xcdistributionlogs".
    Error command ["xcodebuild"] exited with code <signal 11>

Reproduction

  1. init tauri project with pnpm create tauri-app --rc and install deps
  2. run pnpm tauri ios init and pnpm tauri ios dev --open
  3. manually manage signing in XCode image
  4. run pnpm tauri ios build

Expected behavior

tauri ios build build ipa successfully when manually managing signing in "Signing & Capabilities" section.

Full tauri info output

[✔] Environment
    - OS: Mac OS 14.5.0 X64
    ✔ Xcode Command Line Tools: installed
    ✔ rustc: 1.80.1 (3f5fd8dd4 2024-08-06)
    ✔ cargo: 1.80.1 (376290515 2024-07-16)
    ✔ rustup: 1.27.1 (54dd3d00f 2024-04-24)
    ✔ Rust toolchain: stable-aarch64-apple-darwin (default)
    - node: 20.14.0
    - pnpm: 8.14.0
    - yarn: 1.22.22
    - npm: 10.7.0

[-] Packages
    - tauri [RUST]: 2.0.0-rc.3
    - tauri-build [RUST]: 2.0.0-rc.3
    - wry [RUST]: 0.42.0
    - tao [RUST]: 0.29.0
    - tauri-cli [RUST]: 2.0.0-rc.4
    - @tauri-apps/api [NPM]: 2.0.0-rc.1
    - @tauri-apps/cli [NPM]: 2.0.0-rc.4

[-] App
    - build-type: bundle
    - CSP: unset
    - frontendDist: ../dist
    - devUrl: http://localhost:1420/
    - bundler: Vite

[-] iOS
    - Developer Teams: xxx (ID: xxx)

Stack trace

No response

Additional context

No response

winjeysong avatar Aug 18 '24 13:08 winjeysong

I don't know if there is a better way to produce a signed .ipa file for publishing to App Store Connect. I solved it by setting src-tauri/gen/apple/ExportOptions.plist to:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>method</key>
    <string>app-store-connect</string>
    <key>provisioningProfiles</key>
        <dict>
            <key>com.corp.appName</key> <!-- set your app bundle identifier -->
            <string>YourProvisioningProfileName</string> <!-- set your provisioning profile name -->
        </dict>
</dict>
</plist>

Maybe a new cli command option like method is better? And we can use pnpm tauri ios build --method xxx to produce .ipa file and distribute it for development, publishing to App Store, etc.

winjeysong avatar Aug 19 '24 11:08 winjeysong

Honestly I have the exact same error just trying to get any ios app started with the exact same error.

Just executing:

npm create tauri-app@latest -- --rc test-ios
cd test-ios
npm i
npm run tauri ios init
npm run tauri ios dev

causes

   Info connection; remote_addr=127.0.0.1:60176 conn_id=1
/* com.apple.ibtool.document.warnings */
/Users/mgt/Development/test/test-ios/src-tauri/gen/apple/LaunchScreen.storyboard:Y6W-OH-hqX: warning: “View Controller“ is unreachable because it has no entry points, and no identifier for runtime access via -[UIStoryboard instantiateViewControllerWithIdentifier:]. [9]
note: Run script build phase 'Build Rust Code' will be run during every build because the option to run the script phase "Based on dependency analysis" is unchecked. (in target 'test-ios_iOS' from project 'test-ios')
Deploying app to device...
An error was encountered processing the command (domain=com.apple.CoreSimulator.SimError, code=405):
Unable to lookup in current state: Shutdown
Failed to deploy app to simulator: command ["xcrun", "simctl", "install", "9B8C753F-96B2-4469-86C5-1C0DE067A4F4"] exited with code 149
    Error Failed to deploy app to simulator: command ["xcrun", "simctl", "install", "9B8C753F-96B2-4469-86C5-1C0DE067A4F4"] exited with code 149

Tauri Info


❯ npm run tauri info

> [email protected] tauri
> tauri info

[✔] Environment
    - OS: Mac OS 15.0.0 arm64 (X64)
    ✔ Xcode Command Line Tools: installed
    ✔ rustc: 1.81.0 (eeb90cda1 2024-09-04)
    ✔ cargo: 1.81.0 (2dbb1af80 2024-08-20)
    ✔ rustup: 1.27.1 (54dd3d00f 2024-04-24)
    ✔ Rust toolchain: stable-aarch64-apple-darwin (default)
    - node: 16.20.2
    - npm: 8.19.4

[-] Packages
    - tauri 🦀: 2.0.0-rc.15
    - tauri-build 🦀: 2.0.0-rc.12
    - wry 🦀: 0.43.1
    - tao 🦀: 0.30.2
    - tauri-cli 🦀: 1.6.2
    - @tauri-apps/api : 2.0.0-rc.5
    - @tauri-apps/cli : 2.0.0-rc.16

[-] Plugins
    - tauri-plugin-shell 🦀: 2.0.0-rc.3
    - @tauri-apps/plugin-shell : 2.0.0-rc.1

[-] App
    - build-type: bundle
    - CSP: unset
    - frontendDist: ../dist
    - devUrl: http://localhost:1420/
    - bundler: Vite

[-] iOS
    - Developer Teams: Matthias Goetzke (ID: 3R46P8ZNKW)

matthiasg avatar Sep 26 '24 11:09 matthiasg

@matthiasg Please open a new issue, your error is different (only the more or less irrelevant warnings match but those don't make the build fial).

Also this issue should be fixed no, there are now cli flags for the export method.

FabianLars avatar Sep 26 '24 11:09 FabianLars