Has anyone been able to get the Httpd plugin to work with Ionic v4? I’ve tried to add it into my project in various ways and when I fire up either an iOS or Android device for testing, I get the following console messages whenever it tries to start the Httpd Web server service:
Native: tried calling Httpd.startServer, but the Httpd plugin is not installed.
[ng] [console.warn]: Install the Httpd plugin: ‘ionic cordova plugin add cordova-plugin-httpd’
That plugin is installed. I’ve done the following:
npm install @ionic-native/httpd@latest --save
ionic cordova plugin add cordova-plugin-http --save
I even created a fresh project using Ionic Studio and used Ionic Studio to add iOS and Android as platforms and then used the plugin manager to add the Httpd plugin. I then built the ionic project and ran ionic cap sync to synrchonize my build with my platform folders.
When I connect an Android device or load the app using iOS over Ionic DevApp, I get the error message shown above.
I’m trying to invoke the server with the sample code from the Ionic Native v4 page for the Httpd plugin:
let options: HttpdOptions = { www_root: 'httpd_root', // relative path to app's www directory port: 80, localhost_only: false }; this.httpd.startServer(options).subscribe((data) => { console.log('Server is live'); });
My blank page for my test project loads normally and there are no other errors or warnings. It’s just that no matter what I try, I always end up with ionic telling me in the log output for devices connected a variety of ways that the cordova httpd plugin isn’t installed.