# Issues with CORDOVA/ANDROID builds

**URL:** <https://forum.ionicframework.com/t/issues-with-cordova-android-builds/244013>\
**Category:** Appflow\
**Created:** [September 2, 2024, 8:52pm UTC](https://forum.ionicframework.com/t/issues-with-cordova-android-builds/244013 "2024-09-02T20:52:33Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![diogenesjup](https://avatars.discourse-cdn.com/v4/letter/d/8c91f0/32.png) [@diogenesjup](https://forum.ionicframework.com/u/diogenesjup)\
**Post date:** [September 2, 2024, 8:52pm UTC](https://forum.ionicframework.com/t/issues-with-cordova-android-builds/244013/1 "2024-09-02T20:52:33Z")

</div>

I use AppFlow to compile HTML5, CSS, and JS files into Android and iOS apps. I do this entirely through the web version, via commit/push and then compiling via the web. Everything was working fine until a few weeks ago when the Android builds stopped compiling. After talking to support, they told me the problem was this:

_"Paul LaCaille (Ionic Support)_

_Thanks for contacting Ionic support!_

_For some general guidance, I have seen a number of users running into issues with Android builds as a result of JCenter’s permanent sunset on 8/15/2024: [JCenter Sunset on August 15th, 2024 | JFrog](https://jfrog.com/blog/jcenter-sunset/). With a Capacitor project, you will want to update your build.gradle file to remove jcenter() and replace it with mavenCentral(). You will also need to remove and find alternatives for any plugins that require a dependency only available in JCenter. With a Cordova project, it looks like Cordova Android 10.0.0 drops JCenter, so you will likely need to update to this version, or a more recent version. You will also need to remove and find alternatives for any plugins that require a dependency only available in JCenter."_

However, even after removing any plugin accessed via npm, the problem persists, and it’s not possible to compile using Cordova 13—only version 12 is available. iOS builds work fine.

Is anyone else having this kind of difficulty with Cordova?

---

<div class="post-metadata">

**Author:** ![julio-ionic](https://avatars.discourse-cdn.com/v4/letter/j/58956e/32.png) [@julio-ionic](https://forum.ionicframework.com/u/julio-ionic)\
**Post date:** [September 3, 2024, 4:58pm UTC](https://forum.ionicframework.com/t/issues-with-cordova-android-builds/244013/2 "2024-09-03T16:58:00Z")

</div>

What’s the build error?

The support message seems to indicate that the problem is the jcenter sunset, but cordova-android 13 doesn’t use jcenter.

---

<div class="post-metadata">

**Author:** ![diogenesjup](https://avatars.discourse-cdn.com/v4/letter/d/8c91f0/32.png) [@diogenesjup](https://forum.ionicframework.com/u/diogenesjup)\
**Post date:** [September 3, 2024, 7:41pm UTC](https://forum.ionicframework.com/t/issues-with-cordova-android-builds/244013/3 "2024-09-03T19:41:37Z")

</div>

cordova-android 13 is not availabe in Ionic AppFlow.  
I saw this on some forums, but even specifying version 13 in package.json, it is not available.

About the compilation error, every time I compile, even using the same code, it brings different errors.

Here are today’s bugs

> <https://gist.github.com/diogenesjup/edd7ba3441e86cff1cc849749d120abb>

This is from 3 days ago

> <https://gist.github.com/diogenesjup/b0cde5d3bb6b94ee01ac42797cee7745>

With a lot of effort, I managed to make a compilable version, but the generated app does not have permission to access the internet (even with directives for this) [GitHub - diogenesjup/pesuas at 2cb2952785ab1ebd9201a304ce855839b7f85bb1](https://github.com/diogenesjup/pesuas/tree/2cb2952785ab1ebd9201a304ce855839b7f85bb1)

---

<div class="post-metadata">

**Author:** ![julio-ionic](https://avatars.discourse-cdn.com/v4/letter/j/58956e/32.png) [@julio-ionic](https://forum.ionicframework.com/u/julio-ionic)\
**Post date:** [September 4, 2024, 8:51am UTC](https://forum.ionicframework.com/t/issues-with-cordova-android-builds/244013/4 "2024-09-04T08:51:43Z")

</div>

Those logs show that the app is trying to download `cordova-android@^8.0.0`, not 13.

You can use any `cordova-android` version in Appflow, there is no such thing as an specific version not “being available”, Appflow will download and install whatever you “told” it to download. But depending on what you download it will fail to build, in example cordova-android 13 requires SDK 34 to be available, that’s only available on latest runners, Linux - 2023.10 and Linux - 2024.06.

You have to figure out why the app is downloading `cordova-android@^8.0.0` instead of 13, check the `config.xml` in case the platform is there too, Cordova might give preference to dependencies in the `config.xml` versus dependencies in `package.json`.

---

<div class="post-metadata">

**Author:** ![diogenesjup](https://avatars.discourse-cdn.com/v4/letter/d/8c91f0/32.png) [@diogenesjup](https://forum.ionicframework.com/u/diogenesjup)\
**Post date:** [September 4, 2024, 4:52pm UTC](https://forum.ionicframework.com/t/issues-with-cordova-android-builds/244013/5 "2024-09-04T16:52:04Z")

</div>

I don’t think that’s it. In the appFlow itself, when I look at the “Build Stack” spec, it clearly says to use “Cordova CLI  
12.0.0”

Even if I add , the compilation error persists. And as I mentioned, until mid-August it compiled without problems. Just for the record, this is my config.xml

\<?xml version='1.0' encoding='utf-8'?\> Pesuas Prontuário eletronico do Sistema Único de Assistência Social de Benjamin Constant-AM Fabrica de Plugins e Diogenes Junior 

```
<preference name="android-build-tool" value="gradle" />
<preference name="orientation" value="portrait" />
<preference name="target-device" value="handset" />
<preference name="fullscreen" value="false" />
<preference name="webviewbounce" value="true" />
<preference name="prerendered-icon" value="true" />
<preference name="stay-in-webview" value="false" />
<preference name="ios-statusbarstyle" value="black-opaque" />
<preference name="detect-data-types" value="true" />
<preference name="exit-on-suspend" value="false" />
<preference name="disable-cursor" value="false" />
<preference name="android-installLocation" value="auto" />
<preference name="StatusBarBackgroundColor" value="#00940a" />

<preference name="AutoHideSplashScreen" value="true" />
<preference name="SplashScreen" value="none" />
<preference name="ShowSplashScreen" value="false" />

<preference name="android-minSdkVersion" value="29" />
<preference name="android-targetSdkVersion" value="34" />
<preference name="android-compileSdkVersion" value="34" />

<preference name="AndroidXEnabled" value="true" />

<edit-config file="AndroidManifest.xml" mode="merge" target="/manifest/application/activity[@android:name='MainActivity']">
    <activity android:exported="true" />
</edit-config>

<plugin name="cordova-plugin-androidx" />
<plugin name="cordova-plugin-androidx-adapter" />
<!--<plugin name="cordova-plugin-local-notification" />-->
<plugin name="cordova-plugin-android-permissions" />
<plugin name="cordova-plugin-inappbrowser" />
<plugin name="cordova-plugin-statusbar" />
<plugin name="cordova-plugin-ionic-webview" />

<preference name="WKWebViewOnly" value="true" />
<feature name="CDVWKWebViewEngine">
    <param name="ios-package" value="CDVWKWebViewEngine" />
</feature>
<preference name="CordovaWebViewEngine" value="CDVWKWebViewEngine" />
<preference name="Scheme" value="https" />
<preference name="ScrollEnabled" value="true" />

<platform name="android">

    <engine name="android" spec="^12.0.0" />
    <preference name="android-minSdkVersion" value="29" />
    <preference name="android-targetSdkVersion" value="34" />
    <preference name="android-compileSdkVersion" value="34" />

    <icon density="ldpi" height="36" src="www/assets/images/icones/36.png" width="36" />
    <icon density="ldpi" height="40" src="www/assets/images/icones/40.png" width="40" />
    <icon density="mdpi" height="57" src="www/assets/images/icones/57.png" width="57" />
    <icon density="mdpi" height="64" src="www/assets/images/icones/64.png" width="64" />
    <icon density="hdpi" height="72" src="www/assets/images/icones/72.png" width="72" />
    <icon density="xhdpi" height="114" src="www/assets/images/icones/114.png" width="114" />
    <icon density="xhdpi" height="120" src="www/assets/images/icones/120.png" width="120" />
    <icon density="xxhdpi" height="144" src="www/assets/images/icones/144.png" width="144" />
    <icon density="xxhdpi" height="152" src="www/assets/images/icones/152.png" width="152" />
    <icon density="xxhdpi" height="173" src="www/assets/images/icones/173.png" width="173" />
    <icon density="xhdpi" height="96" src="www/assets/images/icones/96.png" width="96" />
    <icon density="xxhdpi" height="180" src="www/assets/images/icones/180.png" width="180" />
    <icon density="xxxhdpi" height="192" src="www/assets/images/icones/192.png" width="192" />
    <icon density="xxxhdpi" height="225" src="www/assets/images/icones/225.png" width="225" />
    <icon density="xxxhdpi" height="320" src="www/assets/images/icones/320.png" width="320" />
    <icon density="xxxhdpi" height="512" src="www/assets/images/icones/512.png" width="512" />
    <icon density="xxxhdpi" height="768" src="www/assets/images/icones/768.png" width="768" />
    <icon density="xxxhdpi" height="960" src="www/assets/images/icones/960.png" width="960" />
    <icon density="xxxhdpi" height="1024" src="www/assets/images/icones/1024x1024.png" width="1024" />

    <plugin name="cordova-plugin-whitelist" version="1.3.4" />
    <access origin="*" />
    <allow-navigation href="*" />
    <allow-intent href="*" />
    <allow-intent href="http://*/*" />
    <allow-intent href="https://*/*" />
    <allow-intent href="tel:*" />
    <allow-intent href="sms:*" />
    <allow-intent href="mailto:*" />
    <allow-intent href="geo:*" />

</platform>
<platform name="ios">
    <icon density="ldpi" height="36" src="www/assets/images/icones/36.png" width="36" />
    <icon density="ldpi" height="40" src="www/assets/images/icones/40.png" width="40" />
    <icon density="mdpi" height="57" src="www/assets/images/icones/57.png" width="57" />
    <icon density="mdpi" height="64" src="www/assets/images/icones/64.png" width="64" />
    <icon density="hdpi" height="72" src="www/assets/images/icones/72.png" width="72" />
    <icon density="xhdpi" height="114" src="www/assets/images/icones/114.png" width="114" />
    <icon density="xhdpi" height="120" src="www/assets/images/icones/120.png" width="120" />
    <icon density="xxhdpi" height="144" src="www/assets/images/icones/144.png" width="144" />
    <icon density="xxhdpi" height="152" src="www/assets/images/icones/152.png" width="152" />
    <icon density="xxhdpi" height="173" src="www/assets/images/icones/173.png" width="173" />
    <icon density="xhdpi" height="96" src="www/assets/images/icones/96.png" width="96" />
    <icon density="xxhdpi" height="180" src="www/assets/images/icones/180.png" width="180" />
    <icon density="xxxhdpi" height="192" src="www/assets/images/icones/192.png" width="192" />
    <icon density="xxxhdpi" height="225" src="www/assets/images/icones/225.png" width="225" />
    <icon density="xxxhdpi" height="320" src="www/assets/images/icones/320.png" width="320" />
    <icon density="xxxhdpi" height="512" src="www/assets/images/icones/512.png" width="512" />
    <icon density="xxxhdpi" height="768" src="www/assets/images/icones/768.png" width="768" />
    <icon density="xxxhdpi" height="960" src="www/assets/images/icones/960.png" width="960" />
    <icon density="xxxhdpi" height="1024" src="www/assets/images/icones/1024x1024.png" width="1024" />
    <icon height="20" src="www/assets/images/icones/20.png" width="20" />
    <icon height="60" src="www/assets/images/icones/60.png" width="60" />
    <icon height="29" src="www/assets/images/icones/29.png" width="29" />
    <icon height="58" src="www/assets/images/icones/58.png" width="58" />
    <icon height="87" src="www/assets/images/icones/87.png" width="87" />
    <icon height="76" src="www/assets/images/icones/76.png" width="76" />
    <icon height="152" src="www/assets/images/icones/152.png" width="152" />
    <icon height="167" src="www/assets/images/icones/167.png" width="167" />
</platform>

```

---

<div class="post-metadata">

**Author:** ![julio-ionic](https://avatars.discourse-cdn.com/v4/letter/j/58956e/32.png) [@julio-ionic](https://forum.ionicframework.com/u/julio-ionic)\
**Post date:** [September 4, 2024, 5:30pm UTC](https://forum.ionicframework.com/t/issues-with-cordova-android-builds/244013/6 "2024-09-04T17:30:17Z")

</div>

Cordova CLI is one thing, cordova-android another.

Latest Cordova CLI (`cordova` package on npm) is 12, latest cordova-android is 13.

Appflow will use Cordova CLI 12, but for cordova-android is up to you which version to use.

The `engine` tag (`<engine name="android" spec="^12.0.0" />`) doesn’t work inside `platform` tag, move it outside.

---

<div class="post-metadata">

**Author:** ![diogenesjup](https://avatars.discourse-cdn.com/v4/letter/d/8c91f0/32.png) [@diogenesjup](https://forum.ionicframework.com/u/diogenesjup)\
**Post date:** [September 4, 2024, 7:10pm UTC](https://forum.ionicframework.com/t/issues-with-cordova-android-builds/244013/7 "2024-09-04T19:10:24Z")

</div>

It was just a test, even changing the engine location, or simply not adding it, the compilation does not complete. Even if I remove all plugins, and literally put a completely blank index, the compilation does not work.

---

<div class="post-metadata">

**Author:** ![julio-ionic](https://avatars.discourse-cdn.com/v4/letter/j/58956e/32.png) [@julio-ionic](https://forum.ionicframework.com/u/julio-ionic)\
**Post date:** [September 5, 2024, 8:42am UTC](https://forum.ionicframework.com/t/issues-with-cordova-android-builds/244013/8 "2024-09-05T08:42:12Z")

</div>

But did the error change? is it still trying to use cordova-android 8 like in the 2 error logs you shared?

---

<div class="post-metadata">

**Author:** ![diogenesjup](https://avatars.discourse-cdn.com/v4/letter/d/8c91f0/32.png) [@diogenesjup](https://forum.ionicframework.com/u/diogenesjup)\
**Post date:** [September 5, 2024, 2:37pm UTC](https://forum.ionicframework.com/t/issues-with-cordova-android-builds/244013/9 "2024-09-05T14:37:03Z")

</div>

Still with the same error.

---

<div class="post-metadata">

**Author:** ![julio-ionic](https://avatars.discourse-cdn.com/v4/letter/j/58956e/32.png) [@julio-ionic](https://forum.ionicframework.com/u/julio-ionic)\
**Post date:** [September 5, 2024, 2:48pm UTC](https://forum.ionicframework.com/t/issues-with-cordova-android-builds/244013/10 "2024-09-05T14:48:14Z")

</div>

I forked your repository and after removing the gradle plugins and a few other things was able to build fine on appflow, I sent a PR to your repository with the changes.

---

<div class="post-metadata">

**Author:** ![diogenesjup](https://avatars.discourse-cdn.com/v4/letter/d/8c91f0/32.png) [@diogenesjup](https://forum.ionicframework.com/u/diogenesjup)\
**Post date:** [September 6, 2024, 2:32pm UTC](https://forum.ionicframework.com/t/issues-with-cordova-android-builds/244013/11 "2024-09-06T14:32:17Z")

</div>

Great interventions, it really worked after I applied the PR changes
