Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

React-native dependency error (com.atlassian.mobile.video okhttp-ws-compat)

I'm developing a React-native app and all of a sudden I started getting the following error:

  • What went wrong: A problem occurred configuring project ':app'. Could not resolve all dependencies for configuration ':app:_debugApk'. A problem occurred configuring project ':react-native-config'. Could not resolve all dependencies for configuration ':react-native-config:_debugPublishCopy'. Could not find com.atlassian.mobile.video:okhttp-ws-compat:3.7.0-atlassian1. Required by: cabm8:react-native-config:unspecified > com.facebook.react:react-native:0.42.3-atlassian-1

I got rid of the module react-native-config but still facing a similar error:

  • What went wrong: A problem occurred configuring project ':app'. Could not resolve all dependencies for configuration ':app:_debugApk'. A problem occurred configuring project ':react-native-maps'. Could not resolve all dependencies for configuration ':react-native-maps:_debugPublishCopy'. Could not find com.atlassian.mobile.video:okhttp-ws-compat:3.7.0-atlassian1. Required by: cabm8:react-native-maps:unspecified > com.facebook.react:react-native:0.42.3-atlassian-1

The issue seems to be related to com.atlassian.mobile.video:okhttp-ws-compat:3.7.0-atlassian1 somehow.

I've tried reinstalling node_modules, removed the folders android and ios then restored them using git. What else could I try?

like image 562
haxpanel Avatar asked May 27 '17 11:05

haxpanel


3 Answers

In your build.gradle (not in android/app/build.gradle) add this lines to force all dependency to react-native to specific version:

allprojects {

    configurations.all {
        resolutionStrategy {
            eachDependency { DependencyResolveDetails details ->
                if (details.requested.group == 'com.facebook.react' && details.requested.name == 'react-native') {
                    details.useVersion "0.39.0" // Your real React Native version here
                }
            }
        }
    }
...
}

This configuration worked for me. I hope this will help.

like image 162
imarem Avatar answered Oct 11 '22 21:10

imarem


com.atlassian.mobile.video is not avaible on maven right now. To run your project you need to update it

Update your react and react-native version to in your package.json file

"react": "16.0.0-alpha.3",
"react-native": "0.43.1",

Then remove node_modules and do a npm install again

Let me know if it works for you

like image 35
Ishaan Sharma Avatar answered Oct 11 '22 19:10

Ishaan Sharma


FYI this error is tracked here: https://github.com/facebook/react-native/issues/14225

I was able to fix by specifying the following versions of react and react-native:

  • "react": "15.4.1",
  • "react-native": "0.42.3"

See https://github.com/oblador/react-native-vector-icons/issues/480#issuecomment-304471394.

like image 2
s2t2 Avatar answered Oct 11 '22 20:10

s2t2