tauri
tauri copied to clipboard
[bug] Mobile 2.0 alpha for iOS: error: The following required arguments were not provided: --gcc-preprocessor-definitions <GCC_PREPROCESSOR_DEFINITIONS>
Describe the bug
While building Tauri 2.0 app for iOS (pnpm tauri ios build
), it shows:
Usage: node ../../../node_modules/@tauri-apps/cli/tauri.js ios xcode-script --platform <PLATFORM> --sdk-root <SDK_ROOT> --framework-search-paths <FRAMEWORK_SEARCH_PATHS> --gcc-preprocessor-definitions <GCC_PREPROCESSOR_DEFINITIONS> --header-search-paths <HEADER_SEARCH_PATHS> --configuration <CONFIGURATION> --verbose... --force-color <ARCHES>...
For more information try '--help'
note: Building targets in dependency order
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 'hola-app_iOS' from project 'hola-app')
** BUILD FAILED **
Error Command "xcodebuild -quiet -scheme hola-app_iOS -workspace /Users/wildcat/Downloads/202212/temp/hola-app/src-tauri/gen/apple/hola-app.xcodeproj/project.xcworkspace/ -sdk iphoneos -configuration release -arch arm64 -allowProvisioningUpdates build" didn't complete successfully, exiting with code 65.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Reproduction
- Create a Tauri 1.x project
- Migrate to 2.0 using this guide https://tauri.app/blog/2022/12/09/tauri-mobile-alpha/
- Run
pnpm tauri ios build
Expected behavior
The iOS app can be built
Platform and versions
➜ apple npm run tauri info
> [email protected] tauri
> tauri info
Environment
› OS: Mac OS 13.0.1 X64
› Node.js: 16.18.0
› npm: 8.19.2
› pnpm: 7.14.0
› yarn: 1.22.19
› rustup: 1.25.1
› rustc: 1.65.0
› cargo: 1.65.0
› Rust toolchain: stable-aarch64-apple-darwin
Packages
› @tauri-apps/cli [NPM]: 2.0.0-alpha.0
› @tauri-apps/api [NPM]: 2.0.0-alpha.0
› tauri [RUST]: 2.0.0-alpha.0,
› tauri-build [RUST]: 2.0.0-alpha.0,
› tao [RUST]: 0.15.7,
› wry [RUST]: 0.23.3,
App
› build-type: bundle
› CSP: unset
› distDir: ../dist
› devPath: http://localhost:1420/
› framework: React
› bundler: Vite
App directory structure
├─ dist
├─ node_modules
├─ public
├─ src-tauri
├─ .vscode
└─ src
Stack trace
No response
Additional context
No response
Experiencing the same issue using npm run tauri ios dev
- Is this related to M1?

After trial and error of making edits to each of the build settings, I found the one that solves this.
@sploders101

Add DEBUG=0 for release.
I don't have much background in this, but I dug for this resource after I got it working and it shed a tiny bit of light on this for me: https://thoughtbot.com/blog/xcode-build-settings-part-1-preprocessing
I think this is something that could be fixed in the project template for new projects. That was what I was starting with, which surprised me that it didn't work. I do also happen to using M1.
I think this is something that could be fixed in the project template for new projects. That was what I was starting with, which surprised me that it didn't work. I do also happen to using M1.
I created a minimal example that works. You can try to compile and run on M1.
https://github.com/edsky/tauri_yew_ios.git
If it fails, you can consider whether the architecture is not supported, manually compile the corresponding architecture in src-tauri and copy it to gen/apple/Externals
@edsky thanks a lot for the example repo. I cloned that, changed the teamId obviously and am still getting a GCC_PREPROCESSOR_DEFINITIONS: parameter null or not set
error.
I'm not exactly sure how to do what you mention here:
If it fails, you can consider whether the architecture is not supported, manually compile the corresponding architecture in src-tauri and copy it to gen/apple/Externals
so any help would be great
@dvreed77 are you doing work on tauri or on your own project?
@dvreed77
-
Check the modification mentioned by Connoropolous, whether the macro was added Click to view
-
Check whether the corresponding architecture file is generated under gen/apple/Externals. If it is a simulation generation, it should generate x64. If it is a release version, it is arm64. This error should have nothing to do with this question
![]()
After trial and error of making edits to each of the build settings, I found the one that solves this.
@sploders101
![]()
Add DEBUG=0 for release.
I don't have much background in this, but I dug for this resource after I got it working and it shed a tiny bit of light on this for me: https://thoughtbot.com/blog/xcode-build-settings-part-1-preprocessing
This solution is still useful. Is there any way that we can apply this to the Xcode project generation? Should I submit a pull request?
This solution is still useful. Is there any way that we can apply this to the Xcode project generation? Should I submit a pull request?
I think so. Anybody wants to create a PR? If nobody, I will do it
This solution is still useful. Is there any way that we can apply this to the Xcode project generation? Should I submit a pull request?
I think so. Anybody wants to create a PR? If nobody, I will do it
have this been fixed? have you create this pr?
have this been fixed? have you create this pr?
Have you tried using the latest alpha? I haven't had any issues with this in a while. The tooling seems to work right out of the box now
![]()
After trial and error of making edits to each of the build settings, I found the one that solves this.
@sploders101
![]()
Add DEBUG=0 for release.
I don't have much background in this, but I dug for this resource after I got it working and it shed a tiny bit of light on this for me: https://thoughtbot.com/blog/xcode-build-settings-part-1-preprocessing
Doesn't work for me. I'm using the latest alpha, MacOS M1.