No provider for ZeroConf!


#1

I want to find out the IP address of an device in my network that is reachable with .local in my webbrowser.
I found out that i should use Zeroconf, found it in the Ionic Native Docs.

I have imported it into my component and added it to my constructor, as seen in the docs.
But the following error occurs:
No provider for Zeroconf!

Can anyone help me out here, i did not find any answers on the internet.


#2

HI @dgruenberger

Have you included the Zeroconf this provider in your app.module.ts file?


#3

No i haven’t because there is no information about this in the docs.

Where should i put it in the app.module?


#4

Hi @dgruenberger

In

 providers: [
    StatusBar,   
    SplashScreen,
    Zeroconf,
    {provide: ErrorHandler, useClass: IonicErrorHandler}
  ]

#5

You put it in the providers section.


#6

Ok, my error is not there anymore but this error occured then:


Is Zeroconf maybe not available in Ionic Lab?


#7

Native Plugins called native because they are made for native usage. So you can run them only on a native device.


#8

Ok, thank you.
But should Ionic lab just ignore them? - nothing works now.


#9

Thank you very much!


#10

Did you try to call this plugin? Maybe not all plugins are ignored by default.


#11

Yes, i tried to use it in ionic lab but then the whole app does not work. i commented it out and everything works great again.


#12

I always recommend developing apps directly on native devices. I use the lab only to style my prototypes before I start developing with native plugins.


#13

Ok.
My emulator is very slow, what kind of emulator do you use?


#14

I develop on real devices with ionic run android -l -c
So the app live reloads like in the browser and you get the console output too.

But if I have to use an Android Emulator I recommend genymotion: https://www.genymotion.com/

The emulators are notable faster than the emulators coming with the Android SDK.


#15

Thank you very much!
I never heard of this option - i will use it.


#16

You will find the free version here: https://www.genymotion.com/fun-zone/


#17

Sorry, i meant the ionic run android command.