Android Studio - Could not find intellij-core.jar

后端 未结 12 918
小蘑菇
小蘑菇 2020-12-03 00:40

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 loc

相关标签:
12条回答
  • 2020-12-03 01:05

    https://github.com/flutter/flutter/pull/23397

    In short, following Mahi-K from the above link, you have to edit $flutterRoot/packages/flutter_tools/gradle/flutter.gradle

    buildscript {
        repositories {
            google()
            jcenter()
            maven {
                url 'https://dl.google.com/dl/android/maven2'
            }
        }
        dependencies {
            classpath 'com.android.tools.build:gradle:3.2.1'
        }
    }
    

    In the gradle wrapper properties gradle/wrapper/gradle-wrapper.properties you may also have to change it to 4.6 or above

    distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip
    
    0 讨论(0)
  • 2020-12-03 01:05

    Use com.android.tools.build:gradle:3.2.1

    You'll also have to update your '/gradle/wrapper/gradle-wrapper.properties'

    distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip
    
    0 讨论(0)
  • 2020-12-03 01:08

    For me, problem solved change build gradle files to get Google Server.
    /platforms/android/build.gradle

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

    /platforms/android/app/build.gradle

    allprojects {
        repositories {
            google()
            mavenCentral();
            jcenter()
        }
    
    0 讨论(0)
  • 2020-12-03 01:12

    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
    0 讨论(0)
  • 2020-12-03 01:12

    hey guys I came across the same problem, which is actually a conflict between the ionic, gradle and gradle plugin. It turns out that in the new version of the gradle plugin the build is now dependent on the google repository. To get around the problem you need to change 2 files:

    Make sure they are as described below!

    1 ° - “platforms / android / CordovaLib / build.gradle”

    buildscript {
     repositories {
      google()
      maven {
       url “https://maven.google.com”
      }
      jcenter ()
    }
    

    2 ° - “platforms / android / build.gradle”

    buildscript {
     repositories {
      google()
      maven {
       url “https://maven.google.com”
      }
      jcenter ()
     }
    

    and

     allprojects {
      repositories {
      google()
      maven {
       url “https://maven.google.com”
      }
      jcenter ()
     }
    

    This is it. Hope this helps!

    0 讨论(0)
  • 2020-12-03 01:13

    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()
    }
    
    0 讨论(0)
提交回复
热议问题