Need help with native plugin mobile accessability

Seems I have the same problem with this plugin on my system. I created an issue with the CLI:

There you also see the solution: Install it with cordova directly, without ionic in front. Something is strange with this plugin.

I am getting error without ionic in front also:

C:\Users\user\Documents\myapp>cordova plugin add https://github.com/phonegap/phonegap-mobile-accessibility
Error: Failed to fetch plugin https://github.com/phonegap/phonegap-mobile-accessibility via registry.
Probably this is either a connection problem, or plugin spec is incorrect.
Check your connection and plugin name/version/URL.
Failed to get absolute path to installed module

ionic info:

global packages:

    @ionic/cli-utils : 1.3.0
    Cordova CLI      : 7.0.1
    Ionic CLI        : 3.3.0

local packages:

    @ionic/app-scripts              : 1.3.7
    @ionic/cli-plugin-cordova       : 1.3.0
    @ionic/cli-plugin-ionic-angular : 1.3.0
    Cordova Platforms               : android 6.2.3
    Ionic Framework                 : ionic-angular 3.2.1

System:

    Node       : v7.0.0
    OS         : Windows 10
    Xcode      : not installed
    ios-deploy : not installed
    ios-sim    : not installed

Ok, now it gets really strange: Remove the android platform, update Cordova to 7.0.1 and try again - that’s the only difference between our info :confused:

Wow, just ran the same command again and got the same error message. Github having problems maybe?

1 Like

Now it worked again.

Maybe you have to run cordova plugin remove phonegap-plugin-mobile-accessibility first?

Oh yeah!
This one did the trick!
What a weird error message… not so indicative huh?

OK now why

npm install --save @ionic-native/mobile-accessibility

would fail?

What is os: darwin?

Thanks a lot for your help!

I think these are just warnings that can be ignored.

Something is still missing.
I build the app and put it on my phone.
I used: adb -s <device> shell logcat -v time | grep <pid> and got this (I made a button that triggers the mobile accessability text zoom functions:

06-02 18:31:30.218 D/SystemWebChromeClient(12942): file:///android_asset/www/build/main.js: Line 44668 : Native: tried calling MobileAccessibility.setTextZoom, but the MobileAccessibility plugin is not installed.
06-02 18:31:30.228 I/chromium(12942): [INFO:CONSOLE(44668)] "Native: tried calling MobileAccessibility.setTextZoom, but the MobileAccessibility plugin is not installed.", source: file:///android_asset/www/build/main.js (44668)
06-02 18:31:30.228 D/SystemWebChromeClient(12942): file:///android_asset/www/build/main.js: Line 44674 : Install the MobileAccessibility plugin: 'ionic cordova plugin add https://github.com/phonegap/phonegap-mobile-accessibility.git'
06-02 18:31:30.228 I/chromium(12942): [INFO:CONSOLE(44674)] "Install the MobileAccessibility plugin: 'ionic cordova plugin add https://github.com/phonegap/phonegap-mobile-accessibility.git'", source: file:///android_asset/www/build/main.js (44674)
06-02 18:31:30.228 D/SystemWebChromeClient(12942): file:///android_asset/www/build/main.js: Line 44668 : Native: tried calling MobileAccessibility.updateTextZoom, but the MobileAccessibility plugin is not installed.
06-02 18:31:30.228 I/chromium(12942): [INFO:CONSOLE(44668)] "Native: tried calling MobileAccessibility.updateTextZoom, but the MobileAccessibility plugin is not installed.", source: file:///android_asset/www/build/main.js (44668)
06-02 18:31:30.228 D/SystemWebChromeClient(12942): file:///android_asset/www/build/main.js: Line 44674 : Install the MobileAccessibility plugin: 'ionic cordova plugin add https://github.com/phonegap/phonegap-mobile-accessibility.git'
06-02 18:31:30.228 I/chromium(12942): [INFO:CONSOLE(44674)] "Install the MobileAccessibility plugin: 'ionic cordova plugin add https://github.com/phonegap/phonegap-mobile-accessibility.git'", source: file:///android_asset/www/build/main.js (44674)

Any idea guys?
How can I check which plugins are installed?

ionic cordova plugin list for Cordova plugins,
look into package.json for Ionic Native.

ionic cordova plugin list:

> cordova plugin ls
✔ Running command - done!
cordova-plugin-console 1.0.5 "Console"
cordova-plugin-device 1.1.4 "Device"
cordova-plugin-network-information 1.3.4-dev "Network Information"
cordova-plugin-splashscreen 4.0.3 "Splashscreen"
cordova-plugin-statusbar 2.2.2 "StatusBar"
cordova-plugin-whitelist 1.3.1 "Whitelist"
ionic-plugin-keyboard 2.2.1 "Keyboard"
phonegap-plugin-mobile-accessibility 1.0.5-dev "Mobile Accessibility"

package.json:

{
    "name": "ionic-hello-world",
    "version": "0.0.0",
    "author": "Ionic Framework",
    "homepage": "http://ionicframework.com/",
    "private": true,
    "scripts": {
        "clean": "ionic-app-scripts clean",
        "build": "ionic-app-scripts build",
        "lint": "ionic-app-scripts lint",
        "ionic:build": "ionic-app-scripts build",
        "ionic:serve": "ionic-app-scripts serve"
    },
    "dependencies": {
        "@angular/common": "4.1.0",
        "@angular/compiler": "4.1.0",
        "@angular/compiler-cli": "4.1.0",
        "@angular/core": "4.1.0",
        "@angular/forms": "4.1.0",
        "@angular/http": "4.1.0",
        "@angular/platform-browser": "4.1.0",
        "@angular/platform-browser-dynamic": "4.1.0",
        "@ionic-native/core": "^3.11.0",
        "@ionic-native/mobile-accessibility": "^3.11.0",
        "@ionic-native/splash-screen": "3.7.0",
        "@ionic-native/status-bar": "3.7.0",
        "@ionic/storage": "2.0.1",
        "cordova-android": "^6.2.3",
        "cordova-plugin-console": "~1.0.5",
        "cordova-plugin-device": "~1.1.4",
        "cordova-plugin-network-information": "git+https://github.com/apache/cordova-plugin-network-information.git",
        "cordova-plugin-splashscreen": "~4.0.3",
        "cordova-plugin-statusbar": "~2.2.2",
        "cordova-plugin-whitelist": "~1.3.1",
        "ionic-angular": "3.2.1",
        "ionic-plugin-keyboard": "~2.2.1",
        "ionicons": "3.0.0",
        "phonegap-plugin-mobile-accessibility": "git+https://github.com/phonegap/phonegap-mobile-accessibility.git",
        "rxjs": "5.1.1",
        "sw-toolbox": "3.6.0",
        "zone.js": "0.8.10"
    },
    "devDependencies": {
        "@ionic/app-scripts": "1.3.7",
        "@ionic/cli-plugin-cordova": "1.3.0",
        "@ionic/cli-plugin-ionic-angular": "1.3.0",
        "typescript": "2.2.1"
    },
    "description": "myapp: An Ionic project",
    "cordovaPlugins": [
        "cordova-plugin-device",
        "cordova-plugin-console",
        "cordova-plugin-whitelist",
        "cordova-plugin-splashscreen",
        "cordova-plugin-statusbar",
        "ionic-plugin-keyboard"
    ],
    "cordovaPlatforms": [],
    "cordova": {
        "plugins": {
            "cordova-plugin-console": {},
            "cordova-plugin-device": {},
            "cordova-plugin-splashscreen": {},
            "cordova-plugin-statusbar": {},
            "cordova-plugin-whitelist": {},
            "ionic-plugin-keyboard": {},
            "phonegap-plugin-mobile-accessibility": {}
        },
        "platforms": [
            "android"
        ]
    }
}

Does it seem alright?
This is the first time I am trying to use a native component.

Bumping up again.
If anyone has any idea why this plugin wasn’t installed correctly please help me.
Thanks

Well, after reading this: Ionic native 3 media plugin error("plugin not installed")

I have tried to make a new fresh project and try the plugin with it.
Here is what I did:

> ionic start zoomText blank
> cd zoomText
> ionic cordova plugin add https://github.com/phonegap/phonegap-mobile-accessibility.git
> npm install --save @ionic-native/mobile-accessibility

Then I declared some stuff and called one the plugin methods:

app.module.ts:

import { BrowserModule } from '@angular/platform-browser';
import { ErrorHandler, NgModule } from '@angular/core';
import { IonicApp, IonicErrorHandler, IonicModule } from 'ionic-angular';
import { SplashScreen } from '@ionic-native/splash-screen';
import { StatusBar } from '@ionic-native/status-bar';
import { MobileAccessibility } from '@ionic-native/mobile-accessibility';

import { MyApp } from './app.component';
import { HomePage } from '../pages/home/home';

@NgModule({
  declarations: [
    MyApp,
    HomePage
  ],
  imports: [
    BrowserModule,
    IonicModule.forRoot(MyApp)
  ],
  bootstrap: [IonicApp],
  entryComponents: [
    MyApp,
    HomePage
  ],
  providers: [
    StatusBar,
    SplashScreen,
	MobileAccessibility,
    {provide: ErrorHandler, useClass: IonicErrorHandler}
  ]
})
export class AppModule {}

home.ts:

import { Component } from '@angular/core';
import { NavController, Platform } from 'ionic-angular';
import { MobileAccessibility } from '@ionic-native/mobile-accessibility';

@Component({
  selector: 'page-home',
  templateUrl: 'home.html'
})
export class HomePage {

  constructor(public navCtrl: NavController, platform: Platform, mobileAccessibility: MobileAccessibility) {
	  platform.ready().then(() => {
      mobileAccessibility.setTextZoom(10);
      mobileAccessibility.updateTextZoom();
    });

  }

}

After that I built the app using:

> ionic cordova build android

Finally I found the error. (I still have no clue why it failed though)
This is the output of the build process:

> cordova platform add --save android
✖ Running command - failed!
[ERROR] An error occurred while running cordova platform add --save android (exit code 1):

        Using cordova-fetch for cordova-android@~6.2.2
        Adding android project...
        Creating Cordova project for the Android platform:
                Path: platforms\android
                Package: io.ionic.starter
                Name: MyApp
                Activity: MainActivity
                Android target: android-25
        Subproject Path: CordovaLib
        Android project created with cordova-android@6.2.3
        Installing "phonegap-plugin-mobile-accessibility" for android
        Failed to install 'phonegap-plugin-mobile-accessibility': Error
            at C:\Users\user\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-lib\src\plugman\fetch.js:205:33
            at _rejected (C:\Users\user\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-fetch\node_modules\q\q.js:864:24)
            at C:\Users\user\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-fetch\node_modules\q\q.js:890:30
            at Promise.when (C:\Users\user\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-fetch\node_modules\q\q.js:1142:31)
            at Promise.promise.promiseDispatch (C:\Users\user\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-fetch\node_modules\q\q.js:808:41)
            at C:\Users\user\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-fetch\node_modules\q\q.js:624:44
            at runSingle (C:\Users\user\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-fetch\node_modules\q\q.js:137:13)
            at flush (C:\Users\user\AppData\Roaming\npm\node_modules\cordova\node_modules\cordova-fetch\node_modules\q\q.js:125:13)
            at _combinedTickCallback (internal/process/next_tick.js:67:7)
            at process._tickCallback (internal/process/next_tick.js:98:9)
        Error: Failed to fetch plugin https://github.com/apache/cordova-plugin-device.git via registry.
        Probably this is either a connection problem, or plugin spec is incorrect.
        Check your connection and plugin name/version/URL.
        Error: cmd: Command failed with exit code 1 Error output:
        npm WARN addRemoteGit Error: Command failed: git -c core.longpaths=true config --get remote.origin.url
        npm WARN addRemoteGit
        npm WARN addRemoteGit     at ChildProcess.exithandler (child_process.js:211:12)
        npm WARN addRemoteGit     at emitTwo (events.js:106:13)
        npm WARN addRemoteGit     at ChildProcess.emit (events.js:191:7)
        npm WARN addRemoteGit     at maybeClose (internal/child_process.js:877:16)
        npm WARN addRemoteGit     at Socket.<anonymous> (internal/child_process.js:334:11)
        npm WARN addRemoteGit     at emitOne (events.js:96:13)
        npm WARN addRemoteGit     at Socket.emit (events.js:188:7)
        npm WARN addRemoteGit     at Pipe._handle.close [as _onclose] (net.js:501:12)
        npm WARN addRemoteGit  git+https://github.com/apache/cordova-plugin-device.git resetting remote C:\Users\user\AppData\Roaming\npm-cache\_git-remotes\git-https-github-com-apache-cordova-plugin-device-git-bd593991 because of error: { Error: Command failed: git -c core.longpaths=true config --get remote.origin.url
        npm WARN addRemoteGit
        npm WARN addRemoteGit     at ChildProcess.exithandler (child_process.js:211:12)
        npm WARN addRemoteGit     at emitTwo (events.js:106:13)
        npm WARN addRemoteGit     at ChildProcess.emit (events.js:191:7)
        npm WARN addRemoteGit     at maybeClose (internal/child_process.js:877:16)
        npm WARN addRemoteGit     at Socket.<anonymous> (internal/child_process.js:334:11)
        npm WARN addRemoteGit     at emitOne (events.js:96:13)
        npm WARN addRemoteGit     at Socket.emit (events.js:188:7)
        npm WARN addRemoteGit     at Pipe._handle.close [as _onclose] (net.js:501:12)
        npm WARN addRemoteGit   killed: false,
        npm WARN addRemoteGit   code: 1,
        npm WARN addRemoteGit   signal: null,
        npm WARN addRemoteGit   cmd: 'git -c core.longpaths=true config --get remote.origin.url' }
        npm ERR! git clone --template=C:\Users\user\AppData\Roaming\npm-cache\_git-remotes\_templates --mirror https://github.com/apache/cordova-plugin-device.git C:\Users\user\AppData\Roaming\npm-cache\_git-remotes\git-https-github-com-apache-cordova-plugin-device-git-bd593991: Cloning into bare repository 'C:\Users\user\AppData\Roaming\npm-cache\_git-remotes\git-https-github-com-apache-cordova-plugin-device-git-bd593991'...
        npm ERR! git clone --template=C:\Users\user\AppData\Roaming\npm-cache\_git-remotes\_templates --mirror https://github.com/apache/cordova-plugin-device.git C:\Users\user\AppData\Roaming\npm-cache\_git-remotes\git-https-github-com-apache-cordova-plugin-device-git-bd593991: fatal: Unable to find remote helper for 'https'
        npm ERR! Windows_NT 10.0.14393
        npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "https://github.com/apache/cordova-plugin-device.git" "--save"
        npm ERR! node v7.0.0
        npm ERR! npm  v3.10.8
        npm ERR! code 128

        npm ERR! Command failed: git -c core.longpaths=true clone --template=C:\Users\user\AppData\Roaming\npm-cache\_git-remotes\_templates --mirror https://github.com/apache/cordova-plugin-device.git C:\Users\user\AppData\Roaming\npm-cache\_git-remotes\git-https-github-com-apache-cordova-plugin-device-git-bd593991
        npm ERR! Cloning into bare repository 'C:\Users\user\AppData\Roaming\npm-cache\_git-remotes\git-https-github-com-apache-cordova-plugin-device-git-bd593991'...
        npm ERR! fatal: Unable to find remote helper for 'https'
        npm ERR!
        npm ERR!
        npm ERR! If you need help, you may report this error at:
        npm ERR!     <https://github.com/npm/npm/issues>

        npm ERR! Please include the following file with any support request:
        npm ERR!     C:\Users\user\Documents\ionic-apps\zoomText\node_modules\npm-debug.log

When I try to build one more time the error has vanished (this is why I missed it only appears in the first try):

Running app-scripts build: --iscordovaserve --externalIpRequired --nobrowser

[17:43:51]  build dev started ...
[17:43:51]  clean started ...
[17:43:51]  clean finished in less than 1 ms
[17:43:51]  copy started ...
[17:43:51]  transpile started ...
[17:43:54]  transpile finished in 2.44 s
[17:43:54]  preprocess started ...
[17:43:54]  deeplinks started ...
[17:43:54]  deeplinks finished in 12 ms
[17:43:54]  preprocess finished in 12 ms
[17:43:54]  webpack started ...
[17:43:54]  copy finished in 2.64 s
[17:44:00]  webpack finished in 6.54 s
[17:44:00]  sass started ...
[17:44:02]  sass finished in 1.60 s
[17:44:02]  postprocess started ...
[17:44:02]  postprocess finished in less than 1 ms
[17:44:02]  lint started ...
[17:44:02]  build dev finished in 10.66 s
> cordova build android
\ Running command [17:44:04]  lint finished in 2.26 s
✔ Running command - done!
Discovered plugin "cordova-plugin-console" in config.xml. Adding it to the project
Installing "cordova-plugin-console" for android
Discovered plugin "cordova-plugin-device" in config.xml. Adding it to the project
Installing "cordova-plugin-device" for android
Discovered plugin "cordova-plugin-splashscreen" in config.xml. Adding it to the project
Installing "cordova-plugin-splashscreen" for android
Discovered plugin "cordova-plugin-statusbar" in config.xml. Adding it to the project
Installing "cordova-plugin-statusbar" for android
Discovered plugin "cordova-plugin-whitelist" in config.xml. Adding it to the project
Installing "cordova-plugin-whitelist" for android

               This plugin is only applicable for versions of cordova-android greater than 4.0. If you have a previous platform version, you do *not* need this plugin since the whitelist will be built in.

Discovered plugin "ionic-plugin-keyboard" in config.xml. Adding it to the project
Installing "ionic-plugin-keyboard" for android
ANDROID_HOME=C:\Users\user\AppData\Local\Android\sdk
JAVA_HOME=C:\Program Files\java\jdk1.8.0_111
:wrapper

BUILD SUCCESSFUL

Total time: 9.232 secs
Subproject Path: CordovaLib
Starting a Gradle Daemon, 1 incompatible and 2 stopped Daemons could not be reused, use --status for details
The Task.leftShift(Closure) method has been deprecated and is scheduled to be removed in Gradle 5.0. Please use Task.doLast(Action) instead.
        at build_3iik2utc6slvmf8ankw1d8ya4.run(C:\Users\user\Documents\ionic-apps\zoomText\platforms\android\build.gradle:137)
The JavaCompile.setDependencyCacheDir() method has been deprecated and is scheduled to be removed in Gradle 4.0.
Incremental java compilation is an incubating feature.
The TaskInputs.source(Object) method has been deprecated and is scheduled to be removed in Gradle 4.0. Please use TaskInputs.file(Object).skipWhenEmpty() instead.
:preBuild UP-TO-DATE
:preDebugBuild UP-TO-DATE
:checkDebugManifest
:CordovaLib:preBuild UP-TO-DATE
:CordovaLib:preDebugBuild UP-TO-DATE
:CordovaLib:checkDebugManifest
:CordovaLib:prepareDebugDependencies
:CordovaLib:compileDebugAidl
:CordovaLib:compileDebugNdk UP-TO-DATE
:CordovaLib:compileLint
:CordovaLib:copyDebugLint UP-TO-DATE
:CordovaLib:mergeDebugShaders
:CordovaLib:compileDebugShaders
:CordovaLib:generateDebugAssets
:CordovaLib:mergeDebugAssets
:CordovaLib:mergeDebugProguardFiles
:CordovaLib:packageDebugRenderscript UP-TO-DATE
:CordovaLib:compileDebugRenderscript
:CordovaLib:generateDebugResValues
:CordovaLib:generateDebugResources
:CordovaLib:packageDebugResources
:CordovaLib:processDebugManifest
:CordovaLib:generateDebugBuildConfig
:CordovaLib:processDebugResources
:CordovaLib:generateDebugSources
:CordovaLib:incrementalDebugJavaCompilationSafeguard
:CordovaLib:compileDebugJavaWithJavac
:CordovaLib:compileDebugJavaWithJavac - is not incremental (e.g. outputs have changed, no previous execution, etc.).
:CordovaLib:processDebugJavaRes UP-TO-DATE
:CordovaLib:transformResourcesWithMergeJavaResForDebug
:CordovaLib:transformClassesAndResourcesWithSyncLibJarsForDebug
:CordovaLib:mergeDebugJniLibFolders
:CordovaLib:transformNative_libsWithMergeJniLibsForDebug
:CordovaLib:transformNative_libsWithSyncJniLibsForDebug
:CordovaLib:bundleDebug
:prepareOrgApacheCordovaCordovaLib623DebugLibrary
:prepareDebugDependencies
:compileDebugAidl
:compileDebugRenderscript
:generateDebugBuildConfig
:generateDebugResValues
:generateDebugResources
:mergeDebugResources
:processDebugManifest
:processDebugResources
:generateDebugSources
:incrementalDebugJavaCompilationSafeguard
:compileDebugJavaWithJavac
:compileDebugJavaWithJavac - is not incremental (e.g. outputs have changed, no previous execution, etc.).
:compileDebugNdk UP-TO-DATE
:compileDebugSources
:mergeDebugShaders
:compileDebugShaders
:generateDebugAssets
:mergeDebugAssets
:transformClassesWithDexForDebug
:mergeDebugJniLibFolders
:transformNative_libsWithMergeJniLibsForDebug
:processDebugJavaRes UP-TO-DATE
:transformResourcesWithMergeJavaResForDebug
:validateSigningDebug
:packageDebug
:assembleDebug
:cdvBuildDebug

BUILD SUCCESSFUL

Total time: 28.521 secs
Built the following apk(s):```

There is no mention of the mobile-accessibility plugin...

I took the apk to my device, installed it and using `adb shell` with `logcat` once again I got the plugin not installed error as expected:

06-12 15:45:14.810 I/chromium(10743): [INFO:CONSOLE(44383)] “Native: tried calling MobileAccessibility.setTextZoom, but the MobileAccessibility plugin is not installed.”, source: file:///android_asset/www/build/main.js (44383)

Something seems to be broken with your environment, because that plugin installs without problem for me. Is there anything unusual about your network environment (mean proxy, for example)? Do you have any non-Windows machines you can try this on?

Unfortunately no. I have only my Windows laptop to work on.
I am not using any proxy as far as I know.

  1. Have you tried actually build a project with that plugin and use it?
  2. How can I force the build process to try installing all the plugins? It is quite weird that after the first failure there is no mention to any of the plugins if I try to build once again.
  3. How can I “verify” my environment? What should I check? I even tried to re-install git but it had no effect.

Try another network connection at least. Open a hotspot with your mobile phone, connect to that, and do the “new project” dance again (so you start with a clean slate and not a borken project)

Well… I tried it with a hotspot but I got the same errors.

Then I started a new project and tried to install the plugin without ionic prefix (using cordova only).
It seemed that the installation and the build passed alright but when after I installed the APK (the result of cordova build android) it crashed right after startup. After that I tried to build it again but this time with ionic, installed the APK, opened the app… same error (plugin not installed) on logcat.

This is the output of my cmd for what I described above:

C:\Users\user\Documents\ionic-apps>ionic start phone blank
✔ Creating directory .\phone - done!
[INFO] Fetching app base (https://github.com/ionic-team/ionic2-app-base/archive/master.tar.gz)
✔ Downloading - done!
[INFO] Fetching starter template blank (https://github.com/ionic-team/ionic2-starter-blank/archive/master.tar.gz)
✔ Downloading - done!
✔ Updating package.json with app details - done!
✔ Creating configuration file ionic.config.json - done!
[INFO] Installing dependencies may take several minutes!
> npm install
✔ Running command - done!
> npm install --save-dev --save-exact @ionic/cli-plugin-ionic-angular@latest
✔ Running command - done!
> git init
✔ Running command - done!
> git add -A
✔ Running command - done!
> git commit -m "Initial commit" --no-gpg-sign
✖ Running command - failed!
[ERROR] An error occurred while running git commit -m "Initial commit" --no-gpg-sign (exit code 128):


        *** Please tell me who you are.

        Run

        git config --global user.email "you@example.com"
        git config --global user.name "Your Name"

        to set your account's default identity.
        Omit --global to set the identity only in this repository.

        fatal: unable to auto-detect email address (got 'user@DESKTOP-GNNTSLF.(none)')



C:\Users\user\Documents\ionic-apps>cd phone

C:\Users\user\Documents\ionic-apps\phone>cordova plugin add https://github.com/phonegap/phonegap-mobile-accessibility.git
Adding phonegap-plugin-mobile-accessibility to package.json
Saved plugin info for "phonegap-plugin-mobile-accessibility" to config.xml

C:\Users\user\Documents\ionic-apps\phone>npm install --save @ionic-native/mobile-accessibility
phone@0.0.1 C:\Users\user\Documents\ionic-apps\phone
`-- @ionic-native/mobile-accessibility@3.12.1

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules\chokidar\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

C:\Users\user\Documents\ionic-apps\phone>cordova build android
Error: No platforms added to this project. Please use `cordova platform add <platform>`.

C:\Users\user\Documents\ionic-apps\phone>cordova platform add android
Using cordova-fetch for cordova-android@~6.2.2
Adding android project...
Creating Cordova project for the Android platform:
        Path: platforms\android
        Package: io.ionic.starter
        Name: MyApp
        Activity: MainActivity
        Android target: android-25
Subproject Path: CordovaLib
Android project created with cordova-android@6.2.3
Installing "phonegap-plugin-mobile-accessibility" for android
Installing "cordova-plugin-device" for android
Installing "cordova-plugin-network-information" for android
Discovered plugin "cordova-plugin-console" in config.xml. Adding it to the project
Installing "cordova-plugin-console" for android
Adding cordova-plugin-console to package.json
Saved plugin info for "cordova-plugin-console" to config.xml
Discovered plugin "cordova-plugin-splashscreen" in config.xml. Adding it to the project
Installing "cordova-plugin-splashscreen" for android
Adding cordova-plugin-splashscreen to package.json
Saved plugin info for "cordova-plugin-splashscreen" to config.xml
Discovered plugin "cordova-plugin-statusbar" in config.xml. Adding it to the project
Installing "cordova-plugin-statusbar" for android
Adding cordova-plugin-statusbar to package.json
Saved plugin info for "cordova-plugin-statusbar" to config.xml
Discovered plugin "cordova-plugin-whitelist" in config.xml. Adding it to the project
Installing "cordova-plugin-whitelist" for android

               This plugin is only applicable for versions of cordova-android greater than 4.0. If you have a previous platform version, you do *not* need this plugin since the whitelist will be built in.

Adding cordova-plugin-whitelist to package.json
Saved plugin info for "cordova-plugin-whitelist" to config.xml
Discovered plugin "ionic-plugin-keyboard" in config.xml. Adding it to the project
Installing "ionic-plugin-keyboard" for android
Adding ionic-plugin-keyboard to package.json
Saved plugin info for "ionic-plugin-keyboard" to config.xml
--save flag or autosave detected
Saving android@~6.2.3 into config.xml file ...

C:\Users\user\Documents\ionic-apps\phone>cordova build android
ANDROID_HOME=C:\Users\user\AppData\Local\Android\sdk
JAVA_HOME=C:\Program Files\java\jdk1.8.0_111
:wrapper

BUILD SUCCESSFUL

Total time: 3.068 secs
Subproject Path: CordovaLib
The Task.leftShift(Closure) method has been deprecated and is scheduled to be removed in Gradle 5.0. Please use Task.doLast(Action) instead.
        at build_9qmfnjdd3z73vrir9fpy03353.run(C:\Users\user\Documents\ionic-apps\phone\platforms\android\build.gradle:137)
The JavaCompile.setDependencyCacheDir() method has been deprecated and is scheduled to be removed in Gradle 4.0.
Incremental java compilation is an incubating feature.
The TaskInputs.source(Object) method has been deprecated and is scheduled to be removed in Gradle 4.0. Please use TaskInputs.file(Object).skipWhenEmpty() instead.
:preBuild UP-TO-DATE
:preDebugBuild UP-TO-DATE
:checkDebugManifest
:CordovaLib:preBuild UP-TO-DATE
:CordovaLib:preDebugBuild UP-TO-DATE
:CordovaLib:checkDebugManifest
:CordovaLib:prepareDebugDependencies
:CordovaLib:compileDebugAidl
:CordovaLib:compileDebugNdk UP-TO-DATE
:CordovaLib:compileLint
:CordovaLib:copyDebugLint UP-TO-DATE
:CordovaLib:mergeDebugShaders
:CordovaLib:compileDebugShaders
:CordovaLib:generateDebugAssets
:CordovaLib:mergeDebugAssets
:CordovaLib:mergeDebugProguardFiles
:CordovaLib:packageDebugRenderscript UP-TO-DATE
:CordovaLib:compileDebugRenderscript
:CordovaLib:generateDebugResValues
:CordovaLib:generateDebugResources
:CordovaLib:packageDebugResources
:CordovaLib:processDebugManifest
:CordovaLib:generateDebugBuildConfig
:CordovaLib:processDebugResources
:CordovaLib:generateDebugSources
:CordovaLib:incrementalDebugJavaCompilationSafeguard
:CordovaLib:compileDebugJavaWithJavac
:CordovaLib:compileDebugJavaWithJavac - is not incremental (e.g. outputs have changed, no previous execution, etc.).
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
:CordovaLib:processDebugJavaRes UP-TO-DATE
:CordovaLib:transformResourcesWithMergeJavaResForDebug
:CordovaLib:transformClassesAndResourcesWithSyncLibJarsForDebug
:CordovaLib:mergeDebugJniLibFolders
:CordovaLib:transformNative_libsWithMergeJniLibsForDebug
:CordovaLib:transformNative_libsWithSyncJniLibsForDebug
:CordovaLib:bundleDebug
:prepareOrgApacheCordovaCordovaLib623DebugLibrary
:prepareDebugDependencies
:compileDebugAidl
:compileDebugRenderscript
:generateDebugBuildConfig
:generateDebugResValues
:generateDebugResources
:mergeDebugResources
:processDebugManifest
:processDebugResources
:generateDebugSources
:incrementalDebugJavaCompilationSafeguard
:compileDebugJavaWithJavac
:compileDebugJavaWithJavac - is not incremental (e.g. outputs have changed, no previous execution, etc.).
Note: C:\Users\user\Documents\ionic-apps\phone\platforms\android\src\org\apache\cordova\splashscreen\SplashScreen.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
:compileDebugNdk UP-TO-DATE
:compileDebugSources
:mergeDebugShaders
:compileDebugShaders
:generateDebugAssets
:mergeDebugAssets
:transformClassesWithDexForDebug
:mergeDebugJniLibFolders
:transformNative_libsWithMergeJniLibsForDebug
:processDebugJavaRes UP-TO-DATE
:transformResourcesWithMergeJavaResForDebug
:validateSigningDebug
:packageDebug
:assembleDebug
:cdvBuildDebug

BUILD SUCCESSFUL

Total time: 7.008 secs
Built the following apk(s):
        C:/Users/user/Documents/ionic-apps/phone/platforms/android/build/outputs/apk/android-debug.apk

C:\Users\user\Documents\ionic-apps\phone>grep
Usage: grep [OPTION]... PATTERN [FILE]...
Try 'grep --help' for more information.

C:\Users\user\Documents\ionic-apps\phone>ionic cordova build android
? The plugin @ionic/cli-plugin-cordova is not installed. Would you like to install it and continue? Yes
> npm install --save-dev --save-exact @ionic/cli-plugin-cordova@latest
✔ Running command - done!
Running app-scripts build: --iscordovaserve --externalIpRequired --nobrowser

[18:02:33]  build dev started ...
[18:02:33]  clean started ...
[18:02:33]  clean finished in 2 ms
[18:02:33]  copy started ...
[18:02:33]  transpile started ...
[18:02:36]  transpile finished in 2.65 s
[18:02:36]  preprocess started ...
[18:02:36]  deeplinks started ...
[18:02:36]  deeplinks finished in 12 ms
[18:02:36]  preprocess finished in 13 ms
[18:02:36]  webpack started ...
[18:02:36]  copy finished in 2.87 s
[18:02:43]  webpack finished in 7.44 s
[18:02:43]  sass started ...
[18:02:44]  sass finished in 1.14 s
[18:02:44]  postprocess started ...
[18:02:44]  postprocess finished in 6 ms
[18:02:44]  lint started ...
[18:02:44]  build dev finished in 11.29 s
> cordova build android
/ Running command [18:02:47]  lint finished in 2.52 s
✔ Running command - done!
ANDROID_HOME=C:\Users\user\AppData\Local\Android\sdk
JAVA_HOME=C:\Program Files\java\jdk1.8.0_111
Subproject Path: CordovaLib
The Task.leftShift(Closure) method has been deprecated and is scheduled to be removed in Gradle 5.0. Please use Task.doLast(Action) instead.
        at build_9qmfnjdd3z73vrir9fpy03353.run(C:\Users\user\Documents\ionic-apps\phone\platforms\android\build.gradle:137)
The JavaCompile.setDependencyCacheDir() method has been deprecated and is scheduled to be removed in Gradle 4.0.
Incremental java compilation is an incubating feature.
The TaskInputs.source(Object) method has been deprecated and is scheduled to be removed in Gradle 4.0. Please use TaskInputs.file(Object).skipWhenEmpty() instead.
:preBuild UP-TO-DATE
:preDebugBuild UP-TO-DATE
:checkDebugManifest
:CordovaLib:preBuild UP-TO-DATE
:CordovaLib:preDebugBuild UP-TO-DATE
:CordovaLib:checkDebugManifest
:CordovaLib:prepareDebugDependencies
:CordovaLib:compileDebugAidl UP-TO-DATE
:CordovaLib:compileDebugNdk UP-TO-DATE
:CordovaLib:compileLint UP-TO-DATE
:CordovaLib:copyDebugLint UP-TO-DATE
:CordovaLib:mergeDebugShaders UP-TO-DATE
:CordovaLib:compileDebugShaders UP-TO-DATE
:CordovaLib:generateDebugAssets UP-TO-DATE
:CordovaLib:mergeDebugAssets UP-TO-DATE
:CordovaLib:mergeDebugProguardFiles UP-TO-DATE
:CordovaLib:packageDebugRenderscript UP-TO-DATE
:CordovaLib:compileDebugRenderscript UP-TO-DATE
:CordovaLib:generateDebugResValues UP-TO-DATE
:CordovaLib:generateDebugResources UP-TO-DATE
:CordovaLib:packageDebugResources UP-TO-DATE
:CordovaLib:processDebugManifest UP-TO-DATE
:CordovaLib:generateDebugBuildConfig UP-TO-DATE
:CordovaLib:processDebugResources UP-TO-DATE
:CordovaLib:generateDebugSources UP-TO-DATE
:CordovaLib:incrementalDebugJavaCompilationSafeguard UP-TO-DATE
:CordovaLib:compileDebugJavaWithJavac UP-TO-DATE
:CordovaLib:processDebugJavaRes UP-TO-DATE
:CordovaLib:transformResourcesWithMergeJavaResForDebug UP-TO-DATE
:CordovaLib:transformClassesAndResourcesWithSyncLibJarsForDebug UP-TO-DATE
:CordovaLib:mergeDebugJniLibFolders UP-TO-DATE
:CordovaLib:transformNative_libsWithMergeJniLibsForDebug UP-TO-DATE
:CordovaLib:transformNative_libsWithSyncJniLibsForDebug UP-TO-DATE
:CordovaLib:bundleDebug UP-TO-DATE
:prepareOrgApacheCordovaCordovaLib623DebugLibrary UP-TO-DATE
:prepareDebugDependencies
:compileDebugAidl UP-TO-DATE
:compileDebugRenderscript UP-TO-DATE
:generateDebugBuildConfig UP-TO-DATE
:generateDebugResValues UP-TO-DATE
:generateDebugResources UP-TO-DATE
:mergeDebugResources UP-TO-DATE
:processDebugManifest UP-TO-DATE
:processDebugResources UP-TO-DATE
:generateDebugSources UP-TO-DATE
:incrementalDebugJavaCompilationSafeguard UP-TO-DATE
:compileDebugJavaWithJavac UP-TO-DATE
:compileDebugNdk UP-TO-DATE
:compileDebugSources UP-TO-DATE
:mergeDebugShaders UP-TO-DATE
:compileDebugShaders UP-TO-DATE
:generateDebugAssets UP-TO-DATE
:mergeDebugAssets
:transformClassesWithDexForDebug UP-TO-DATE
:mergeDebugJniLibFolders UP-TO-DATE
:transformNative_libsWithMergeJniLibsForDebug UP-TO-DATE
:processDebugJavaRes UP-TO-DATE
:transformResourcesWithMergeJavaResForDebug UP-TO-DATE
:validateSigningDebug
:packageDebug
:assembleDebug
:cdvBuildDebug

BUILD SUCCESSFUL

Total time: 3.222 secs
Built the following apk(s):
        C:/Users/user/Documents/ionic-apps/phone/platforms/android/build/outputs/apk/android-debug.apk

I think I managed to clear my environment because after that I installed another native plugin (Native Audio) and used it with my app and it works perfectly.
I guess that this plugin is somehow broken, unless a windows user will claim otherwise.

Anyway, I really feel I shaved a big yak here. The reason I turned to mobile accessibility is described here: How to ignore/override system font size
If anyone has a better solution I would be thankful to here about it.

Thanks a lot guys.

7 posts were split to a new topic: Error with the Mobile Accessibility plugin

This seems to be an actual bug with the Ionic Native plugin, more information (and workaround) here:

try in v4 ionic

declare var window: any;

and

getTextZoomCallback(textZoom) { // is my function callback
console.log('Current text zoom = ’ + textZoom + ‘%’)
}

call in init

window.MobileAccessibility.getTextZoom(this.getTextZoomCallback);

great success!!