Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix cmake error on windows #3755

Merged
merged 2 commits into from
Nov 10, 2022

Conversation

muhamad-rizki
Copy link
Contributor

@muhamad-rizki muhamad-rizki commented Nov 9, 2022

Description

I get cmake error (Invalid character escape '\K'.) when using latest Reanimated on RN version 0.64.3, this will fix Android build on windows because latest version of reanimated doesn't provide prebuilt AAR for older version, so it will attempt to rebuild from source

image

Changes

  • added method toPlatformFileString(File path) to android/build.gradle to replace windows file separator character with '/'
  • call toPlatformFileString on cmake arguments REACT_NATIVE_DIR
  • fix sources taken from this PR

Test code and steps to reproduce

  • create new project with RN v0.64.3
  • install latest version of react-native-reanimated
  • try to build apk for Android ./gradlew clean installDebug

Checklist

  • Included code example that can be used to test this change
  • Updated TS types
  • Added TS types tests
  • Added unit / integration tests
  • Updated documentation
  • Ensured that CI passes

@tomekzaw
Copy link
Member

tomekzaw commented Nov 9, 2022

Hey @muhamad-rizki, thanks for the PR!

@tomekzaw tomekzaw requested a review from piaskowyk November 9, 2022 07:36
@piaskowyk piaskowyk merged commit 2c9e7cc into software-mansion:main Nov 10, 2022
piaskowyk pushed a commit that referenced this pull request Nov 10, 2022
## Description
I get cmake error (`Invalid character escape '\K'.`) when using latest Reanimated on RN version 0.64.3, this will fix Android build on windows because latest version of reanimated doesn't provide prebuilt AAR for older version, so it will attempt to rebuild from source

![image](https://user-images.githubusercontent.com/15137312/200750965-a126493a-a1c6-4b62-85d0-c91a9f38bed3.png)

## Changes
- added method `toPlatformFileString(File path)` to android/build.gradle to replace windows file separator character with '/'
- call `toPlatformFileString` on cmake arguments REACT_NATIVE_DIR
- fix sources taken from [this PR](Kudo/react-native-v8#132)

## Test code and steps to reproduce
- create new project with RN v0.64.3
- install latest version of react-native-reanimated
- try to build apk for Android `./gradlew clean installDebug`

## Checklist

- [ ] Included code example that can be used to test this change
- [ ] Updated TS types
- [ ] Added TS types tests
- [ ] Added unit / integration tests
- [ ] Updated documentation
- [ ] Ensured that CI passes
fluiddot pushed a commit to wordpress-mobile/react-native-reanimated that referenced this pull request Jun 5, 2023
## Description
I get cmake error (`Invalid character escape '\K'.`) when using latest Reanimated on RN version 0.64.3, this will fix Android build on windows because latest version of reanimated doesn't provide prebuilt AAR for older version, so it will attempt to rebuild from source

![image](https://user-images.githubusercontent.com/15137312/200750965-a126493a-a1c6-4b62-85d0-c91a9f38bed3.png)

## Changes
- added method `toPlatformFileString(File path)` to android/build.gradle to replace windows file separator character with '/'
- call `toPlatformFileString` on cmake arguments REACT_NATIVE_DIR
- fix sources taken from [this PR](Kudo/react-native-v8#132)

## Test code and steps to reproduce
- create new project with RN v0.64.3
- install latest version of react-native-reanimated
- try to build apk for Android `./gradlew clean installDebug`

## Checklist

- [ ] Included code example that can be used to test this change
- [ ] Updated TS types
- [ ] Added TS types tests
- [ ] Added unit / integration tests
- [ ] Updated documentation
- [ ] Ensured that CI passes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants