zhigang1992 / react-native-video-cache

Caching your video without headache
191 stars 59 forks source link

Build failing with React Native >= 0.72 and Gradle 8.0 | Could not set unknown property 'classifier' #72

Open bicanezin opened 1 year ago

bicanezin commented 1 year ago

Build failing with React Native >= 0.72 and Gradle 8.0

Error: What went wrong: A problem occurred configuring project ':react-native-video-cache'.

Could not set unknown property 'classifier' for task ':react-native-video-cache:androidJavadocJar' of type org.gradle.api.tasks.bundling.Jar.

After some search, maybe this issue can help to fix it: https://github.com/lottie-react-native/lottie-react-native/issues/1022

davidgvf commented 1 year ago

Me pasa lo mismo, alguna solución? @bicanezin

davidgvf commented 1 year ago

mi build gradle es el siguiente:

buildscript { ext { buildToolsVersion = "33.0.0" minSdkVersion = 21 compileSdkVersion = 33 targetSdkVersion = 33

    // We use NDK 23 which has both M1 support and is the side-by-side NDK version from AGP.
    ndkVersion = "23.1.7779620"
}
repositories {
    google()
    mavenCentral()
}
dependencies {
    classpath("com.android.tools.build:gradle")
    classpath("com.facebook.react:react-native-gradle-plugin")
    classpath 'com.google.gms:google-services:4.3.15'
    classpath 'com.google.firebase:firebase-crashlytics-gradle:2.9.5'
}

}

allprojects { repositories { mavenLocal() jcenter() maven { url "$rootDir/../node_modules/react-native/android" } maven { url 'https://maven.google.com' } maven { url "https://www.jitpack.io" } maven { url "$rootDir/../node_modules/react-native-video-cache/android/libs" } } }

aldiand commented 1 year ago

While waiting my pull request to be merged, this can be a temporary solution.

package.json "react-native-video-cache": "npm:@aldiand/react-native-video-cache"

or using patch-package

react-native-video-cache+2.7.3.patch

diff --git a/node_modules/react-native-video-cache/android/build.gradle b/node_modules/react-native-video-cache/android/build.gradle
index 8c6410f..ef57c95 100644
--- a/node_modules/react-native-video-cache/android/build.gradle
+++ b/node_modules/react-native-video-cache/android/build.gradle
@@ -118,7 +118,7 @@ afterEvaluate { project ->
     }

     task androidJavadocJar(type: Jar, dependsOn: androidJavadoc) {
-        classifier = 'javadoc'
+        archiveClassifier = 'javadoc'
         from androidJavadoc.destinationDir
     }