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

🐛 Build error in version 0.7.2 with react-native 0.74.4 and kotlin 1.9 #403

Closed
3 of 4 tasks
Regina-v opened this issue Aug 5, 2024 · 6 comments
Closed
3 of 4 tasks

Comments

@Regina-v
Copy link

Regina-v commented Aug 5, 2024

What's happening?

After upgrading react-native-quick-crypto to 0.7.2 I was not able to build my app anyomore in android. My app uses react-native 0.74.4.

The build failed with:


* What went wrong:
A problem occurred configuring root project 'myApp'.
> Could not determine the dependencies of null.
   > Could not resolve all task dependencies for configuration ':classpath'.
      > Could not find org.jetbrains.kotlin:kotlin-gradle-plugin:.
        Required by:
            project :

When I add the kotlin version explicitely in the android/build.gradle like so:

classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion")

I get tons of errors like

e: /path/to/my-app/node_modules/@react-native/gradle-plugin/src/main/kotlin/com/facebook/react/utils/TaskUtils.kt: (27, 12): Class 'kotlin.collections.ArraysKt___ArraysKt' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.9.0, expected version is 1.7.1.
The class is loaded from /path/to/.gradle/wrapper/dists/gradle-8.6-all/3mbtmo166bl6vumsh5k2lkq5h/gradle-8.6/lib/kotlin-stdlib-1.9.20.jar!/kotlin/collections/ArraysKt___ArraysKt.class

I was confused about who is expecting kotlin 1.7 in my app since I'm using react-native 0.74.4 and react-native itself upgraded to kotlin 1.9 in RN 0.74. I found out that react-native-quick-crypto brings react-native 0.72.7 into my app which uses kotlin 1.7, which is then picked up and brings the build errors.

Downgrading react-native-quick-crypto to 0.7.1 solves the issue for me since react-native 0.72.7 was only added as a dependency in 0.7.2.

Reproducible Code

N/A

Relevant log output

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'myApp'.
> Could not determine the dependencies of null.
   > Could not resolve all task dependencies for configuration ':classpath'.
      > Could not find org.jetbrains.kotlin:kotlin-gradle-plugin:.
        Required by:
            project :

Device

Android

QuickCrypto Version

0.7.2

Can you reproduce this issue in the QuickCrypto Example app?

No, I cannot reproduce the issue in the Example app

Additional information

@Ahmedhamed77
Copy link

Ahmedhamed77 commented Aug 5, 2024

same error here
I created a repo to the issue
https://github.com/Ahmedhamed77/rn-upgrade-quick-crypto
the repo has the latest version of react-native 0.74.5
in android folder try ./gradlew clean
the error will be the same as in the issue

@Thinhnguyen185
Copy link

same error here

@Ahmedhamed77
Copy link

@Thinhnguyen185 if you want a quick fix, you can fork the lib and then upgrade the react-native to 74 that's how I use it now

@boorad
Copy link
Collaborator

boorad commented Aug 11, 2024

I was able to build this in Android Studio with no issues.

However, I'm merging #399 and moving react and react-native out of dependencies and into devDependencies and peerDependencies so please try again with 0.7.3

@boorad
Copy link
Collaborator

boorad commented Aug 14, 2024

Hoping 0.7.3 release solved this. If not, reopen.

@boorad boorad closed this as completed Aug 14, 2024
@Regina-v
Copy link
Author

Thank you @boorad for the fix! It works for me now with 0.7.3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants