tauri icon indicating copy to clipboard operation
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>

Open imWildCat opened this issue 2 years ago • 12 comments

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

  1. Create a Tauri 1.x project
  2. Migrate to 2.0 using this guide https://tauri.app/blog/2022/12/09/tauri-mobile-alpha/
  3. 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

imWildCat avatar Dec 11 '22 00:12 imWildCat

Experiencing the same issue using npm run tauri ios dev - Is this related to M1?

Kyriakos-Michael avatar Jan 22 '23 18:01 Kyriakos-Michael

Screenshot 2023-01-18 at 6 08 19 AM

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

@sploders101

Screenshot 2023-01-28 at 10 43 08 PM

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

Connoropolous avatar Jan 29 '23 06:01 Connoropolous

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.

Connoropolous avatar Jan 29 '23 06:01 Connoropolous

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 avatar Jan 31 '23 01:01 edsky

@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 avatar Feb 26 '23 01:02 dvreed77

@dvreed77 are you doing work on tauri or on your own project?

Connoropolous avatar Feb 26 '23 17:02 Connoropolous

@dvreed77

  1. Check the modification mentioned by Connoropolous, whether the macro was added Click to view

  2. 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

deadash avatar Feb 27 '23 05:02 deadash

Screenshot 2023-01-18 at 6 08 19 AM

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

@sploders101

Screenshot 2023-01-28 at 10 43 08 PM

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?

styrowolf avatar Mar 21 '23 05:03 styrowolf

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

imWildCat avatar May 03 '23 06:05 imWildCat

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?

zpng avatar Sep 17 '23 09:09 zpng

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

sploders101 avatar Sep 17 '23 13:09 sploders101

Screenshot 2023-01-18 at 6 08 19 AM

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

@sploders101

Screenshot 2023-01-28 at 10 43 08 PM

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.

setoelkahfi avatar Dec 07 '23 15:12 setoelkahfi