2

I am trying to Sync a React-Native project in Android studio, whenever I try to sync it, it throws an error as below,

Could not find intellij-core.jar (com.android.tools.external.com-intellij:intellij-core:26.0.1).
Searched in the following locations:
    https://jcenter.bintray.com/com/android/tools/external/com-intellij/intellij-core/26.0.1/intellij-core-26.0.1.jaa r

I tried lot of methods mentioned earlier for the same issue for Cordova and other project But I can't see it work for my React-Native.

My build.gradle file is looks like following

buildscript {
    ext {
        buildToolsVersion = "27.0.3"
        minSdkVersion = 16
        compileSdkVersion = 27
        targetSdkVersion = 26
        supportLibVersion = "27.1.1"
    }
    repositories {
        jcenter()
        google()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.1.4'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

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"
        }
        google()
    }
}

Duplicated Questions answers are looks like for Cordova, but My question is about to React-Native, and I tried all the answers there none of they are not working

Jothi Kannan
  • 3,320
  • 6
  • 40
  • 77

2 Answers2

0

It appears that jcenter was broken yesterday. In your build.gradle file, move jcenter() below google() (both places).

For more information: https://github.com/facebook/react-native/issues/21907#issuecomment-432319128

0

Make this particular change under android/CordovaLib/build.gradle

repositories {maven {
url "https://maven.google.com"} jcenter()}

Note: add jcenter() after maven and use cordova platform add android@7.1.1 to add platfrom