flash-list: Error in react native 71, Execution failed for task ':shopify_flash-list:compileDebugKotlin'.

Current behavior

I’m getting this error on new project that i made. `Execution failed for task ‘:shopify_flash-list:compileDebugKotlin’.

Error while evaluating property ‘filteredArgumentsMap’ of task ‘:shopify_flash-list:compileDebugKotlin’ Could not resolve all files for configuration ‘:shopify_flash-list:debugCompileClasspath’. Failed to transform lifecycle-common-2.3.1.jar (androidx.lifecycle:lifecycle-common:2.3.1) to match attributes {artifactType=android-classes-jar, org.gradle.category=library, org.gradle.dependency.bundling=external, org.gradle.jvm.version=7, org.gradle.libraryelements=jar, org.gradle.status=release, org.gradle.usage=java-api}. Could not find lifecycle-common-2.3.1.jar (androidx.lifecycle:lifecycle-common:2.3.1). Searched in the following locations: https://dl.google.com/dl/android/maven2/androidx/lifecycle/lifecycle-common/2.3.1/lifecycle-common-2.3.1.jar`

Expected behavior

To Reproduce

create a new react native project and install the library.

Platform:

  • [x ] Android

Environment

latest version of @shopify/flash-list: “^1.4.1” “react-native”: “0.71.1”,

About this issue

  • Original URL
  • State: open
  • Created a year ago
  • Reactions: 9
  • Comments: 25

Most upvoted comments

https://github.com/Shopify/flash-list/issues/756#issuecomment-1603298448 fixed it for me. Thanks @kadiraydinli.

Add kotlinVersion = '1.8.10' to android/build.gradle e.g.

buildscript {
    ext {
        ...
        kotlinVersion = '1.8.10'
    }
}

+1 . Also happening for me when moving compileSdkVersion from 33 to 34

I noticed that one of Expo’s app uses @shopify/flash-list version 1.4.3 and react-native version 0.72.0. (https://github.com/expo/expo/blob/aeb017668aa13dbb2252e57d569816a645e364b1/apps/bare-expo/package.json#L70)

When I examined the project’s android/build.gradle file, I saw that kotlinVersion exists. (https://github.com/expo/expo/blob/aeb017668aa13dbb2252e57d569816a645e364b1/apps/bare-expo/android/build.gradle#L14) After adding kotlinVersion = '1.8.10' to my own project, I ran the command cd android && ./gradlew clean && cd ... After that, when I ran the project, I did not encounter any problems.

I’m not sure what a healthy fix this fix is but it worked for me.

Also happening for me when updating compileSdkVersion from 33 to 34. Have tried specifying the Kotlin version with no luck unfortunately.

#756 (comment) fixed it for me. Thanks @kadiraydinli.

Add kotlinVersion = '1.8.10' to android/build.gradle e.g.

buildscript {
    ext {
        ...
        kotlinVersion = '1.8.10'
    }
}

Still getting the same error

Execution failed for task ':shopify_flash-list:compileDebugKotlin'.
> A failure occurred while executing org.jetbrains.kotlin.compilerRunner.GradleCompilerRunnerWithWorkers$GradleKotlinCompilerWorkAction

I have the similar problem with the React Native’s CLI run-android command when --deviceId or --list-devices is specified.

System:
    OS: macOS 13.3.1
    CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
    Memory: 46.51 MB / 16.00 GB
    Shell: 5.9 - /usr/local/bin/zsh
  Binaries:
    Node: 16.17.0 - /usr/local/bin/node
    Yarn: 1.22.19 - /usr/local/bin/yarn
    npm: 8.15.0 - /usr/local/bin/npm
    Watchman: 2023.01.23.00 - /usr/local/bin/watchman
  Managers:
    CocoaPods: 1.11.3 - /Users/user/.rbenv/shims/pod
  SDKs:
    iOS SDK:
      Platforms: DriverKit 22.4, iOS 16.4, macOS 13.3, tvOS 16.4, watchOS 9.4
    Android SDK: Not Found
  IDEs:
    Android Studio: 2022.1 AI-221.6008.13.2211.9619390
    Xcode: 14.3/14E222b - /usr/bin/xcodebuild
  Languages:
    Java: 11.0.16.1 - /usr/local/opt/openjdk@11/bin/javac
  npmPackages:
    @react-native-community/cli: 10.2.1 => 10.2.1
    react: 18.2.0 => 18.2.0
    react-native: 0.71.6 => 0.71.6
    react-native-macos: Not Found
  npmGlobalPackages:
    *react-native*: Not Found

FlashList version is 1.4.2.

kotlin version works for me, but the variable name is kotlin_version = '1.8.10' ,i got error with kotlinVersion

@naqvitalha you’re right it works on 0.71.x but not on 0.72.x.due to the Gradle version. As the RN core team said the RC 5 will be the last one and we can expect 0.72 to be the new stable version. and a lot of devs are gonna upgrade to it and they will face this issue as well. do you have any idea or ETA on the fix for this?