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

Android build failure 3.27.0 #1947

Closed
bhandanyan-nomad opened this issue Oct 24, 2023 · 14 comments · Fixed by #1977
Closed

Android build failure 3.27.0 #1947

bhandanyan-nomad opened this issue Oct 24, 2023 · 14 comments · Fixed by #1977
Assignees
Labels
Missing info The user didn't precise the problem enough Missing repro This issue need minimum repro scenario Platform: Android This issue is specific to Android

Comments

@bhandanyan-nomad
Copy link

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 github-actions bot added the Missing repro This issue need minimum repro scenario label Oct 24, 2023
@github-actions
Copy link

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 github-actions bot added Platform: Android This issue is specific to Android Missing info The user didn't precise the problem enough labels Oct 24, 2023
@github-actions
Copy link

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
Copy link
Member

kkafar commented Oct 24, 2023

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

@tboba tboba added the Close when stale This issue is going to be closed when there is no activity for a while label Oct 26, 2023
@exotexot
Copy link

exotexot commented Oct 31, 2023

Same issue..

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

@github-actions github-actions bot removed the Close when stale This issue is going to be closed when there is no activity for a while label Oct 31, 2023
@tboba
Copy link
Member

tboba commented Nov 2, 2023

@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
Copy link

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
Copy link

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
Copy link

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.

@tboba tboba self-assigned this Nov 16, 2023
@atkristin
Copy link

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

Reverting to 3.26.0 fixes the issue.

@tboba
Copy link
Member

tboba commented Nov 20, 2023

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
Copy link

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
Copy link
Author

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

This seems to fix the build for my project

@tboba
Copy link
Member

tboba commented Nov 22, 2023

@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 🙏

tboba added a commit that referenced this issue Nov 29, 2023
## Description

Users are reporting that they are receiving error while building their
project with react-native-screens 3.27.0:

```
> 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)
```

This error is fairly easy to fix and is related to the wrong imports of
dependencies in gradle.
Closes #1947.

## Changes

- Added import for `lifecycle-viewmodel` and `lifecycle-viewmodel-ktx`
(these two imports are necessary, as `lifecycle-viewmodel` evokes error
for `lifecycle-viewmodel-ktx`.

## Checklist

- [ ] Ensured that CI passes

---------

Co-authored-by: Kacper Kafara <kacperkafara@gmail.com>
Co-authored-by: Kacper Kafara <kacper.kafara@swmansion.com>
@omardiaa
Copy link

omardiaa commented Dec 3, 2023

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.

ja1ns pushed a commit to WiseOwlTech/react-native-screens that referenced this issue Oct 9, 2024
…-mansion#1977)

## Description

Users are reporting that they are receiving error while building their
project with react-native-screens 3.27.0:

```
> 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)
```

This error is fairly easy to fix and is related to the wrong imports of
dependencies in gradle.
Closes software-mansion#1947.

## Changes

- Added import for `lifecycle-viewmodel` and `lifecycle-viewmodel-ktx`
(these two imports are necessary, as `lifecycle-viewmodel` evokes error
for `lifecycle-viewmodel-ktx`.

## Checklist

- [ ] Ensured that CI passes

---------

Co-authored-by: Kacper Kafara <kacperkafara@gmail.com>
Co-authored-by: Kacper Kafara <kacper.kafara@swmansion.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Missing info The user didn't precise the problem enough Missing repro This issue need minimum repro scenario Platform: Android This issue is specific to Android
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants