Ionic 3 prod release build issue with intellij-cor

2019-03-08 08:18发布

I am creating release APK using the following versions : node - 8.12.0 gradle - 4.10.2 ionic CLI - 4.0.5 Cordova - 8.0.0

When I run the

ionic cordova build android --prod --release

I am getting the following error.

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':CordovaLib'.
> Could not resolve all files for configuration ':CordovaLib:classpath'.
   > 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

When I place the "intellij-core-26.0.1" URL in browser, its showing status 404.

Anyone, Please suggest

8条回答
Evening l夕情丶
2楼-- · 2019-03-08 08:35

I fixed it by editing \platforms\android\build.gradle file (line 39) to this: // Allow plugins to declare Maven dependencies via build-extras.gradle.

 allprojects {
        repositories {
            mavenCentral()
            maven {
                url "https://maven.google.com"
            }
            jcenter()
        }
    }
查看更多
男人必须洒脱
3楼-- · 2019-03-08 08:35

If anyone is having issues in CI(Jenkins/Travis) instead of making manual changes every time build hook can be handy

查看更多
我想做一个坏孩纸
4楼-- · 2019-03-08 08:44

Changing the buildscript section in platforms\android\CordovaLib\build.gradle from

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

to

repositories {
    google()
    jcenter()
}

fixed the issue for me. CLI and AS are building fine now.

查看更多
Fickle 薄情
5楼-- · 2019-03-08 08:47

Try

ionic cordova platform remove android
ionic cordova platform add android@latest

This was for me what ended up working. Nothing else was doing the trick

ps. it installed android 7.1.4

查看更多
姐就是有狂的资本
6楼-- · 2019-03-08 08:55

Following on from Ruben Sala's suggestion, that didn't work for me. However, if you edit platforms/android/CordovaLib/build.gradle, and apply the same fix Ruben suggests, it does.

I.e. change:

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

To:

repositories {
    maven {
        url "https://maven.google.com"
    }
    jcenter()
}
查看更多
等我变得足够好
7楼-- · 2019-03-08 08:58

ionic cordova platform remove android

ionic cordova platform add android@7.0.0

查看更多
登录 后发表回答