Error ionic building

106 Views Asked by At

cli(command line) says this :

Failed to apply plugin [id 'com.android.library'] Could not create plugin of type 'LibraryPlugin'. `> cordova build android --release Android Studio project detected

  • What went wrong: A problem occurred evaluating project ':CordovaLib'.

    Plugin with id 'android.library' not found.

  • Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

  • Get more help at https://help.gradle.org

  • What went wrong: A problem occurred evaluating project ':CordovaLib'.

    Plugin with id 'android.library' not found.

1

There are 1 best solutions below

0
Al Francis On

Heres some good idea how to fixed the error when building the ionic app in android

  1. Be sure that the Android Studio path is working.
  2. In building the app lets follow the documentation and use the following:

    ionic cordova run android --prod (if works success proceed to next)
    ionic cordova run android --prod --release

  3. Base on your error you can fix it by instructing Gradle to download Android plugin from Maven Central repository.

You do it by pasting the following code at the beginning of the Gradle build file:

buildscript {
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:1.1.1'
    }
}
  1. Be sure that you install gradle https://gradle.org/install/