Help with BUILD FAILED Android Ionic


#9

What does that do exactly?


#10

I don’t know why, but i think the problem is relational with API 26 Android and cordova.

https://developer.android.com/studio/build/multidex.html


#11

I have this same problem.

adding multiDexEnabled true didn’t help.

I am not comfortable editing the build files if this is something Ionic can do. Because I never know if which ones get generated on the fly.


Build of Android APK failed with Push Notification and Badge in project
#12

thanks happy new year ,Your solution helped me very much

defaultConfig {
minSdkVersion 21
targetSdkVersion 26
multiDexEnabled true
}


#13

thank you @doriantorres84. Your solution works on cordova-android@6.3.0 and cordova-android@6.4.0. So, here make it more detail.

  • open platform/android/build.gradle
  • find android {
  • add this inside
    defaultConfig {
     minSdkVersion 21
     targetSdkVersion 26
     multiDexEnabled true
    }
  • it should looks like this
android {
    defaultConfig {
     minSdkVersion 21
     targetSdkVersion 26
     multiDexEnabled true
    }

    //the rest...
}

#14

Thanks so much for this!


#15

Please help me this is not working for me :confused: Now im getting this.


#16

Thanks! it works for me


#17

Try cordova clean. Saved my day.


#18

Thank you for your reply! “cordova clean” saved my day too!


#20

Thank you @codiqa100051260
Nice Find


#21

Funciono!!! gracias It works thks “cordova clean”


#22

I tried with “cordova clean”, but I did not work.

Somebody could help me with another solution.

Thanks,

MY IONIC INFO

cli packages: (/Users/wilfredonoyola/workspace/statusfy/sf-ionic-1/node_modules)

    @ionic/cli-utils  : 1.19.2
    ionic (Ionic CLI) : 3.20.0

global packages:

    cordova (Cordova CLI) : 8.0.0 

local packages:

    @ionic/app-scripts : 3.1.10
    Cordova Platforms  : android 7.0.0
    Ionic Framework    : ionic-angular 3.9.2

System:

    Android SDK Tools : 26.1.1
    ios-deploy        : 1.9.2 
    Node              : v6.11.3
    npm               : 3.10.10 
    OS                : macOS High Sierra
    Xcode             : Xcode 9.4.1 Build version 9F2000 

Environment Variables:

    ANDROID_HOME : /Users/wilfredonoyola/Library/Android/sdk/

Misc:

    backend : pro


#23

cordova clean for the win, AFTER adding the multiDexEnabled true to the platform/android/build.gradle file.


Unable to build Ionic app on android
#24

Thanks this worked for me too.


#25

npm i cordova-plugin-multidex Helped for me


#26

Thanks @codiqa100051260, You helped me. I was getting this error after removing a cordova plugin.


#27

Thanks for this. It was all I needed do to. I didn’t have to update the build.gradle file.

As with @virendrashakya, it was after I had removed, then updated a cordova plugin. It was related to the ionic webview vulnerability recently reported. Although Android isn’t affected, I thought I’d better just rebuild my Android version anyway.


#28

thank you .It worked for me too


#29

this worked for me: cordova plugin add --save https://github.com/jwall149/cordova-multidex

as found at https://stackoverflow.com/questions/34259679/enable-multidex-for-android-in-ionic-framework