Android build problems after installing emailComposer and Admob: androidx problems

After adding emailComposer to my app, I started to see build problems in its Provider.java file with this line:

import android.support.v4.content.FileProvider;

I found online that I could change this to

import androidx.core.content.FileProvider;

so I’ve been doing that by hand each time I compile. Inconvenient, but no big deal.

Now, I’ve add Admob to my build and I’m getting more errors. In Admob.java, there is:

import android.support.annotation.NonNull;

In this forum, I found Android.support.v4.content and android.support.annotations does not exist.

The solution says to use https://github.com/dpa99c/cordova-plugin-androidx-adapter

Glory be! This seems perfect!

However, when I do:

ionic build --prod --release && npx cap sync && npx cap open android

I still see all the build errors…

Any thoughts? Help?


Ionic:

   Ionic CLI                     : 6.12.2 (/usr/local/lib/node_modules/@ionic/cli)
   Ionic Framework               : @ionic/angular 5.5.2
   @angular-devkit/build-angular : 0.1000.8
   @angular-devkit/schematics    : 10.0.8
   @angular/cli                  : 10.0.8
   @ionic/angular-toolkit        : 2.3.3

Capacitor:

   Capacitor CLI   : 2.4.4
   @capacitor/core : 2.4.4

Cordova:

   Cordova CLI       : 10.0.0
   Cordova Platforms : none
   Cordova Plugins   : no whitelisted plugins (1 plugins total)

Utility:

   cordova-res                          : not installed
   native-run (update available: 1.3.0) : 1.2.2

System:

   Android SDK Tools : 26.1.1 (/Users/vtn2/Library/Android/sdk)
   NodeJS            : v12.19.0 (/usr/local/bin/node)
   npm               : 6.14.8
   OS                : macOS Catalina
   Xcode             : Xcode 12.3 Build version 12C33