Errors in setting up development environment.

Errors in setting up development environment.

by Sandip Jadhav -
Number of replies: 17

Hi there,

Please help me in regards to an issues I am facing while settings up development environment for Moodle Mobile2

I am following the steps mentioned in https://docs.moodle.org/dev/Setting_up_your_development_environment_for_Moodle_Mobile_2

below is the errors  I am seeing after command : "ionic state restore"

" cordova plugin add https://github.com/Tunts/WebIntent
  Caught exception:
  undefined "

Somebody please let me know the solution for this.

Thanks in advance,

Sandip

Average of ratings: -
In reply to Sandip Jadhav

Re: Errors in setting up development environment.

by Jim H -

Hi Sandip

I am having similar difficulties. I was able to build the app about a year ago following the environment set up information but I don't think that information is correct any more and hasn't been updated....I might be wrong....but haven't been able to find any information to confirm

I can't get passed the initial npm install without an error (concerning appium I think!). Can you run npm install without issue?

My environment is as follows:

Node -  0.12.7

NPM - 2.11.3

Cordova - 6.5.0

Ionic - 2.2.3

Bower - 1.8.0

Gulp - Cli version 3.9.1


Is this similar to your environment?

Can anyone confirm what the environment should be, if not the above?

Any help would be great!

Thank you

Jim

In reply to Jim H

Re: Errors in setting up development environment.

by Sandip Jadhav -

Hi Jim,

I think I have gone pass this pain of having errors related to appium. 

Initially I tried to install it with the environment settings mentioned in the doc, but I was having issues (may be same as yours) with 'npm install'. So I upgraded my environment with latest versions as below:

Node -  6.7.0

NPM -3.10.3

Cordova - 7.0.0

Rest is the same as yours.

After lots of struggle I could reach to the step - ionic state restore . and this is where I am stuck now.


Cheers,

Sandip



In reply to Sandip Jadhav

Re: Errors in setting up development environment.

by Jim H -

Hi Sandip

Thank you for your reply, it's much appreciated smile

I'll update my node and npm packages to see if I can get to the same point as you and then hopefully I can offer you some help in return!

I'm pretty sure our problems are all down to the set up environment, it would be great if someone could confirm what these should now be....alas, it's difficult to guess!

I also had to install Python to get rid of other errors....this isn't mentioned in the environment set up documentation either

Jim

In reply to Sandip Jadhav

Re: Errors in setting up development environment.

by Jim H -

Hi Sandip

I seem to have made a breakthrough and I can now build the mobile app and run it in the browser locally.

I uninstalled Node 6.10.3 and re-installed Node version 0.12.7. 

I still get an appium error when running npm install but all the other steps work without an error (even ionic state restore - webintent is downloaded without issue). I'm not sure what the appium error is yet but it looks like things are functioning so far....so maybe it's not a big issue!

My environment is as follows and seems (further testing needed!) to work:

Node  0.12.7

NPM 4.6.1

bower 1.8.0

gulp 3.9.1

Ionic 2.2.3

cordova 6.5.0

I hope this might help you!

Jim


In reply to Jim H

Re: Errors in setting up development environment.

by João Gabriel Hümmel -

Hello guys,


Got stuck at same point.

When installing ionic, it says that needs node v6.9.x.

You installed ionic first then changed node version?


My environment:

Node          6.9.1

NPM           5.0.0

bower        1.8.0

gulp            3.9.1

Ionic           2.2.3

cordova     7.0.1



In reply to João Gabriel Hümmel

Re: Errors in setting up development environment.

by Dani Palou -
Picture of Core developers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

The documentation to set up the development environment was updated on monday to adapt to latest changes, now Node 6.9.1 should be used (it might work with newer versions, but I can verify it works for 6.9.1).

What is the exact error you're getting? Which OS are you using?

Kind regards,

Dani

In reply to Sandip Jadhav

Re: Errors in setting up development environment.

by Dani Palou -
Picture of Core developers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Hello Sandip,

can you manually run the instruction that is failing to see if it works by itself? Instead of running "ionic state restore", just run:

cordova plugin add https://github.com/Tunts/WebIntent

Kind regards,

Dani

In reply to Dani Palou

Re: Errors in setting up development environment.

by João Gabriel Hümmel -

At least for me, running it mannualy gives error too.

Attached npm-debug.log when i try manually

In reply to João Gabriel Hümmel

Re: Errors in setting up development environment.

by Dani Palou -
Picture of Core developers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

That's weird, running:

cordova plugin add https://github.com/Tunts/WebIntent

shouldn't have anything to do with npm, yet your log is full of npm messages. Are you sure the log is for the instruction above?

In reply to Dani Palou

Re: Errors in setting up development environment.

by João Gabriel Hümmel -

I guess that they are using npm since 2016:
https://cordova.apache.org/announcements/2015/04/21/plugins-release-and-move-to-npm.html

Attached a printscreen when running cordova plugin add https://github.com/Tunts/WebIntent


After removing those plugins that arent working, i had to copy everything inside bower_components to www/lib otherwise a blank screen was all what i got.

Attachment terminal.png
In reply to João Gabriel Hümmel

Re: Errors in setting up development environment.

by ariyan eghbal -

Hi

I have same problem!

is there any solution for this?


My versions are:

node       : v6.9.1

npm        :  3.10.8

cordova   : 7.0.1

My npm log is attached



cordova plugin error

In reply to ariyan eghbal

Re: Errors in setting up development environment.

by João Gabriel Hümmel -

I haven't fixed it. Just removed him and anything else that give me the same error.

App is running fine and after publishing for the first time i will look to fix those plugins.

In reply to ariyan eghbal

Re: Errors in setting up development environment.

by ariyan eghbal -
Found the problem!
The problem is cordova's compatibility with these 3 plugins in the package.json : 

Solution:

Downgrade cordova to version 6.5.0 and everything will be OK (If you got errors remove plugins from "platform" directory and try again)

For documentation (Hoping admins mention these versions in the setup tutorial wiki page): 

My current working versions are:

node       :  6.9.1  (with nvm 0.33.2)

npm        :  3.10.8

cordova   : 6.5.1

ionic        : 2.2.3

gulp        :  3.9.1

bower     : 1.8.0




Best Regards

Average of ratings: Useful (1)
In reply to ariyan eghbal

Re: Errors in setting up development environment.

by João Gabriel Hümmel -

AWESOME Ariyan, it worked for me either.

Since i am using Linux I just removed ios platform from package.json and then ionic state restore worked perfectly.


Thanks and best regards.

In reply to João Gabriel Hümmel

Re: Errors in setting up development environment.

by ariyan eghbal -

Good

You're welcome

In reply to ariyan eghbal

Re: Errors in setting up development environment.

by Dani Palou -
Picture of Core developers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Thank you for posting the solution!

For now I updated the docs to force installing Cordova 6.5. I also created an issue to try to fix this:

https://tracker.moodle.org/browse/MOBILE-2141

Cheers,

Dani

In reply to Dani Palou

Re: Errors in setting up development environment.

by ariyan eghbal -

Thank you

But still we have other problems!

cloud phonegap build doesn't have the same problematic plugins!!

  • net.tunts.webintent
  • ch.ti8m.documenthandler

So at the end we need to disable these! or download the HUGE SDKs ! sad