0

I have an issue with an npm package react-native-video where it says 'no variant found for :react-native-video.' I've tried uninstalling and reinstalling, deleting node_modules and yarn.lock and clearing gradle, invalidating caches and restarting Android Studio, and any permutation of the above things.

The app builds and syncs perfectly find without react-native-video, but any time I reinstall it and add the files back in the app.gradle and other files (per the installation instructions) it gives me the same error. Has anyone had this issue before, and how do you fix it? I'm assuming it's an Android Studio/Gradle issue, but I'm at a complete loss as to how to fix it.

Joel Hager
  • 2,990
  • 3
  • 15
  • 44

1 Answers1

0

Please check your version of React Native and react-native-video. In my case, I use React Native 0.64.1 and react-native-video 5.1.1, and it works well.

Other solution

Assuming you are on a later version of React Native, In android/build.gradle you need to add jcenter(), in this case best to be explicit and only include what is necessary:

...
allprojects {
    repositories {
       ... other repositories
        jcenter() {
            content {
                includeModule("com.yqritc", "android-scalablevideoview")
            }
        }
    }
}
Joe199382
  • 199
  • 1
  • 12
  • Here's the thing though: it was working before the gradle clean. I didn't change rn or rn video. That's the part that has me scratching my head. – Joel Hager Aug 19 '22 at 16:19