Skip to content

Commit 15368f8

Browse files
authored
Update troubleshooting.md (#933)
## 📜 Description Remove hardcoded PATH in troubleshooting section. ## 💡 Motivation and Context Making code more robust is a key for a seamless lib integration in various projects. Closes #931 ## 📢 Changelog <!-- High level overview of important changes --> <!-- For example: fixed status bar manipulation; added new types declarations; --> <!-- If your changes don't affect one of platform/language below - then remove this platform/language --> ### Docs - automatically define CMake path; ## 🤔 How Has This Been Tested? Tested via preview. ## 📸 Screenshots (if appropriate): <!-- Add screenshots/video if needed --> <!-- That would be highly appreciated if you can add how it looked before and after your changes --> ## 📝 Checklist - [x] CI successfully passed - [x] I added new mocks and corresponding unit-tests if library API was changed
1 parent 59dddfe commit 15368f8

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

docs/docs/troubleshooting.md

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,10 +99,17 @@ If you experience this error on Windows you need to perform next steps:
9999
- Inside the `android.defaultConfig` block, add the following code:
100100
101101
```json
102+
import org.apache.tools.ant.taskdefs.condition.Os
103+
102104
externalNativeBuild {
103-
cmake {
104-
arguments "-DCMAKE_MAKE_PROGRAM=$YOUR_CMAKE_NINJA_PATH$", "-DCMAKE_OBJECT_PATH_MAX=1024"
105-
}
105+
cmake {
106+
def cmakeDir = "${android.sdkDirectory}/cmake/3.31.1/bin"
107+
def ninjaExecutable = Os.isFamily(Os.FAMILY_WINDOWS) ? "ninja.exe" : "ninja"
108+
def ninjaPath = "${cmakeDir}/${ninjaExecutable}".replace("\\", "/")
109+
110+
arguments "-DCMAKE_MAKE_PROGRAM=${ninjaPath}",
111+
"-DCMAKE_OBJECT_PATH_MAX=1024"
112+
}
106113
}
107114
```
108115

0 commit comments

Comments
 (0)