zhigang1992 / react-native-video-cache

Caching your video without headache
191 stars 59 forks source link

danikula/AndroidVideoCache is not available #60

Open a-mar-se opened 1 year ago

a-mar-se commented 1 year ago

react-native-video-cache needs the following package to work on android: Android: https://github.com/danikula/AndroidVideoCache

As it is not available, this package is also not working.

On npx react-native run-android I get this error:

error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup.
Error: Command failed: ./gradlew app:installDebug -PreactNativeDevServerPort=8081
Warning: unexpected element (uri:"", local:"base-extension"). Expected elements are <{}codename>,<{}layoutlib>,<{}api-level>

FAILURE: Build failed with an exception.

* What went wrong:
Could not determine the dependencies of task ':app:mergeDebugAssets'.
> Could not resolve all task dependencies for configuration ':app:debugRuntimeClasspath'.
   > Could not find com.danikula:videocache:2.7.1.
     [............]
     Required by:
         project :app > project :react-native-video-cache
a-mar-se commented 1 year ago

Any help on how to install https://github.com/danikula/AndroidVideoCache ?

kadiraydinli commented 1 year ago

I get the same error in React Native version 0.71.3. Is there any solution?

MartianH commented 1 year ago

This usually happens when you forget to add allprojects { repositiries { maven { url } } } as mentioned in the README to your build file.

Your android/build.gradle file should look like:

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    // [ omitted ], generated by react-native
}
allprojects {  // <- you should have added this
    repositories {
        maven {
            url "$rootDir/../node_modules/react-native-video-cache/android/libs" // <- build files for AndroidVideoCache
        }
    }
}

If you actually go to node_modules/react-native-video-cache/android/libs you will find the build files for the missing android build dependency.

om-swiggy commented 2 months ago

Hey I have already added this in the url still failing any fixes... cross verified as well the path I added seems perfect but still getting error

DmitriyArkhipov commented 2 months ago

Hi 👋 Path to the libs suggested above, is not correct ⬆️

Here solution I found by going through the directories

    allprojects {
        repositories {
            maven { url "$rootDir/../node_modules/react-native-video-cache-control/android/libs" }
        }
    }

This worked for me 🚀

mathieupost commented 2 months ago

Also still having this error, but it changed slightly after adding the maven repo.

Before:

* What went wrong:
Could not determine the dependencies of task ':react-native-video-cache:compileDebugJavaWithJavac'.
> Could not resolve all dependencies for configuration ':react-native-video-cache:debugCompileClasspath'.
   > Could not find com.danikula:videocache:2.7.1.
     Searched in the following locations:
       - https://oss.sonatype.org/content/repositories/snapshots/com/danikula/videocache/2.7.1/videocache-2.7.1.pom
       - https://repo.maven.apache.org/maven2/com/danikula/videocache/2.7.1/videocache-2.7.1.pom
       - file:[project root was here]/node_modules/jsc-android/dist/com/danikula/videocache/2.7.1/videocache-2.7.1.pom
       - https://dl.google.com/dl/android/maven2/com/danikula/videocache/2.7.1/videocache-2.7.1.pom
       - https://www.jitpack.io/com/danikula/videocache/2.7.1/videocache-2.7.1.pom
       - file:[project root was here]/node_modules/react-native/android/com/danikula/videocache/2.7.1/videocache-2.7.1.pom
     Required by:
         project :react-native-video-cache

After:

* What went wrong:
Could not determine the dependencies of task ':react-native-video-cache:compileDebugJavaWithJavac'.
> Could not resolve all dependencies for configuration ':react-native-video-cache:debugCompileClasspath'.
   > Could not find com.danikula:videocache:2.7.1.
     Required by:
         project :react-native-video-cache

So it seems that it found something at least as it doesn't list the searched locations anymore.

I'm using expo with the following listed in the plugins config:

      [
        "expo-build-properties",
        {
          "android": {
            "extraMavenRepos": [
              "../../node_modules/react-native-video-cache/android/libs"
            ]
          }
        }
      ],