I'm submitting a ... (check one with "x")
[x] bug report
[ ] feature request
I am converting the latLng to location address. I followed instructions from here.
ionic cordova plugin add cordova-plugin-nativegeocoder
npm install --save @ionic-native/native-geocoder
app.module:
import { HttpModule } from '@angular/http';
import { Geolocation } from '@ionic-native/geolocation';
import { NativeGeocoder } from '@ionic-native/native-geocoder';
import { GeocoderProvider } from '../providers/geocoder/geocoder'; -- it is my provider to convert latLng to Location
providers: [
StatusBar,
SplashScreen,
Geolocation,
{ provide: ErrorHandler, useClass: IonicErrorHandler },
NativeGeocoder,
GeocoderProvider
]
GeocoderProvider.ts:
reverseGeocode(lat: number, lng: number): Promise<any> {
try {
return new Promise((resolve, reject) => {
this._GEOCODE.reverseGeocode(lat, lng)
.then((result: NativeGeocoderReverseResult) => {
let str: string =
`The reverseGeocode address is ` +//${result.street} in ${result.countryCode}`;
result.countryCode + '-' +
result.countryName + '-' +
result.locality + '-' +
result.subLocality + '-' +
result.administrativeArea + '-' +
result.subAdministrativeArea + '-' +
result.thoroughfare + '-' +
result.subThoroughfare + '-' +
result.postalCode
resolve(str);
console.log(result);
})
.catch((error: any) => {
reject(error);
console.log(error);
});
});
} catch (e) {
console.log(e);
}
}
I have break point on this._GEOCODE... and it hits. Another break point is on let str: string =... but it is never hit. Also nothing in the console.
What is happening? Why the second break point is not hit?
OK. Break points are hitting now (Thanks to ionic's self healing) :confused:
But an error is raising now:
Native: tried calling NativeGeocoder.reverseGeocode, but the NativeGeocoder plugin is not installed
Install the NativeGeocoder plugin: 'ionic cordova plugin add cordova-plugin-nativegeocoder'
plugin_not_installed
But It is installed. Anyway I Removed and added nativegeocoder Plugin:
ionic cordova plugin rm cordova-plugin-nativegeocoder
ionic cordova plugin add cordova-plugin-nativegeocoder
npm install --save @ionic-native/native-geocoder
The error is still here:tired_face:
Hi mostafa,
Same problem here...
Did you solve your problem?
Got the same problem for Zeroconf...
I think I got a solution :
1) uninstall the plugin with "ionic cordova plugin rm 'pluginname' --save"
2) rm the platform (android in my case)
3) add the platform
4) re-install the plugin with "ionic cordova plugin add 'pluginname' --save"
5) install with npm too, like "npm install ionic-native/nativegeocoder", don't have in my mind the exact command...
I'm not sure that is the right way to do but in my case it works !
Good luck guys
EDIT: This comment was posted by [dumb]me, skip to my next comment.
I'm on the same boat with @teomaragakis, Zeroconf triggering plugin_not_installed. Tried removing and adding in different orders both the plugin and the platform, also the npm package as well... Any idea?
I'm feeling really dumb now, I just forgot entirely about platform.ready(). This comment triggered that feeling in me hahaha, just leaving it here for googlers, or maybe future me ;-)
Most helpful comment
Got the same problem for Zeroconf...