Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,10 @@ export default {

</details>

## Building on Windows (CMake long-path failures)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mind adding this to the docs as well?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, I see we're referencing the reanimated docs, is that intentional?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah that was intentional. We can also copy the relevant parts to our docs.


On Windows, the Android build can fail with `ninja: error: mkdir(CMakeFiles/rive.dir/...): No such file or directory` due to the Windows `MAX_PATH` (260 character) limit. This is a [known issue across React Native libraries that use CMake](https://docs.swmansion.com/react-native-reanimated/docs/guides/building-on-windows/). Set `CMAKE_VERSION=3.31.6` before building — see the Reanimated docs for full setup instructions.

## Error Handling

All Rive operations can be wrapped in try/catch blocks for error handling, for example, loading a file:
Expand Down
7 changes: 7 additions & 0 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,13 @@ android {
externalNativeBuild {
cmake {
path "CMakeLists.txt"
// On Windows the NDK default CMake (3.22.1) fails when object-file
// paths exceed MAX_PATH (260 chars). Set CMAKE_VERSION=3.31.6 to fix.
Comment on lines +72 to +73
// See: https://docs.swmansion.com/react-native-reanimated/docs/guides/building-on-windows/
def cmakeVersionOverride = System.getenv("CMAKE_VERSION")
if (cmakeVersionOverride) {
version cmakeVersionOverride
}
}
}

Expand Down
Loading