Can't build apk with "app update" plugin

The error is:

   /projects/ionic/BlankProject/platforms/android/src/com/vaenow/appupdate/android/CheckAppUpdate.java:6: error:
        package android.support.v4.app does not exist
        import android.support.v4.app.ActivityCompat;

What I’m doing step-by-step:

  1. Create blank project:
    $ ionic start BlankProject blank
  2. Add android platform:
    $ ionic cordova platform add android
  3. Check if I can build project:
    `$ ionic cordova build android
    (ok, it works)
  4. Install plugins into project:
    $ ionic cordova plugin add cordova-plugin-app-update
    $ npm install --save @ionic-native/app-update
  5. Try again to build project
    $ ionic cordova build android
    (it fails with error from the start of message)

My $ionic info output:

cli packages: (/projects/ionic/BlankProject/node_modules)

    @ionic/cli-plugin-cordova       : 1.6.2
    @ionic/cli-plugin-ionic-angular : 1.4.1
    @ionic/cli-utils                : 1.7.0
    ionic (Ionic CLI)               : 3.7.0

global packages:

    Cordova CLI : 7.0.1 

local packages:

    @ionic/app-scripts : 2.1.3
    Cordova Platforms  : android 6.2.3
    Ionic Framework    : ionic-angular 3.6.0

System:

    Node : v6.11.1
    OS   : Linux 4.11
    npm  : 3.10.10 

Please somebody help me to fix this issue.

Sounds like you’re missing the v4 compatibility bit in your Android SDK.

How I can check it?

Actually yesturday build was working, and I’m sure that since then nothing changed in Android SDK setup.

sdkmanager --list should show all installed packages. You’re looking for something like “extras;android;m2repository”.

Looks like it’s present:

$ sdkmanager --list | grep "extras;android;m2"
Warning: File /root/.android/repositories.cfg could not be loaded.
  extras;android;m2repository       | 47.0.0  | Android Support Repository        | extras/android/m2repository/     
  extras;android;m2repository       | 47.0.0       | Android Support Repository       

Two times because first one from “Installed packages” and second - from “Available packages”

Can it be related to cli packages update?
When it was working I had ionic@3.5.0 and then it changed gradually to 3.6.0 and then 3.7.0

Well, with some changes in plugin itself I’ve managed to get it back to work.