#StackBounty: #angular #typescript #ionic3 #ionic-native #ionic-plugins TypeScript Cannot find name 'ClassName' even-though exp…

Bounty: 50

I have to use certain plugins in my Ionic 3 Application but it gives Cannot find name error. I imported

import { AndroidPermissions } from '@ionic-native/android-permissions';

and on on declaring in constructor (public androidPermissions: AndroidPermissions), it gives an error ([ts] Cannot find name 'AndroidPermissions'.) .

On declaring the same plugin in app.module.ts and declaring in Provider, it gave the error

Type 'AndroidPermissionsOriginal' is not assignable to type 'Provider'.
Type 'AndroidPermissionsOriginal' is missing the following properties from type 'FactoryProvider': provide, useFactory [2322]

After reading forums, I imported the plugin with ngx.

import { AndroidPermissions } from '@ionic-native/android-permissions/ngx'

Error got resolved, but on invoking it throws the error

Uncaught (in promise): TypeError: Object(...) is not a function
TypeError: Object(...) is not a function
    at AndroidPermissions.requestPermissions (
    at t.invoke (
    at Object.onInvoke (
    at t.invoke (
    at r.run (
    at t.invokeTask (
    at Object.onInvokeTask (
    at t.invokeTask (

Similar error happened when using Network plugin and SMS plugin.

Also tried changing the target to es6 and jib to have es2016 in tsconfig.json but noting worked.
Below is my tsconfig.json

  "compilerOptions": {
    "allowSyntheticDefaultImports": true,
    "declaration": false,
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "lib": [
    "module": "es2015",
    "moduleResolution": "node",
    "sourceMap": true,
    "target": "es5"
  "include": [
  "exclude": [
  "compileOnSave": false,
  "atom": {
    "rewriteTsconfig": false

Get this bounty!!!

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.