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

后端 未结 6 1963
走了就别回头了
走了就别回头了 2020-12-28 15:07

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

  • What went wrong: A problem occurred configurin
相关标签:
6条回答
  • 2020-12-28 15:41

    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.

    0 讨论(0)
  • 2020-12-28 15:43

    Same issue, looked in the source code but couldn't find a reference to "atlassian" anywhere so I turned off wifi (to see if any calls are being made to get an external resource) and got the following

    Could not resolve all dependencies for configuration ':react-native-google-analytics-bridge:_debugPublishCopy'. Could not resolve com.atlassian.mobile.video:okhttp-ws-compat:3.7.0-atlassian1. Required by: OneUps:react-native-google-analytics-bridge:unspecified > com.facebook.react:react-native:0.42.3-atlassian-1 Could not resolve com.atlassian.mobile.video:okhttp-ws-compat:3.7.0-atlassian1. Could not get resource 'https://jcenter.bintray.com/com/atlassian/mobile/video/okhttp-ws-compat/3.7.0-atlassian1/okhttp-ws-compat-3.7.0-atlassian1.pom'.

    If you follow that link it looks like that package has been removed which I guess is causing the issue?

    0 讨论(0)
  • 2020-12-28 15:51

    in your root build.Gradle force all dependencies to a specific version.

    allprojects {
     configurations.all {
       resolutionStrategy {
         eachDependency { DependencyResolveDetails details ->
           if (details.requested.group == 'com.facebook.react' && details.requested.name == 'react-native') {
             details.useVersion "0.40.0" // Your React Native version here
           }
         }
       }
     }
      }
    
    0 讨论(0)
  • 2020-12-28 15:53

    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

    0 讨论(0)
  • 2020-12-28 15:53

    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.

    0 讨论(0)
  • 2020-12-28 16:07

    Add this to your build.gradle(not in app/build.gradle) file in the android folder. you don't want to add react-native version manually.

    allprojects {
        configurations.all {
            resolutionStrategy {
                eachDependency { DependencyResolveDetails details ->
                    if (details.requested.group == 'com.facebook.react' && details.requested.name == 'react-native') {
                        def file = new File("$rootDir/../node_modules/react-native/package.json")
                        def version = new groovy.json.JsonSlurper().parseText(file.text).version
                        details.useVersion version
                    }
                }
            }
        }
    }
    

    I think this will help.

    0 讨论(0)
提交回复
热议问题