software-mansion / react-native-screens

Native navigation primitives for your React Native app.
https://docs.swmansion.com/react-native-screens/
MIT License
3.04k stars 515 forks source link

Android build failure 3.27.0 #1947

Closed bhandanyan-nomad closed 10 months ago

bhandanyan-nomad commented 12 months ago

Description

Android failing on the new version. Different error message than the failure on prior version.

> A failure occurred while executing com.android.build.gradle.internal.tasks.CheckDuplicatesRunnable
   > Duplicate class androidx.lifecycle.ViewModelLazy found in modules jetified-lifecycle-viewmodel-ktx-2.2.0-runtime (androidx.lifecycle:lifecycle-viewmodel-ktx:2.2.0) and lifecycle-viewmodel-2.5.0-runtime (androidx.lifecycle:lifecycle-viewmodel:2.5.0)

Steps to reproduce

Install 3.27.0 and build android

Snack or a link to a repository

-

Screens version

3.27.0

React Native version

0.70.13

Platforms

Android

JavaScript runtime

Hermes

Workflow

React Native (without Expo)

Architecture

Paper (Old Architecture)

Build type

None

Device

None

Device model

No response

Acknowledgements

Yes

github-actions[bot] commented 12 months 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?

github-actions[bot] commented 12 months ago

Hey! 👋

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

Please complete Snack or a link to a repository section.

kkafar commented 12 months ago

Hey @bhandanyan-nomad, would you mind providing your dependencies list? (Full reproduction would be even better...)

exotexot commented 11 months ago

Same issue..

And I can confirm that rolling back to 3.26.0 fixes the issue for me.

tboba commented 11 months ago

@exotexot thanks for confirming the issue!

Unfortunately we still cannot do much without a repro - in our case our example apps are building correctly. Can you create a minimal repro with the exact problem you're facing? If it's not possible for you, please at least put a list of dependencies you're using in your project.

kevindice commented 11 months ago

3.25.0 is fine for me, but both 3.26.0 and 3.27.0 result in this error. Possibly too tightly specifying native dependencies here?

Victor-ARC commented 11 months ago

Hi! I'm also unable to build the android version of my app. I'm getting this error in the stacktrace output from Gradle:

./ > cd android
./android > ./gradlew clean
...
BUILD SUCCESSFUL in 13s
25 actionable tasks: 21 executed, 4 up-to-date
./android > ./gradlew assembleRelease --stacktrace --debug
...
2023-11-02T13:24:33.261-0600 [ERROR] [system.err] e: My Project/node_modules/react-native-screens/android/build/.transforms/b4fe0943e78024b160e5679d833ef52a/transformed/out/jars/classes.jar!/META-INF/react-native-screens_release.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.8.0, expected version is 1.6.0.
...
2023-11-02T13:24:59.987-0600 [ERROR] [org.gradle.internal.buildevents.BuildResultLogger] BUILD FAILED in 2m 15s
2023-11-02T13:24:59.987-0600 [LIFECYCLE] [org.gradle.internal.buildevents.TaskExecutionStatisticsReporter] 578 actionable tasks: 13 executed, 565 up-to-date

Here's a list of the deps I'm working with:

./ > npm ls
My project
├── @aws-amplify/pushnotification@4.3.43
├── @babel/core@7.23.2
├── @babel/runtime@7.23.2
├── @react-native-async-storage/async-storage@1.19.4
├── @react-native-clipboard/clipboard@1.12.1
├── @react-native-community/netinfo@9.5.0
├── @react-native-community/push-notification-ios@1.11.0
├── @react-native-masked-view/masked-view@0.2.9
├── @react-native-picker/picker@2.5.1
├── @react-navigation/bottom-tabs@6.5.11
├── @react-navigation/core@6.4.10
├── @react-navigation/native-stack@6.9.16
├── @react-navigation/native@6.1.9
├── @reduxjs/toolkit@1.9.7
├── @rnx-kit/align-deps@2.2.5
├── @types/react-native-dotenv@0.2.1
├── @types/react-native-vector-icons@6.4.16
├── @types/react-native@0.70.16
├── @types/react-redux@7.1.28
├── @types/redux-logger@3.0.11
├── @typescript-eslint/eslint-plugin@5.62.0
├── @typescript-eslint/parser@5.62.0
├── aws-amplify@4.3.46
├── axios@0.27.2
├── babel-plugin-inline-import@3.0.0
├── base-64@1.0.0
├── deprecated-react-native-prop-types@2.3.0
├── eslint-config-prettier@8.10.0
├── eslint-plugin-deprecation@1.5.0
├── eslint-plugin-react-hooks@4.6.0
├── eslint@8.52.0
├── ios-deploy@1.12.2
├── metro-react-native-babel-preset@0.72.4
├── mixpanel-react-native@2.3.1
├── prettier@2.8.8
├── react-native-dotenv@3.4.9
├── react-native-email-link@1.14.7
├── react-native-fast-image@8.6.3
├── react-native-haptic-feedback@2.2.0
├── react-native-iaphub@8.4.2
├── react-native-keyboard-aware-scroll-view@0.9.5
├── react-native-linear-gradient@2.8.3
├── react-native-orientation-locker@1.5.0
├── react-native-plaid-link-sdk@8.0.1
├── react-native-reanimated@2.17.0
├── react-native-safe-area-context@4.7.4
├── react-native-screens@3.27.0
├── react-native-svg@12.5.1
├── react-native-vector-icons@9.2.0
├── react-native-webview@11.26.1
├── react-native-windows@0.70.21
├── react-native-youtube-iframe@2.3.0
├── react-native@0.70.14
├── react-redux@8.1.3
├── react@18.1.0
├── redux-logger@3.0.6
├── redux-persist@6.0.0
├── redux-thunk@2.4.2
├── redux@4.2.1
├── typescript@4.9.5
└── victory-native@36.6.12

./ > npm explain react-native-screens
react-native-screens@3.27.0
node_modules/react-native-screens
  react-native-screens@"^3.25.0" from the root project
  peer react-native-screens@">= 3.0.0" from @react-navigation/bottom-tabs@6.5.11
  node_modules/@react-navigation/bottom-tabs
    @react-navigation/bottom-tabs@"^6.4.0" from the root project
  peer react-native-screens@">= 3.0.0" from @react-navigation/native-stack@6.9.16
  node_modules/@react-navigation/native-stack
    @react-navigation/native-stack@"^6.9.1" from the root project

Hope this is useful! :D

kevindice commented 11 months ago

My teammate reported that upgrading kotlin from 1.7.x to 1.8.0 did the trick for him. We ended up reverting to RNS 1.25.0 but would be happy to verify with 1.27.0.

atkristin commented 11 months ago

I believe there is a conflict with react-native-gesture-handler@2.13.4.

Reverting to 3.26.0 fixes the issue.

tboba commented 11 months ago

Hi guys! I've managed to reproduce this problem (after a long battle with configuring the exact same environment 😅). Could you please check if the version from this branch resolves your issue?

Just change the version of react-native-screens in your package.json to:

    "react-native-screens": "software-mansion/react-native-screens#@tboba/fix-screens-327",

Thanks! cc @bhandanyan-nomad @exotexot @kevindice @Victor-ARC @atkristin

azayneeva commented 11 months ago

Hi guys! I've managed to reproduce this problem (after a long battle with configuring the exact same environment 😅). Could you please check if the version from this branch resolves your issue?

Just change the version of react-native-screens in your package.json to:

    "react-native-screens": "software-mansion/react-native-screens#@tboba/fix-screens-327",

Thanks! cc @bhandanyan-nomad @exotexot @kevindice @Victor-ARC @atkristin

@tboba thank you for taking on this issue! 🙌 We faced the same error after upgrading to the latest version, but using the package from your link resolved it. Any chance we could get the new update officially released soon? 🚀 🙏

We bumped into this issue because of a user on iOS 17.2 Beta reported crashes. It seems related to this issue, which appears to be fixed, but hasn't been officially released. Could you please consider releasing these two fixes soon? 🙏 When can we expect the new version to be available?

Thanks once again! 🌟

bhandanyan-nomad commented 11 months ago
software-mansion/react-native-screens#@tboba/fix-screens-327

This seems to fix the build for my project

tboba commented 11 months ago

@azayneeva @bhandanyan-nomad thanks for confirming this branch fixes this bug! I think that we will release a new version in a week or two, so it shouldn't take too long 😅

I'll raise the PR tomorrow 🙏

omardiaa commented 10 months ago

npx expo install react-native-screens ran this to install a compatible version and "react-native-screens": "~3.18.0" was installed and build ran correctly.