I have an Ionic 5 (cordova not capacitor) project that I have been working on for a while. I have built it many times over the past couple months. I last built successfully a couple weeks ago. It has always built. I hadn’t touched it in a couple weeks and came back to work on sorting out some GeoLocation issues which required adding a few new plugins. I got the new geo approach working in Chrome and then went to try to build. I found out the app would no longer build. I removed plugins, reverted back to an old version from git and no luck.
The errors were not consistent but this was one of them:
> Task :app:processDebugResources FAILED FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':app:processDebugResources'. > A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade > Android resource linking failed E:\www\sz.app\platforms\android\app\src\main\res\xml\authenticator.xml:2: AAPT: error: resource mipmap/icon (aka nl.stolpersteinezutphen.www:mipmap/icon) not found.
I must have found some posts talking about versions of Java so I spent hours uninstalling and re-installing various versions of JDK and JRE. I was about to call it a night when i tried to build one more time. Much to my surprise; the app built. I loaded it on a device and it worked fine.
Excited by this unexpected fix i wanted to re-add some of the new geo plugins to see if that new solution would work on a device. When i tried to do standard plugin install:
ionic cordova plugin add @mauron85/cordova-plugin-background-geolocation
it said i could not add a plugin that way to a capacitor project. When did my project become a capacitor project?
After some digging I found out I could remove it from being a capacitor project by doing this:
ionic integrations disable capacitor
but of course, after doing that my project would no longer build. I put it back as a capacitor project and it still would not build. I am now getting the error posted above, again, after hours wasted trying to sort out Java environment.
No idea why this all of sudden stopped being buildable. Tomorrow I will try a fresh ionic starter app and see if that builds; and then if it does, perhaps only solution here is to start with a fresh build and re-add all the plugins and code from scratch.