PDA

View Full Version : Phonegap LiveView "server failed to start"



jmartyr
2016-01-27, 00:18
Hi all,

I'm trying to test a mobile application and can't get the LiveView working. I get the server failed to start error no matter the mobile platform I attempt to use. I followed the steps at https://www.lianja.com/resources/blog/39-coding-tips/446-a-guide-to-building-lianja-mobile-business-database-apps to set it up.

I have a phonegap account, set up an encryption key for android, etc etc. It works on one of our computers and not the other and we can't work out what we did differently!

I'm clearly missing something in the setup process, is there documentation out there on how to set up the live view?

barrymavin
2016-01-27, 01:25
Hi Joanna,

There is nothing to set as such.

When you install APaaS Developer it will install node.js and the phonegap modules. It then uses these to build the app.

"Live View" does not build the app using phonegap build it creates the necessary directory structure and files required and then runs "phonegap serve" in the required directory.

If the server failed to start you can test it manually by cd to the required directory in a command window and issue phonegap serve.

It may be a firewall issue on your machine or something else is using the port required (see the phonegap develop app on your mobile device it will tell you).

You may want to mention what operating system you are using.

jmartyr
2016-01-27, 16:10
Thanks Barry,

I'm on Windows 7, when I try that it tells me that phonegap is not the name of a command. I'm guessing something hasn't been added to PATH? I have liana\bin added but there doesn't seem to be a "phonegap" file in there.

barrymavin
2016-01-27, 21:15
During the install everything you need is installed and setup for you.

The phonegap API to work with the adobe phonegap build service is installed silently after node.js is installed (which it uses).

This is installed using:

npm install phonegap -g

It is possible your installation did not complete properly due to an unstable internet connection at the time.

jmartyr
2016-01-27, 22:53
I've installed Lianja about 4 times now and it hasn't worked so clearly it wasn't a random error during install. I ran the command you gave me and first it told me I had the wrong version of python installed. So I uninstalled my Python 3.5 and installed Python 2.7, the same version Lianja uses.

Now it's spitting back the following two issues:


C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.Cp pBuild.targets(403,5): error MSB3191: Unable to create directory "Release\obj\validation\validation.tlog\". The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters. [C:\Users\Ryan\AppData\Roaming\npm\node_modules\pho negap\node_modules\connect-phonegap\node_modules\socket.io\node_modules\socke t.io-client\node_modules\engine.io-client\node_modules\ws\node_modules\utf-8-Validate\build\validation.vcxproj]

and

C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.Cp pBuild.targets(403,5): error MSB3191: Unable to create directory "Release\obj\bufferutil\bufferutil.tlog\". The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters. [C:\Users\Ryan\AppData\Roaming\npm\node_modules\pho negap\node_modules\connect-phonegap\node_modules\socket.io\node_modules\socke t.io-client\node_modules\engine.io-client\node_modules\ws\node_modules\bufferutil\bui ld\bufferutil.vcxproj]


I had a look around the internet and it seems to be an issue with the way node.js structures its directories. I had a look through the phonegap directory tree on the computer we have with phonegap working and it doesn't seem to have "node_modules\bufferutil" or "node_modules\utf-8-validate", it goes straight from "ws" to "build". Without those folders the entire path is just barely under the Windows character limit for a folder name, with them it's just barely over.

Do you know how to get around this or why it's putting those two folders in?

barrymavin
2016-01-27, 23:09
Lianja is not using those folders. It seems you installed visual studio with PhoneGap tools and it has basically messed up any ability to install PhoneGap and node.js for use with Lianja.

In other words it's affecting your whole machine.

barrymavin
2016-01-27, 23:13
It's the path that visual studio has setup for node.js. It's too long as stated in the error messages that you are seeing.

barrymavin
2016-01-27, 23:20
It's highly likely that visual studio has custom versions of PhoneGap and node.js installed that prevent it being used by other products.

jmartyr
2016-01-28, 17:26
Yep that was it Barry, I uninstalled Visual Studio and reinstalled Lianja and now everything works. Thanks.