《安卓环境配置》
1.安装安卓SDK,版本27+,build-tools 版本27+(必须)
2.在android/build.gradle中添加
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"
}
maven { url "https://jitpack.io" }
}
}
subprojects {
afterEvaluate {project ->
if (project.hasProperty("android")) {
android {
compileSdkVersion 27
buildToolsVersion '27.0.0'
}
}
}
}
3.在android/app/build.gradle中添加
defaultConfig {
...
vectorDrawables.useSupportLibrary = true
...
}
网友评论