react-native-reanimated icon indicating copy to clipboard operation
react-native-reanimated copied to clipboard

not working with react native 0.69.0-rc.6 for react-native-reanimated 3.0.0-rc.0 on android

Open xiongemi opened this issue 2 years ago • 17 comments

Description

try react native 0.69.0-rc.6. throw an error with react-native-reanimated 3.0.0-rc.0 on android.

error:

FAILURE: Build failed with an exception.

* Where:
Build file '/Users/emilyxiong/Code/tmp/studio-ghibli-search-engine/node_modules/react-native-reanimated/android/build.gradle' line: 541

* What went wrong:
A problem occurred evaluating project ':react-native-reanimated'.
> Expected directory '/Users/emilyxiong/Code/tmp/studio-ghibli-search-engine/node_modules/react-native/android' to contain exactly one file, however, it contains more than one file.

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 18s

    at makeError (/Users/emilyxiong/Code/tmp/studio-ghibli-search-engine/node_modules/execa/index.js:174:9)
    at /Users/emilyxiong/Code/tmp/studio-ghibli-search-engine/node_modules/execa/index.js:278:16
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
    at async runOnAllDevices (/Users/emilyxiong/Code/tmp/studio-ghibli-search-engine/node_modules/@react-native-community/cli-platform-android/build/commands/runAndroid/runOnAllDevices.js:109:5)
    at async Command.handleAction (/Users/emilyxiong/Code/tmp/studio-ghibli-search-engine/node_modules/@react-native-community/cli/build/index.js:192:9)

my complete dependencies:

 "dependencies": {
    "@emotion/react": "11.9.3",
    "@emotion/styled": "11.9.3",
    "@mui/icons-material": "^5.8.0",
    "@mui/material": "^5.8.1",
    "@react-navigation/native": "^6.0.10",
    "@react-navigation/native-stack": "^6.6.2",
    "@reduxjs/toolkit": "1.8.2",
    "@storybook/core-server": "6.5.9",
    "connected-react-router": "^6.9.2",
    "core-js": "^3.6.5",
    "formik": "^2.2.9",
    "formik-mui": "^4.0.0-alpha.3",
    "history": "^5.3.0",
    "react": "18.2.0",
    "react-dom": "18.2.0",
    "react-native": "0.0.0-20220614-2054-bcc69dfb3",
    "react-native-paper": "^4.12.1",
    "react-native-safe-area-context": "^4.2.5",
    "react-native-screens": "^3.13.1",
    "react-native-vector-icons": "^9.1.0",
    "react-native-web": "^0.17.7",
    "react-redux": "8.0.2",
    "react-router-dom": "^6.3.0",
    "redux-persist": "^6.0.0",
    "regenerator-runtime": "0.13.7",
    "tslib": "^2.0.0",
    "@storybook/builder-webpack5": "~6.5.4",
    "@storybook/manager-webpack5": "~6.5.4"
  },
  "devDependencies": {
    "@nrwl/cypress": "14.3.6",
    "@nrwl/detox": "14.3.6",
    "@nrwl/eslint-plugin-nx": "14.3.6",
    "@nrwl/jest": "14.3.6",
    "@nrwl/linter": "14.3.6",
    "@nrwl/react": "14.3.6",
    "@nrwl/react-native": "14.3.6",
    "@nrwl/storybook": "14.3.6",
    "@nrwl/web": "14.3.6",
    "@nrwl/workspace": "14.3.6",
    "@react-native-async-storage/async-storage": "1.17.6",
    "@react-native-community/cli": "8.0.2",
    "@react-native-community/cli-platform-android": "8.0.2",
    "@react-native-community/cli-platform-ios": "8.0.2",
    "@react-native-masked-view/masked-view": "^0.2.6",
    "@storybook/addon-essentials": "6.5.9",
    "@storybook/addon-ondevice-actions": "6.0.1-beta.6",
    "@storybook/addon-ondevice-backgrounds": "6.0.1-beta.6",
    "@storybook/addon-ondevice-controls": "6.0.1-beta.6",
    "@storybook/addon-ondevice-notes": "6.0.1-beta.6",
    "@storybook/react": "6.5.9",
    "@storybook/react-native": "6.0.1-beta.6",
    "@testing-library/jest-dom": "5.16.1",
    "@testing-library/jest-native": "4.0.5",
    "@testing-library/react": "13.3.0",
    "@testing-library/react-native": "9.1.0",
    "@types/jest": "27.4.1",
    "@types/jest-axe": "^3.5.3",
    "@types/lodash": "^4.14.176",
    "@types/node": "18.0.0",
    "@types/react": "18.0.13",
    "@types/react-dom": "18.0.5",
    "@types/react-native": "0.67.8",
    "@types/react-router-dom": "5.3.3",
    "@types/redux-logger": "^3.0.9",
    "@types/redux-mock-store": "^1.0.3",
    "@types/string-similarity": "^4.0.0",
    "@typescript-eslint/eslint-plugin": "5.24.0",
    "@typescript-eslint/parser": "5.24.0",
    "babel-jest": "28.1.0",
    "babel-plugin-module-resolver": "^4.1.0",
    "babel-plugin-react-native-web": "^0.17.7",
    "cypress": "^8.3.0",
    "cypress-axe": "^0.13.0",
    "detox": "19.7.1",
    "eslint": "8.15.0",
    "eslint-config-prettier": "8.1.0",
    "eslint-plugin-cypress": "^2.10.3",
    "eslint-plugin-import": "2.26.0",
    "eslint-plugin-jsx-a11y": "6.5.1",
    "eslint-plugin-react": "7.30.0",
    "eslint-plugin-react-hooks": "4.6.0",
    "gh-pages": "^3.2.3",
    "jest": "27.5.1",
    "jest-axe": "^6.0.0",
    "jest-circus": "27.2.3",
    "jest-react-native": "18.0.0",
    "lodash": "^4.17.21",
    "metro": "0.71.1",
    "metro-babel-register": "0.71.1",
    "metro-minify-uglify": "^0.71.1",
    "metro-react-native-babel-preset": "0.71.1",
    "metro-resolver": "0.71.1",
    "metro-transform-worker": "^0.71.1",
    "nx": "14.3.6",
    "prettier": "2.7.1",
    "react-native-config": "1.4.6",
    "react-native-gesture-handler": "^2.4.2",
    "react-native-reanimated": "^3.0.0-rc.0",
    "react-native-storybook-loader": "^2.0.5",
    "react-native-style-tachyons": "^4.2.1",
    "react-native-svg": "12.3.0",
    "react-native-svg-transformer": "1.0.0",
    "react-refresh": "~0.10.0",
    "react-test-renderer": "18.2.0",
    "redux-logger": "^3.0.6",
    "redux-mock-store": "^1.5.4",
    "string-similarity": "^4.0.4",
    "stringify-entities": "^4.0.2",
    "truncate": "^3.0.0",
    "ts-jest": "27.1.4",
    "typescript": "4.7.4",
    "webpack-bundle-analyzer": "^4.5.0"
  }

Expected behavior

should be able run with react nativev 0.69.0

Actual behavior & steps to reproduce

Snack or minimal code example

Package versions

name version
react-native 0.69.0-rc.6
react-native-reanimated 3.0.0-rc.0
NodeJS v14.17.0
Xcode
Java
Gradle 7.3.3
expo

Affected platforms

  • [x] Android
  • [ ] iOS
  • [ ] Web

xiongemi avatar Jun 22 '22 16:06 xiongemi

Hey! 👋

It looks like you've omitted a few important sections from the issue template.

Please complete Snack or minimal code example section.

github-actions[bot] avatar Jun 22 '22 16:06 github-actions[bot]

Hey! 👋

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

Could you provide a snippet of code, a snack or a link to a GitHub repository that reproduces the problem?

github-actions[bot] avatar Jun 22 '22 16:06 github-actions[bot]

the same! need help

image

cuongtq100 avatar Jun 23 '22 03:06 cuongtq100

i meet the same question like the first message, when i upgrade with react-native, it can't work as i want.

cmdparkour avatar Jun 23 '22 03:06 cmdparkour

same!

Screen Shot 2022-06-23 at 10 58 01

muhyirasyidin avatar Jun 23 '22 03:06 muhyirasyidin

i think the question is about this in android/build.gradle image

cmdparkour avatar Jun 23 '22 04:06 cmdparkour

but i don't know how to fix it in the build.gradle

cmdparkour avatar Jun 23 '22 04:06 cmdparkour

i fixed it by change the "//.arr" to "react-native///.aar" in the file: android/build.gradle

cmdparkour avatar Jun 23 '22 04:06 cmdparkour

because the findTree.singleFile is a single file choose, but can't find the path when the rn upgrade

cmdparkour avatar Jun 23 '22 04:06 cmdparkour

I don't think the latest stable version 2.8.0 supports react-native 0.69.0. Until v3 is released, you can try installing the 3.0.0-rc.0 version.

yarn add react-native-reanimated@next

drante avatar Jun 23 '22 07:06 drante

@drante i tried with version 3.0.0-rc.0, still does not work with 0.69.0 on android.

xiongemi avatar Jun 23 '22 16:06 xiongemi

@drante i tried with version 3.0.0-rc.0, still does not work with 0.69.0 on android.

Do you get the same errors?

drante avatar Jun 23 '22 17:06 drante

@drante i got the same error. as @cmdparkour mentioned above, the error is with react-native-reanimated android/build.gradle, need tochange the "//.arr" to "react-native///.aar" in the file: android/build.gradle/

xiongemi avatar Jun 23 '22 17:06 xiongemi

I got the issue with iOS while using 3.0.0-rc.0 with RN 0.69.0

anybody have any idea?

sagark1510 avatar Jun 29 '22 00:06 sagark1510

Ok, first of all, if you want to use RN 0.69, use reanimated 3.0.0-rc.0. Versions 2.x of reanimated don't support RN 0.69 and there will be a warning about this and it will be mentioned in the docs. This should fix the error with rnMinorVersion

About the error from the issue: Expected directory '/Users/emilyxiong/Code/tmp/studio-ghibli-search-engine/node_modules/react-native/android' to contain exactly one file, however, it contains more than one file. This is because according to your package.json you're using an alpha version of RN ("0.0.0-20220614-2054-bcc69dfb3") and not the stable version ("0.69.0"). In our gradle file there is a code like this:

def rnAarMatcher = "**/react-native/**/*${buildType}.aar"
    if (rnMinorVersion < 69) {
        rnAarMatcher = "**/**/*.aar"
    }
def rnAAR = fileTree("$reactNative/android").matching({ it.include rnAarMatcher }).singleFile

So if you're using an alpha version, the rnMinorVersion is 0, the regex is set to "**/**/*.aar" and it detects also hermes aars. So the workaround for now would be changing that regex or using 0.69 version of RN. It should work with the alpha version though, so we need to fix it.

@sagark1510 your issue is unrelated to this one and will be fixed with this pr: https://github.com/software-mansion/react-native-reanimated/pull/3314

graszka22 avatar Jun 29 '22 13:06 graszka22

I'm getting the same error as you (using reanimated ^3.0.0-rc.0 and RN 0.69.3). Did you find a solution to this issue @sagark1510 ?

hadnet avatar Aug 30 '22 03:08 hadnet

same!

Screen Shot 2022-06-23 at 10 58 01

Yes, same to me.

loyalty-thameem avatar Sep 30 '22 12:09 loyalty-thameem