Compilation error with USE_ANIMATION_BACKEND enabled
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 76/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- android, cpp, react-native, typescript
- Domain
- build-system, mobile
Research direction
Start in Common/cpp/reanimated/Fabric/updates/AnimatedPropsRegistry.cpp and inspect roundTextMetrics alongside the USE_ANIMATION_BACKEND build guards. Reproduce the Android New Architecture build with that flag enabled and check whether the function is unused in that configuration. Done when the build succeeds without the reported -Wunneeded-internal-declaration error.
Written by the indexing model from the issue text.
Description
Description
Hi,
There is a compilation error when building an application with reanimated 4.8.0 & worklets 0.14.0 with "USE_ANIMATION_BACKEND": true
/Users/viljami/Projects/foobar/node_modules/react-native-reanimated/Common/cpp/reanimated/Fabric/updates/AnimatedPropsRegistry.cpp:33:13: error: function 'roundTextMetrics' is not needed and will not be emitted [-Werror,-Wunneeded-internal-declaration] 33 | static void roundTextMetrics(folly::dynamic &updates) { | ^~~~~~~~~~~~~~~~ 1 error generated.
It can be resolved by adding 'maybe_unused' with a patch:
index ef1b65a..9410cc8 100644
--- a/node_modules/react-native-reanimated/Common/cpp/reanimated/Fabric/updates/AnimatedPropsRegistry.cpp
+++ b/node_modules/react-native-reanimated/Common/cpp/reanimated/Fabric/updates/AnimatedPropsRegistry.cpp
@@ -30,7 +30,7 @@ static inline std::shared_ptr<const ShadowNode> shadowNodeFromValue(
}
}
-static void roundTextMetrics(folly::dynamic &updates) {
+[[maybe_unused]] static void roundTextMetrics(folly::dynamic &updates) {
for (const auto *propName : TEXT_METRIC_PROP_NAMES) {
auto *value = updates.get_ptr(propName);
if (value != nullptr && value->isNumber()) {
Steps to reproduce
- Toggle "USE_ANIMATION_BACKEND": true
- Try to compile the application
Snack or a link to a repository
Reanimated version
4.8.0
Worklets version
0.14.0
React Native version
0.88.1
Platforms
Android
JavaScript runtime
Hermes
Workflow
React Native CLI
Architecture
New Architecture (Fabric renderer)
Reanimated feature flags
Yes
React Native release level
None
Build type
Release app & dev bundle
Device
Android emulator
Host machine
macOS
Device model
No response
Acknowledgements
Yes
- Dominant language
- TypeScript
- Stars
- 11.1k
- Forks
- 1.6k
- Avg merge
- 3d 9h
- Merged PRs (30d)
- 255
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- No contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from software-mansion/react-native-reanimated
-
Missing info Missing repro Platform: Android
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
software-mansion/react-native-reanimated#11357 · 1 comment ·
Maintainers usually reply within 1 day
-
Repro provided
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
software-mansion/react-native-reanimated#11154 ·
Maintainers usually reply within 1 day
-
The runtime-tests driver takes the iOS path when `--serial` is given without `--platform android`OpenPlatform: Android Repro provided
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
software-mansion/react-native-reanimated#11153 ·
Maintainers usually reply within 1 day
-
Platform: Android Platform: iOS Repro provided
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
software-mansion/react-native-reanimated#11152 ·
Maintainers usually reply within 1 day
-
Android: keyboard height remains stale when IME disappears without a closing animationPossibly taken @jaxnnux claimed this 24 days ago. OpenMissing info Missing repro Platform: Android
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
software-mansion/react-native-reanimated#11106 · 2 comments ·
Maintainers usually reply within 1 day
All issues in software-mansion/react-native-reanimated
Similar issues
-
Add Alice&BotOpen
Difficulty 1/5 Under an hour Newbie friendliness 72/100
slavakurilyak/awesome-ai-agents#1048 ·
-
bot:ai-assisted component:faucet github_actions security status:untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
midnightntwrk/midnight-faucet-api#215 ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
NanmiCoder/cc-haha#2034 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
MoonshotAI/kimi-code#5539 ·
Maintainers usually reply within 1 day
-
mobile prio:low
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
digitalfabrik/entitlementcard#3324 ·
Maintainers usually reply within 2 days