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

feat: make android compile #402

Merged
merged 1 commit into from
Dec 7, 2024
Merged

feat: make android compile #402

merged 1 commit into from
Dec 7, 2024

Conversation

jpudysz
Copy link
Owner

@jpudysz jpudysz commented Dec 7, 2024

Summary

Fixes #373

The issue was hard to fix because I initially thought it was related to CMakeLists.txt, as the compiler was throwing numerous Nitro/C++ errors.
After many attempts, I managed to build it by simply switching the JDK to version 17 via the Android Studio GUI.
Unfortunately, this solution only worked after running ./gradlew clean and manually removing some cached folders.

For Expo users building with EAS, this approach wasn't viable. We needed a way to build Unistyles 3.0 on Android out of the box.

After further investigation, it turned out to be a simple issue with abiFilters used by React Native. I had tried adjusting it multiple times before, but Android’s caching system is far too aggressive.

This patch will be included by default in beta.2, but if you want to run it on .beta1, follow these steps:

For Expo:

  1. rm -rf node_modules
  2. Reinstall the dependencies
  3. Run yarn expo prebuild --clean

For Bare React Native:

  1. rm -rf node_modules
  2. Reinstall the dependencies
  3. Remove the cached folders:
    • rm -rf android/.cxx
    • rm -rf android/build
image

Copy link

vercel bot commented Dec 7, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
react-native-unistyles-2.0 ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 7, 2024 10:01pm
react-native-unistyles-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 7, 2024 10:01pm

@jpudysz jpudysz merged commit 0e4603c into main Dec 7, 2024
4 checks passed
@jpudysz jpudysz deleted the feature/android branch December 7, 2024 22:02
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.

C++ error when building for android
1 participant