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

后端 未结 6 1997
走了就别回头了
走了就别回头了 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 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.

提交回复
热议问题