1

What went wrong: Could not compile build file '/Users/nathanael/Code/highst/mobile/android/build.gradle'.

startup failed: build file '/../../android/build.gradle': 6: unexpected token: << @ line 6, column 1.

 <<<<<<< ours
 ^
 1 error

Sorry in advance, I'm a Gradle noob. I'm having this issue whenever I run 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
Community
  • 1
  • 1
Nathanael
  • 954
  • 3
  • 19
  • 39

2 Answers2

4

it is saying that <<<<< is not recognizable syntax by gradle. your project has git merge conflict you should either accept theirs or ours and delete <<<<< parts

Amir-Mousavi
  • 4,273
  • 12
  • 70
  • 123
0

Either you should fetch fresh code from repo or delete "theirs" section and keep "ours" section as a suggestion.

However seeing both the sections, from my experience: ext variables and class dependencies from theirs should move to project level build.gradle file.

Clearly, "ours" section is from '<<<<<' till '=====' and 'theirs' section is from '=====' till '>>>>>'.

Please see:

Basic Git Commands

Learn GIT with BitBucket

How to resolve merge conflicts in Git

Resolving a merge conflict using the command line

Abhinav Saxena
  • 1,990
  • 2
  • 24
  • 55