添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接

Since this morning I’ve been changing small things in 2 separate individual projects, doing completely individual changes, and they started to fail with this error. It seems this dependency is no longer accessible in the server where gradle is trying to get it.

“A problem occurred configuring root project ‘gradleOut’.
18212: [Unity] > Could not resolve all files for configuration ‘:classpath’.
18213: [Unity] > Could not find intellij-core.jar (com.android.tools.external.com-intellij:intellij-core:26.0.1).
18214: [Unity] Searched in the following locations:
18215: [Unity] https://jcenter.bintray.com/com/android/tools/external/com-intellij/intellij-core/26.0.1/intellij-core-26.0.1.jar

  • Go into the Player Settings
  • Under Publishing Settings tick the box for Custom Gradle Template (Unity then creates a build.gradle template for you)
  • The template is in Assets > Plugins > Android > mainTemplate.gradle
  • Open that file in something like Notepad
  • Change ONLY THIS :
  • repositories { jcenter() google() }
    repositories { google() jcenter() }

  • Save the file then try the build again. Not a perfect solution but it should work until Unity/Android fixes the issue. I’m not sure whether this can become undone by upgrading Unity, but I do know that it has to be done per project.
  • Tried it and still have the same error.
    My mainTemplate.gradle buildscript looks like this:

    buildscript {
        repositories {
            google()
            jcenter()
        dependencies {
            classpath 'com.android.tools.build:gradle:3.0.1'
    

    I also verified if the dependency was in google repository:
    https://dl.google.com/dl/android/maven2/com/android/tools/external/com-intellij/intellij-core/26.0.1/intellij-core-26.0.1.jar

    and it is! But gradle is still trying to get it from jcenter.

    Will continue to investigate. First I will try to understand if Cloud Build is actually using my template

    It seems that every other library inside the plugins folder has it’s own gradle file which doesn’t follow the template (common_lib, native_plugins_lib, etc). So I tried to give each one it’s own build.gradle file with google as the first repository, but it still doesn’t work :S It also doesn’t build locally like in the Cloud Build.

    Observe same issue. The strange thing is that project builds fine on one machine, but not the other. All settings are identical for them.
    @gdespaux2010 your workaround did not work for me. After applying it I now get following 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```

    My company is having the same issue, started mid afternoon yesterday randomly. I’ll post back when I can test the suggestions in this thread.

    EDIT: gdespaux2010’s solution did not work for our project. We use firebase, so it’s likely overriding something. We’ll just have to manually build until this is resolved.

    The above approach from gdespaux2010 worked.

    Initially though, it was still throwing an error from GooglePlayGamesManifest.plugin. There ended up being another hidden build.gradle file inside the plugin (I’m on macOS). Right click the plugin and click on “Show Package Contents” and update any contained build.gradle file.

    On Windows, I am not sure how the plugin files are packaged. If it’s an archive, you might want to open it with 7zip or something similar to fix the gradle files.

    I think this is something that need to be fixed in a new unity version…
    Fore those interested :

  • Android forum thread
    - Issue tracker
  • Hi. The issue happens when the intellij-core-26.0.1.jar hasn’t been cached locally by gradle. It then tries to download the artifact from jcenter and fails - so it might not affect every machine.

    We’re working on this.

    NinjaCat:

    Hi. The issue happens when the intellij-core-26.0.1.jar hasn’t been cached locally by gradle. It then tries to download the artifact from jcenter and fails - so it might not affect every machine.

    We’re working on this.

    Where does gradle keep it’s jars locally? Can we just download the jar and put it in there while there’s no fix?