With the release of v1.1.0, I am getting below mentioned error when building my react native android app
A problem occurred configuring project ':react-native-reanimated'.
> Could not get unknown property 'javaCompileProvider' for object of type com.android.build.gradle.internal.api.LibraryVariantImpl.
The below mentioned code inside build.gradle is problematic:
android.libraryVariants.all { variant ->
def name = variant.name.capitalize()
task "jar${name}"(type: Jar, dependsOn: variant.javaCompileProvider.get()) {
from variant.javaCompileProvider.get().destinationDir
}
}
If this is replaced with the below mentioned code, the said problem is fixed.
android.libraryVariants.all { variant ->
def name = variant.name.capitalize()
task "jar${name}"(type: Jar, dependsOn: variant.javaCompile) {
from variant.javaCompile.destinationDir
}
}
@gmaclennan This is what I have done in the interim. Though would expect a the lib to fix the issue.
Similar to https://github.com/kmagiera/react-native-screens/issues/124, you're probably still using a Gradle version below 4.10. As noted in the PR that made this change only 4.10>= is supported.
The below mentioned code inside
build.gradleis problematic:android.libraryVariants.all { variant -> def name = variant.name.capitalize() task "jar${name}"(type: Jar, dependsOn: variant.javaCompileProvider.get()) { from variant.javaCompileProvider.get().destinationDir } }If this is replaced with the below mentioned code, the said problem is fixed.
android.libraryVariants.all { variant -> def name = variant.name.capitalize() task "jar${name}"(type: Jar, dependsOn: variant.javaCompile) { from variant.javaCompile.destinationDir } }
Thanks its worked
how do i find this file, in my project does not contain that code shown above, when having add this line of code in my build.gradle from android folder, the project shows more error
how do i find this file, in my project does not contain that code shown above, when having add this line of code in my build.gradle from android folder, the project shows more error
you should find 'node_modules\react-native-reanimated\androidbuild.gradle' and edit it
The below mentioned code inside
build.gradleis problematic:android.libraryVariants.all { variant -> def name = variant.name.capitalize() task "jar${name}"(type: Jar, dependsOn: variant.javaCompileProvider.get()) { from variant.javaCompileProvider.get().destinationDir } }If this is replaced with the below mentioned code, the said problem is fixed.
android.libraryVariants.all { variant -> def name = variant.name.capitalize() task "jar${name}"(type: Jar, dependsOn: variant.javaCompile) { from variant.javaCompile.destinationDir } }
its work for me
Please check gradle wrapper version in android/gradle/wrapper/gradle-wrapper.properties, and make sure it's in sync with RN version you use. Gradle moving towards lazy configuration, and provider pattern, therefore introduced many *Provider classes lately.
Most helpful comment
The below mentioned code inside
build.gradleis problematic:If this is replaced with the below mentioned code, the said problem is fixed.