software-mansion / react-native-reanimated

React Native's Animated library reimplemented
https://docs.swmansion.com/react-native-reanimated/
MIT License
9.1k stars 1.32k forks source link

[3.14.0] Android - Build android error opacity, nodemanager,... #6655

Closed hoangphucnst closed 2 weeks ago

hoangphucnst commented 3 weeks ago

Description

Task :react-native-reanimated:compileDebugJavaWithJavac FAILED ...\node_modules\react-native-reanimated\android\src\main\java\com\swmansion\reanimated\layoutReanimation\AnimationsManager.java:356: error: pattern matching in instanceof is not supported in -source 11 if (props.get(Snapshot.TRANSFORM_MATRIX) instanceof ReadableNativeArray matrixArray) { ^ (use -source 16 or higher to enable pattern matching in instanceof) ...\node_modules\react-native-reanimated\android\src\main\java\com\swmansion\reanimated\NodesManager.java:440: error: switch rules are not supported in -source 11 case "opacity" -> { ^ (use -source 14 or higher to enable switch rules) 2 errors

When I delete node_module and reinstall it, when I run debug on Android, I get errors like opacity, nodemanager,...

But I saved an old version of node_module before, and when I ran the debug, it ran successfully.

Can you check if my old version, version 3.14.0, is different from the current version 3.14.0?

Thank you

Download module 3.14.0 old here: https://drive.google.com/file/d/1RRqmmdkIQuqs3-yYEKNS9kMeUyP7P9bD/view?usp=sharing

Steps to reproduce

yarn install yarn android => error

Snack or a link to a repository

https://drive.google.com/file/d/1RRqmmdkIQuqs3-yYEKNS9kMeUyP7P9bD/view?usp=sharing

Reanimated version

^3.14.0

React Native version

0.72.14

Platforms

Android

JavaScript runtime

Hermes

Workflow

React Native

Architecture

Paper (Old Architecture)

Build type

Debug app & dev bundle

Device

Android emulator

Device model

No response

Acknowledgements

Yes

github-actions[bot] commented 3 weeks ago

Hey! 👋

The issue doesn't seem to contain a minimal reproduction.

Could you provide a snack or a link to a GitHub repository under your username that reproduces the problem?

tjzel commented 3 weeks ago

You can check the version of reanimated with yarn why react-native-reanimated

abu-bakar-rafi commented 2 weeks ago

Having the same issue

hoangphucnst commented 2 weeks ago

yarn why react-native-reanimated

yarn why v1.22.22 [1/4] 🤔 Why do we have the module "react-native-reanimated"...? [2/4] 🚚 Initialising dependency graph... [3/4] 🔍 Finding dependency... [4/4] 🚡 Calculating file sizes... => Found "react-native-reanimated@3.16.1" info Has been hoisted to "react-native-reanimated" info This module exists because it's specified in "dependencies". info Disk size without dependencies: "10.23MB" info Disk size with unique dependencies: "11.25MB" info Disk size with transitive dependencies: "29.01MB" info Number of shared dependencies: 53 ✨ Done in 2.85s.

I fixed the error by removing the ^ sign in package.json "react-native-reanimated": "^3.11.0" replace to "react-native-reanimated": "3.11.0",

hoangphucnst commented 2 weeks ago

yarn why v1.22.22 [1/4] 🤔 Why do we have the module "react-native-reanimated"...? [2/4] 🚚 Initialising dependency graph... [3/4] 🔍 Finding dependency... [4/4] 🚡 Calculating file sizes... => Found "react-native-reanimated@3.16.1" info Has been hoisted to "react-native-reanimated" info This module exists because it's specified in "dependencies". info Disk size without dependencies: "10.23MB" info Disk size with unique dependencies: "11.25MB" info Disk size with transitive dependencies: "29.01MB" info Number of shared dependencies: 53 ✨ Done in 2.85s.

I fixed the error by removing the ^ sign in package.json "react-native-reanimated": "^3.11.0" replace to "react-native-reanimated": "3.11.0",