Geolocation
I am trying to get geolocation details , i have added geolocation plugin using cordova command line
$ cordova plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-geolocation.git
$ cordova plugin rm org.apache.cordova.core.geolocation
Application created using cordova commandline
The Command-Line Interface
After adding plugin through command line android plugin is missing
in the following screenshot android is missing
Can anybody please help me ?
The native code for Android Geolocation was removed, see the deprecation bug. This was because the native implementation was buggy and the native browser geolocation works fine. Since Cordova (Phonegap)'s goal is to not exist, it was only a matter of time until this was removed. You can use Geolocation just like you normally would, it just won't use the native code and instead rely on the browser version.
If you look in the plugin xml file, you will see that there is still some lines in there about Android. This is so that cordova plugin add org.apache.cordova.geolocation
will correctly copy in the needed permissions to run on Android.
Check this link : Go to Add Plugin Features
Add Plugin Features
You can use the CLI to search for plugins from this registry.
For example, searching for geolocation produces a single result that matches terms as case-insensitive : Just search for plugin in command prompt.
cordova plugin search geolocation
By firing above command you will get search result as :
org.apache.cordova.geolocation - Cordova Geolocation Plugin
Now to install this plugin you need to fire :
cordova plugin add org.apache.cordova.geolocation
You will get result as :
Fetching plugin "org.apache.cordova.geolocation" via plugin registry
Installing "org.apache.cordova.geolocation" for android
Finally, the geolocation plugin will be installed in your application_name/plugins directory.
Path will look as : D:\PhoneGap\hello\plugins\org.apache.cordova.geolocation
Here are the steps to make you happy.It took a whole day for me to sort out this. Better you downgrade the version of geolocation plugin. Go through below steps:
a)Remove the already downloaded geolocation plugin: phonegap plugin rm org.apache.cordova.geolocation
b)Add the downgraded geolocation plugin: phonegap plugin add [email protected]
Now you will see the android folder under the plugins folder. Cheer up!!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With