react-native Could not find com.
2017-04-25 本文已影响20人
许晓北
在build.gradle (不是 APP bulid.gradle)里面配置 这貌似是官方出现的的问题 据说在0.42.3版本进行了修复
allprojects {
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"
}
//修复了 > Could not find com.atlassian.mobile.video:okhttp-ws-compat:3.7.0-atlassian1.错误
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
}
}
}
}
}
}