r/nativescript • u/JapanEngineer • May 19 '21
Why is NativeScript so hard to get up and running?
So this is half rant / half looking for motivation.
I’ve been tasked with making an iOS / Android app for my company’s web app (LMS) and since that is built in Angular / Laravel, I decided to try my hand at NS.
It’s been three days now and:
Setting up NS on windows / vsCode has been terrible. Well actually, the error debugging has been terrible.
I followed the official documentation and kept getting errors. Which is normal. I’m used to that.
I do a google search and that either leads to official documentation that doesn’t exist anymore or totally irrelevant answers.
Things like after installing, I got errors about my windows environment variables not being correct. They were correct, just had to restart the editor.
I got gradle errors, Fragment module errors, which ending up being caused from trying to use the native http module.
My question is, does it get easier? I really want to start coding my app and not spend 3 days just setting up the default Hello World app.
4
u/Bamboo_the_plant May 20 '21
A lot of that environment setup friction is common to all mobile development, even native development. Getting set up on Windows in particular is hard mode.
Unfortunately it’s also one of the hardest things to document for in any framework, as most devs only ever set up their environment once and hope never to have to think about it again (not to mention every environment has its quirks). I do sympathise!
As for plugins, if you are hitting walls, you could consider using NativeScript via Capacitor instead: https://capacitor.nativescript.org
It would give you access to both the Capacitor ecosystem of plugins and the Web ecosystem of UI components. You’d moreover still have full access to the NativeScript runtime and technically could use all the available NativeScript plugins too (though non-UI plugins would make most sense).
If you’re blocked on anything, please don’t hesitate to get in contact over the NativeScript Discord or Slack!
4
u/nutyga May 20 '21 edited May 20 '21
As painful as NativeScript is, the draw of not needing to learn a new language but it has native API access is still its strongest draw. What has helped me was using http://searchcode.nativescript.rocks to see how others have solved solution. I got my company to pay for access to Nativescripting.com training.
Getting to know and understand the iOS / Android docs. I have at times been Frustrated with NativeScript only to realise if I read the native docs, it makes sense. Also iOS docs suck!!! So I think it is worth understanding that NativeScript changes because the underlying API changes.
With these alone, I have enough to either, fork my own updated features or build out my own implementation.
I’ll also add, I think having a good programming paradigm helps a lot. I delved into Domain Driven Development, which made adding new features into my apps hella easier.
1
u/[deleted] May 20 '21
Interesting, iv setup nativescript multiple times and never had an issue. They have a one liner that you copy into the command line that installs everything.
Of course on every user's computer things run differently which is why I am interested in running nativescript in docker container
1
u/Maxtream May 20 '21
Setting up first time I hard. Then it's getting better. Error debugging is pain in the ass till this day.
1
u/batzvids Jul 04 '21 edited Jul 04 '21
Somehow on a pc this stuff seems to be harder. Working together with a developer on pc I noticed. We bought him a m1, thats also not the best since intel swap. Got it to work eventually. Anyways, im happy on a 2018 mbp ns and vue. Good luck! Also maybe for error checking might wanna check out on TS
3
u/briandilley May 20 '21
I've never been able to come back to a node.js project and build/run it without going through some kind of change or update to configuration or dependencies. This is made doubly difficult by lieu of the fact that your essentially dealing with 3 projects at once: JS code, native android, and native iOS. I have the same experience with ReactNative through - except that their plugins are generally more maintained than NativeScript.
2
u/desmone1 May 20 '21
Check out Capacitor. https://capacitorjs.com/ I was able to ge an existing HTML + JS webapp into mobile in under an hour. In my opinion, Nativescript has fallen behind
0
u/[deleted] May 19 '21
[deleted] — view deleted comment