android - 错误运行 react-native run-android: Unexpected Token in build.gradle
问题描述
出了什么问题:无法编译构建文件'/Users/nathanael/Code/highst/mobile/android/build.gradle'。
启动失败:构建文件'/../../android/build.gradle':6:意外令牌:<<@第6行,第1列。
<<<<<<< ours ^ 1 error
提前抱歉,我是一个 Gradle 菜鸟。每当我运行 react-native run-android 时都会遇到这个问题
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
<<<<<<< ours
maven { url 'https://maven.fabric.io/public' }
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.3'
classpath 'com.google.gms:google-services:3.1.2'
classpath 'io.fabric.tools:gradle:1.+'
=======
maven {
url 'https://maven.google.com/'
name 'Google'
}
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
>>>>>>> theirs
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
mavenLocal()
mavenCentral()
jcenter()
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url "$rootDir/../node_modules/react-native/android"
}
maven {
<<<<<<< ours
url 'https://maven.google.com'
}
}
}
=======
url 'https://maven.google.com/'
name 'Google'
}
}
}
ext {
buildToolsVersion = "26.0.3"
minSdkVersion = 16
compileSdkVersion = 26
targetSdkVersion = 26
supportLibVersion = "26.1.0"
}
>>>>>>> theirs
解决方案
据说 <<<<< 不是 gradle 可识别的语法。您的项目有 git 合并冲突,您应该接受他们的或我们的并删除<<<<<
部分
推荐阅读
- javascript - 如何仅使用 CSS 选择嵌套在“P”中的“br”之后的所有段落?
- c - 为什么 typeof 函数在 C 中不起作用
- cplex - 如何在 cplex 上的矩阵之间制作产品
- html - 使用 XPath 选择可选节点
- php - 在 Laravel 中按用户角色生成路由有什么问题?
- vue.js - vue-draggable item 到底移动到了哪里?
- google-apps-script - 将 Google Apps 脚本 URL 正确嵌入 Google 站点
- javascript - 如何在没有 React 的情况下在页面中插入组件?
- firebase - 如何从颤振中的for循环返回流列表
- python - 是否可以在 python3 的 argparse 中添加“-”标志?