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 fails with react native 0.71 - please update kotlin version #777

Closed
1 of 2 tasks
youssdevx opened this issue Mar 2, 2023 · 8 comments
Closed
1 of 2 tasks
Labels
bug Something isn't working

Comments

@youssdevx
Copy link

Current behavior

Build fails on Android

image

Expected behavior

Build should succeed

To Reproduce

Upgrade to React native 0.71 and build on Android

Platform:

  • iOS
  • Android

Environment

  • "@shopify/flash-list": "1.4.1"
  • React Native version: 0.71.3
  • Expo SDK 48

How to fix

In android/build.gradle modify:
ext._kotlinVersion = rootProject.ext.has("kotlinVersion") ? rootProject.ext.get('kotlinVersion') : '1.6.20'

@youssdevx youssdevx added the bug Something isn't working label Mar 2, 2023
@brunosp-49
Copy link

brunosp-49 commented Mar 8, 2023

Hi men, I'm getting the same error, I tried to copy your solution but it's still not working, have you changed something else?
EDIT: for some reason that I have no idea, worked when I set kotlinVersion = "1.6.0" inside build.gradle and classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion") at dependencies

@youssdevx
Copy link
Author

If you're using expo, you can set the kotlin version in app.config.ts

@naqvitalha
Copy link
Collaborator

Is this only happening with expo?

@youssdevx
Copy link
Author

I don't know 🤷🏽‍♂️

@eduardo-santos-tribia
Copy link

I had the same issue and I'm not using Expo. My RN version is 0.71.7.

The fix by @youssdevx worked for me, but I had to remove the _ from kotlinVersion. I don't know the impact of this fix and modifications... would be good if anyone explain more or fix that in a new flash-list update.

This is my modified android/build.gradle file:

buildscript {
    ext {
        ...
        kotlinVersion = rootProject.ext.has("kotlinVersion") ? rootProject.ext.get('kotlinVersion') : '1.6.20'
    }
    ...
}

@Maria4lexzy
Copy link

Maria4lexzy commented May 17, 2023

Worked for me as well, I changed it from kotlin_version to kotlinVersion and it works

my android/build.gradle
ext { ... kotlinVersion = '1.7.10' }
dependencies { ... classpath('org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion') }

@kursatalgul
Copy link

Worked for me as well, I changed it from kotlin_version to kotlinVersion and it works

my android/build.gradle ext { ... kotlinVersion = '1.7.10' } dependencies { ... classpath('org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion') }

Is it expo ? because There is no android folder in Expo

@techvfxking
Copy link

It happened with me also using react native cli

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

7 participants