question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot find name 'plugin'. Did you mean 'Plugin'? - Ionic

See original GitHub issue

I’m submitting a … (check one with “x”)

  • [x ] question
  • any problem or bug report
  • feature request

If you choose ‘problem or bug report’, please select OS: (check one with “x”)

  • Android
  • iOS

cordova information: (run $> cordova plugin list)

cordova-plugin-device 2.0.2 "Device"
cordova-plugin-googlemaps 2.2.9 "cordova-plugin-googlemaps"
cordova-plugin-ionic-keyboard 2.0.5 "cordova-plugin-ionic-keyboard"
cordova-plugin-ionic-webview 1.2.0 "cordova-plugin-ionic-webview"
cordova-plugin-splashscreen 5.0.2 "Splashscreen"
cordova-plugin-whitelist 1.3.3 "Whitelist"

If you use @ionic-native/google-maps, please tell the package.json (only @ionic-native/core and @ionic-native/google-maps are fine mostly)

{
  "name": "uber-clone",
  "version": "0.0.1",
  "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/animations": "5.2.9",
    "@angular/common": "5.2.9",
    "@angular/compiler": "5.2.9",
    "@angular/compiler-cli": "5.2.9",
    "@angular/core": "5.2.9",
    "@angular/forms": "5.2.9",
    "@angular/http": "5.2.9",
    "@angular/platform-browser": "5.2.9",
    "@angular/platform-browser-dynamic": "5.2.9",
    "@ionic-native/core": "^4.7.0",
    "@ionic-native/google-maps": "^4.7.0",
    "@ionic-native/splash-screen": "4.6.0",
    "@ionic-native/status-bar": "4.6.0",
    "@ionic/storage": "2.1.3",
    "cordova-android": "7.0.0",
    "cordova-plugin-device": "^2.0.2",
    "cordova-plugin-googlemaps": "^2.2.9",
    "cordova-plugin-ionic-keyboard": "^2.0.5",
    "cordova-plugin-ionic-webview": "^1.2.0",
    "cordova-plugin-splashscreen": "^5.0.2",
    "cordova-plugin-whitelist": "^1.3.3",
    "ionic-angular": "3.9.2",
    "ionicons": "3.0.0",
    "rxjs": "5.5.8",
    "sw-toolbox": "3.6.0",
    "zone.js": "0.8.26"
  },
  "devDependencies": {
    "@ionic/app-scripts": "3.1.8",
    "typescript": "~2.6.2"
  },
  "description": "An Ionic project",
  "cordova": {
    "plugins": {
      "cordova-plugin-googlemaps": {
        "API_KEY_FOR_ANDROID": "MY-API-KEY",
        "API_KEY_FOR_IOS": "MY-API-KEY"
      },
      "cordova-plugin-whitelist": {},
      "cordova-plugin-device": {},
      "cordova-plugin-splashscreen": {},
      "cordova-plugin-ionic-webview": {},
      "cordova-plugin-ionic-keyboard": {}
    },
    "platforms": [
      "android"
    ]
  }
}

Current behavior:

i’m trying to use plugin.google.maps.geometry.encoding inside my Ionic app but I’m getting this error: Cannot find name 'plugin'. Did you mean 'Plugin'?.

How can I access plugin from Ionic?

This is my code: var path = plugin.google.maps.geometry.encoding.decodePath(json['overview_polyline']['points'])

Expected behavior:

Screen capture or video record:

The person who share your project files on Github (or other git repository) is in faster lane than other people.
Please share your project files on Github or others(Bitbucket, Gitlabs...etc).
If you don't want to share your project files, please create a demo project, then share it.

Screen captures, and/or native logs(such as Logcat, xcode logs) are appreciate.

Giving much information, you are waiting time is less.
Thank you for your cooperation.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

0reactions
BrianMoreno1994commented, Apr 18, 2018

Thanks, worked perfectly!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot build ionic 4 app with any native plugins: Error TS2304
Hi, I am trying to migrate my Ionic v3 (Angular) app to Ionic v4 (Angular) and I am stuck trying to use any...
Read more >
Cannot find name 'cordova'. ionic 5 build android
You have to declare that just after import statements. Because Cordova is not directly available like normal phonegap or Cordova projects.
Read more >
Using Cordova Plugins and Ionic Native
Using Cordova Plugins and Ionic Native. When developing an app that uses Capacitor, it's possible to use both Cordova and Ionic Native plugins....
Read more >
How to Build Your Own Capacitor Plugin for Ionic
To get started with a new Capacitor plugin, you can simply call the generate command of the Capacitor CLI (install if you haven't)...
Read more >
Migrating to Cordova-Android 11
You can check "Show Package Details" next to the Android SDK ... The plugin cordova-plugin-androidx is not required as it is built in...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found