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/[email protected]
├── @babel/[email protected]
├── @babel/[email protected]
├── @react-native-async-storage/[email protected]
├── @react-native-clipboard/[email protected]
├── @react-native-community/[email protected]
├── @react-native-community/[email protected]
├── @react-native-masked-view/[email protected]
├── @react-native-picker/[email protected]
├── @react-navigation/[email protected]
├── @react-navigation/[email protected]
├── @react-navigation/[email protected]
├── @react-navigation/[email protected]
├── @reduxjs/[email protected]
├── @rnx-kit/[email protected]
├── @types/[email protected]
├── @types/[email protected]
├── @types/[email protected]
├── @types/[email protected]
├── @types/[email protected]
├── @typescript-eslint/[email protected]
├── @typescript-eslint/[email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
└── [email protected]

./ > npm explain react-native-screens
[email protected]
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/[email protected]
  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/[email protected]
  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 [email protected].

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 <[email protected]>
Co-authored-by: Kacper Kafara <[email protected]>
@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 <[email protected]>
Co-authored-by: Kacper Kafara <[email protected]>
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