Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Studio - Could not find intellij-core.jar

I am using android studio 3.1.4.

Error: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.jar

like image 238
Rohan Patel Avatar asked Oct 23 '18 10:10

Rohan Patel


4 Answers

I was able to fix the issue by changing the order of the repositories here:

/platforms/android/CordovaLib/build.gradle

from this:

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

to this:

repositories {     maven {         url "https://maven.google.com"     }     jcenter() } 
like image 175
devsnd Avatar answered Sep 27 '22 18:09

devsnd


If you're using classpath 'com.android.tools.build:gradle:3.0.1' or higher in your project/build.gradle, the solution is:

Add "google()" to your project/build.gradle file in 2 places:

 // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript {     repositories {         google()         jcenter()         maven {             url 'https://maven.google.com/'             name 'Google'         }     }     dependencies {         ...     } }  allprojects {     repositories {         google()         jcenter()         maven {             url 'https://maven.google.com/'             name 'Google'         }     } } 

Then you will see in the logs that intellij-core.jar is downloaded from different URLs:

  • https://dl.google.com/dl/android/maven2/com/android/tools/external/com-intellij/intellij-core/26.0.1/intellij-core-26.0.1.pom
  • https://dl.google.com/dl/android/maven2/com/android/tools/external/com-intellij/intellij-core/26.0.1/intellij-core-26.0.1.jar
like image 36
Mr-IDE Avatar answered Sep 27 '22 18:09

Mr-IDE


I solve my problem; change the platform/android/CordovaLib/build.gradle file. I put the maven repo ahead the jcenter:

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

}

And I use cordova-android 7.1.1.

like image 23
Costas Bakoulias Avatar answered Sep 27 '22 19:09

Costas Bakoulias


To resolve this issue either put

<preference name="android-targetSdkVersion" value="27" />

into your config.xml.

Or even better, upgrade android-cordova to the lates version (7.1.2):

cordova platform add [email protected]

android-cordova 7.1.2 includes fix CB-14127: "Move google maven repo ahead of jcenter". (https://issues.apache.org/jira/browse/CB-14127)

like image 41
Lukas Avatar answered Sep 27 '22 18:09

Lukas