Skip to content

Commit

Permalink
(BSR) build(ios): fix iOS
Browse files Browse the repository at this point in the history
Before this commit
==================

When doing the following command

```sh
yarn ios:prod
```

It fails with the error

```txt
warn Package react-native-flipper contains invalid configuration: "dependency.platforms.ios.project" is not allowed. Please verify it's properly linked using "react-native config" command and contact the package maintainers about this.
info Found Xcode workspace "PassCulture.xcworkspace"
info No booted devices or simulators found. Launching first available simulator...
The file /nix/store/2y71rl5mnazwnpwpcq07xx97jl7sy5lh-apple-sdk-11.3/Applications/Simulator.app does not exist.
error Command failed: open /nix/store/2y71rl5mnazwnpwpcq07xx97jl7sy5lh-apple-sdk-11.3/Applications/Simulator.app --args -CurrentDeviceUDID EBDBAC65-9268-4D4A-8785-03A099743F7B
The file /nix/store/2y71rl5mnazwnpwpcq07xx97jl7sy5lh-apple-sdk-11.3/Applications/Simulator.app does not exist.
.
Error: Command failed: open /nix/store/2y71rl5mnazwnpwpcq07xx97jl7sy5lh-apple-sdk-11.3/Applications/Simulator.app --args -CurrentDeviceUDID EBDBAC65-9268-4D4A-8785-03A099743F7B
The file /nix/store/2y71rl5mnazwnpwpcq07xx97jl7sy5lh-apple-sdk-11.3/Applications/Simulator.app does not exist.

    at checkExecSyncError (node:child_process:890:11)
    at Object.execFileSync (node:child_process:926:15)
    at runOnSimulator (/Users/eb/Project/pass-culture/pass-culture-app-native/node_modules/@react-native-community/cli-platform-ios/build/commands/runIOS/index.js:219:28)
    at Object.runIOS [as func] (/Users/eb/Project/pass-culture/pass-culture-app-native/node_modules/@react-native-community/cli-platform-ios/build/commands/runIOS/index.js:144:14)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Command.handleAction (/Users/eb/Project/pass-culture/pass-culture-app-native/node_modules/@react-native-community/cli/build/index.js:111:9)
```

When looking for XCode path, with the following command

```sh
xcode-select --print-path
```

It outputs this

```txt
/nix/store/2y71rl5mnazwnpwpcq07xx97jl7sy5lh-apple-sdk-11.3
```

Because installing JDK througth DevBox set the following variable environment

```sh
DEVELOPER_DIR=/nix/store/2y71rl5mnazwnpwpcq07xx97jl7sy5lh-apple-sdk-11.3
```

XCode-select seems to display this variable when set

The following test command

```sh
DEVELOPER_DIR=toto xcode-select --print-path
```

Displays

```txt
toto
```

After this commit
=================

```sh
xcode-select --print-path
```

```txt
/Applications/Xcode.app/Contents/Developer
```
  • Loading branch information
bebstein-pass committed Feb 11, 2025
1 parent 8fb6c11 commit 1fabead
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 37 deletions.
1 change: 0 additions & 1 deletion devbox.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,5 @@
"ruby@2.7.5", // needed to install iOS dependencies and to run fastlane
"python3@latest", // needed by scripts/add_tracker.py
"maestro@latest", // needed to run end to end test locally
"jdk@17",
],
}
36 changes: 0 additions & 36 deletions devbox.lock
Original file line number Diff line number Diff line change
Expand Up @@ -169,42 +169,6 @@
}
}
},
"jdk@17": {
"last_modified": "2024-12-23T21:10:33Z",
"resolved": "github:NixOS/nixpkgs/de1864217bfa9b5845f465e771e0ecb48b30e02d#jdk17",
"source": "devbox-search",
"version": "17.0.13+11",
"systems": {
"aarch64-linux": {
"outputs": [
{
"name": "out",
"path": "/nix/store/wk2l2v2r2srpdlhfx01b3l6x6gx3xk73-openjdk-17.0.13+11",
"default": true
},
{
"name": "debug",
"path": "/nix/store/v8izxd2k8l8nwgixqhgg3qy5w7pdrh1w-openjdk-17.0.13+11-debug"
}
],
"store_path": "/nix/store/wk2l2v2r2srpdlhfx01b3l6x6gx3xk73-openjdk-17.0.13+11"
},
"x86_64-linux": {
"outputs": [
{
"name": "out",
"path": "/nix/store/k4877vrvzk3pf4k44g1r6k454vjs8f17-openjdk-17.0.13+11",
"default": true
},
{
"name": "debug",
"path": "/nix/store/k230kdlpj6zj5hsqvm72jfq28frl1dkq-openjdk-17.0.13+11-debug"
}
],
"store_path": "/nix/store/k4877vrvzk3pf4k44g1r6k454vjs8f17-openjdk-17.0.13+11"
}
}
},
"jq@latest": {
"last_modified": "2024-11-07T05:50:23Z",
"resolved": "github:NixOS/nixpkgs/85f7e662eda4fa3a995556527c87b2524b691933#jq",
Expand Down
1 change: 1 addition & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
pkgs.mkShellNoCC {
packages = [
pkgs.devbox
pkgs.jdk17
];
};
});
Expand Down

0 comments on commit 1fabead

Please sign in to comment.