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
https://github.com/Shopify/flash-list/issues/756#issuecomment-1603298448 fixed it for me. Thanks @kadiraydinli.
Add
kotlinVersion = '1.8.10'
toandroid/build.gradle
e.g.+1 . Also happening for me when moving
compileSdkVersion
from33
to34
I noticed that one of Expo’s app uses
@shopify/flash-list
version1.4.3
andreact-native
version0.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 thatkotlinVersion
exists. (https://github.com/expo/expo/blob/aeb017668aa13dbb2252e57d569816a645e364b1/apps/bare-expo/android/build.gradle#L14) After addingkotlinVersion = '1.8.10'
to my own project, I ran the commandcd 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.Still getting the same error
I have the similar problem with the React Native’s CLI
run-android
command when--deviceId
or--list-devices
is specified.FlashList version is 1.4.2.
kotlin version works for me, but the variable name is
kotlin_version = '1.8.10'
,i got error withkotlinVersion
@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?