React Native android 错误 com.atlassian.mobile.video:okhttp-ws-compat:3.7.0-atlassian1.

来源:互联网 发布:人工智能 时时彩 编辑:程序博客网 时间:2024/05/21 10:30

React Native 版本:0.38.0

错误信息:

* 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-device-info'.      > Could not resolve all dependencies for configuration ':react-native-device-info:_debugPublishCopy'.         > Could not find com.atlassian.mobile.video:okhttp-ws-compat:3.7.0-atlassian1.           Required by:               AiragAppFarmer:react-native-device-info:unspecified > com.facebook.react:react-native:0.42.3-atlassian-1* Try:Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

解决:

在 android/build.gradle 下 的 allprojects 添加

configurations.all {        resolutionStrategy {            eachDependency { DependencyResolveDetails details ->                if (details.requested.group == 'com.facebook.react' && details.requested.name == 'react-native') {                    details.useVersion "0.38.0" //你当前react native 版本(0.38.0测试可行)                }            }        }    }

如:

buildscript {    repositories {        jcenter()    }    dependencies {        classpath 'com.android.tools.build:gradle:2.2.2'     }}allprojects {    configurations.all {        resolutionStrategy {            eachDependency { DependencyResolveDetails details ->                if (details.requested.group == 'com.facebook.react' && details.requested.name == 'react-native') {                    details.useVersion "0.38.0" //你当前react native 版本(0.38.0测试可行)                }            }        }    }    repositories {        mavenLocal()        jcenter()        maven {            // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm            url "$rootDir/../node_modules/react-native/android"        }    }}

参考:

https://github.com/facebook/react-native/issues/14223#issuecomment-304509104

阅读全文
0 0
原创粉丝点击