Skip to content

Commit 986b996

Browse files
authored
docs: 260 symbols restriction on Windows (#920)
## 📜 Description Added documentation for windows users how to workaround 260 symbols issue. ## 💡 Motivation and Context The solution was found in `react-native-safe-area-context`. Seems like it's simplet to workaround that once on a build machine rather than trying to fix it inside the library (though before it was working well - prior to custom ShadowNodes). I decided to copy the answer and paste in documentation because don't want to rely on external links, since they can be deleted/lost/etc. I also suppose that many projects are using `react-native-safe-area-context` so it shouldn't be a big problem (safe-area-context has the same issue) 👀 Closes #914 ## 📢 Changelog ### Docs - added step-by-step guide how to workaround 260 symbols in path limitation; ## 🤔 How Has This Been Tested? There is no way to test it for me. ## 📸 Screenshots (if appropriate): <img width="1001" alt="image" src="https://github.com/user-attachments/assets/8e009304-e8ef-4606-be31-fea5f939b28c" /> ## 📝 Checklist - [x] CI successfully passed - [x] I added new mocks and corresponding unit-tests if library API was changed
1 parent 033e043 commit 986b996

File tree

3 files changed

+67
-1
lines changed

3 files changed

+67
-1
lines changed

cspell.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,9 @@
150150
"mapbuffer",
151151
"nativemodule",
152152
"reactnative",
153-
"SQIP"
153+
"SQIP",
154+
"DCMAKE",
155+
"HKLM"
154156
],
155157
"ignorePaths": [
156158
"node_modules",

docs/docs/troubleshooting.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,3 +85,35 @@ You have two ways to fix this problem:
8585
8686
- enable `allowRecursiveCommitsWithSynchronousMountOnAndroid` feature flag (see [react-native-reanimated#6418](https://github.com/software-mansion/react-native-reanimated/issues/6418#issuecomment-2296107100) and [react-native-keyboard-controller](https://github.com/kirillzyusko/react-native-keyboard-controller/issues/687))
8787
- upgrade to `[email protected]+` (starting from this version this flag is enabled by default).
88+
89+
## Filename longer than 260 characters
90+
91+
If you experience this error on Windows you need to perform next steps:
92+
93+
1. **Download the Latest Version of Ninja**
94+
- Download the latest Ninja release from the [official repository](https://github.com/ninja-build/ninja/releases)
95+
- Replace the existing `ninja.exe` in `$SDK_PATH$\cmake\$CMAKE_VERSION$\bin` with the newly downloaded version
96+
2. **Update the build.gradle File**
97+
98+
- Open `android/app/build.gradle`
99+
- Inside the `android.defaultConfig` block, add the following code:
100+
101+
```json
102+
externalNativeBuild {
103+
cmake {
104+
arguments "-DCMAKE_MAKE_PROGRAM=$YOUR_CMAKE_NINJA_PATH$", "-DCMAKE_OBJECT_PATH_MAX=1024"
105+
}
106+
}
107+
```
108+
109+
:::tip
110+
Make sure to update `$YOUR_CMAKE_NINJA_PATH$` with the correct path to your `ninja.exe` file. For example, it might look something like `E:\\SDK\\cmake\\3.22.2\\bin\\ninja.exe` on Windows.
111+
:::
112+
113+
3. **Enable Long Path Support in Windows**
114+
115+
- Run the following `PowerShell` command to enable long path support in Windows:
116+
117+
```bash
118+
New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem" -Name "LongPathsEnabled" -Value 1 -PropertyType DWORD -Force
119+
```

docs/versioned_docs/version-1.17.0/troubleshooting.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,3 +85,35 @@ You have two ways to fix this problem:
8585
8686
- enable `allowRecursiveCommitsWithSynchronousMountOnAndroid` feature flag (see [react-native-reanimated#6418](https://github.com/software-mansion/react-native-reanimated/issues/6418#issuecomment-2296107100) and [react-native-keyboard-controller](https://github.com/kirillzyusko/react-native-keyboard-controller/issues/687))
8787
- upgrade to `[email protected]+` (starting from this version this flag is enabled by default).
88+
89+
## Filename longer than 260 characters
90+
91+
If you experience this error on Windows you need to perform next steps:
92+
93+
1. **Download the Latest Version of Ninja**
94+
- Download the latest Ninja release from the [official repository](https://github.com/ninja-build/ninja/releases)
95+
- Replace the existing `ninja.exe` in `$SDK_PATH$\cmake\$CMAKE_VERSION$\bin` with the newly downloaded version
96+
2. **Update the build.gradle File**
97+
98+
- Open `android/app/build.gradle`
99+
- Inside the `android.defaultConfig` block, add the following code:
100+
101+
```json
102+
externalNativeBuild {
103+
cmake {
104+
arguments "-DCMAKE_MAKE_PROGRAM=$YOUR_CMAKE_NINJA_PATH$", "-DCMAKE_OBJECT_PATH_MAX=1024"
105+
}
106+
}
107+
```
108+
109+
:::tip
110+
Make sure to update `$YOUR_CMAKE_NINJA_PATH$` with the correct path to your `ninja.exe` file. For example, it might look something like `E:\\SDK\\cmake\\3.22.2\\bin\\ninja.exe` on Windows.
111+
:::
112+
113+
3. **Enable Long Path Support in Windows**
114+
115+
- Run the following `PowerShell` command to enable long path support in Windows:
116+
117+
```bash
118+
New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem" -Name "LongPathsEnabled" -Value 1 -PropertyType DWORD -Force
119+
```

0 commit comments

Comments
 (0)