{"id":519,"date":"2017-05-30T03:54:22","date_gmt":"2017-05-30T03:54:22","guid":{"rendered":"http:\/\/fluentreports.com\/blog\/?p=519"},"modified":"2017-05-30T03:57:59","modified_gmt":"2017-05-30T03:57:59","slug":"nativescript-2-5-and-3-0-upgrade-learning-moments","status":"publish","type":"post","link":"http:\/\/fluentreports.com\/blog\/?p=519","title":{"rendered":"NativeScript: 2.5 and 3.0 upgrade learning moments"},"content":{"rendered":"<p><a href=\"http:\/\/fluentreports.com\/blog\/wp-content\/uploads\/2017\/05\/ns-book.png\"><img loading=\"lazy\" decoding=\"async\" class=\" wp-image-520 alignright\" src=\"http:\/\/fluentreports.com\/blog\/wp-content\/uploads\/2017\/05\/ns-book.png\" alt=\"\" width=\"396\" height=\"414\" srcset=\"http:\/\/fluentreports.com\/blog\/wp-content\/uploads\/2017\/05\/ns-book.png 765w, http:\/\/fluentreports.com\/blog\/wp-content\/uploads\/2017\/05\/ns-book-287x300.png 287w, http:\/\/fluentreports.com\/blog\/wp-content\/uploads\/2017\/05\/ns-book-624x653.png 624w\" sizes=\"auto, (max-width: 396px) 100vw, 396px\" \/><\/a>Well, my son has been learning Web and NativeScript for a while and was continuing to work on NativeScript project today (Lots of cool things like GridLayouts, ListViews, Sliders).<\/p>\n<p>So he finally got to see first hand the wonderful world of fun that the new NativeScript 3.0 upgrade has caused.<\/p>\n<p>One of his requirements for his application was ability to include a picture with each data item.\u00a0 So he used my <a href=\"http:\/\/nativescript.rocks\">http:\/\/nativescript.rocks<\/a> site to find the plugins and then did a simple <strong><code>tns plugin add nativescript-imagepicker<\/code><\/strong> -- then a <strong><code>tns run android<\/code><\/strong> and got the error cannot require the <code>nativescript-imagepicker<\/code> file in the Android crash dialog.\u00a0\u00a0 So I had him do a full rebuild, then as it still doesn't work (and of course he is telling me the plugin shows in the node_modules folder on his local machine). \u00a0 So, next I have him open his packages.json file.\u00a0\u00a0 Its not present.... Hmm, so I ask him try to do a <strong><code>tns plugin add nativescript-imagepicker<\/code><\/strong> again.\u00a0 This time he saw the error about the current project does not supported <strong><span style=\"color: #ff0000;\">3.00 runtimes<\/span><\/strong>.<\/p>\n<p><span style=\"color: #339966;\"><strong>I'm like welcome to the wonderful world of 3.0 incompatibilities, high five time!\u00a0\u00a0\u00a0 You have reached the pinnacle of achievement; welcome to my world!\u00a0\u00a0 \ud83d\ude09<\/strong><\/span><\/p>\n<p>So then I explained why he was now seeing this issue; and that 3.0 is not compatible with 2.5 in several ways and all the ins and outs of why and then I said you have two choices...<\/p>\n<ol>\n<li>Upgrade to 3.0, and upgrade your plugins to 3.0 -- No guarantee all of them are 3.0 compatible, so he would need to look into that.\u00a0 Even some of my plugins I haven't had time to test on 3.0 and some aren't 3.0 compatible yet.\u00a0\u00a0\u00a0\u00a0 This is something that should have been handled better by Progress, do to the number of breaking changes and sometimes missing documentation.\u00a0\u00a0 But as the community has time, and large number of the issues are fixed by Progess; 3.x will eventually turn into a good solid release, and this will all be a bad memory...<\/li>\n<li>Stay with 2.5 and grab a older version of the plugin.<\/li>\n<\/ol>\n<p>He decided to go the safer and easier route so I showed him how to use the <strong><code>npm info naitvescript-imagepicker<\/code><\/strong> command to find the older version of the plugin.\u00a0 In most cases the last version before 3.0 is the version you want...\u00a0\u00a0 In this case 2.5.2 was the last version before 3.0.<\/p>\n<p><strong><code>npm r nativescript-imagepicker<\/code><\/strong> to make sure to delete the 3.0 version that is in his node-modules folder.\u00a0 Then we used <strong><code>tns plugin add nativescript-imagepicker@2.5.2<\/code><\/strong> and we do a <strong><code>tns platform remove<\/code><\/strong> then <strong><code>tns platform<\/code> <code>&lt;strong&gt;a&lt;\/strong&gt;dd<\/code><\/strong> again to make sure nothing was left over from the prior failed attempts.<\/p>\n<p>Of course, it wasn't as simple as that -- the developers of the imagepicker plugin has a really stupid issue that were causing building issues that I had to fix for him.\u00a0 But that is a story for another day...\u00a0 \ud83d\ude09<\/p>\n<p>But none the less it turned into a great teaching moment to improve his skill set on both CLI, NPM and NativeScript...\u00a0 And so off he goes...\u00a0 So proud, of this guy...\u00a0 Can't wait to show off some of his stuff...<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Well, my son has been learning Web and NativeScript for a while and was continuing to work on NativeScript project today (Lots of cool things like GridLayouts, ListViews, Sliders). So he finally got to see first hand the wonderful world of fun that the new NativeScript 3.0 upgrade has caused. One of his requirements for&hellip; <a class=\"more-link\" href=\"http:\/\/fluentreports.com\/blog\/?p=519\">Continue reading <span class=\"screen-reader-text\">NativeScript: 2.5 and 3.0 upgrade learning moments<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_crdt_document":"","footnotes":""},"categories":[15,1],"tags":[],"class_list":["post-519","post","type-post","status-publish","format-standard","hentry","category-nativescript","category-uncategorized","entry"],"_links":{"self":[{"href":"http:\/\/fluentreports.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/519","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/fluentreports.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/fluentreports.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/fluentreports.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/fluentreports.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=519"}],"version-history":[{"count":3,"href":"http:\/\/fluentreports.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/519\/revisions"}],"predecessor-version":[{"id":523,"href":"http:\/\/fluentreports.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/519\/revisions\/523"}],"wp:attachment":[{"href":"http:\/\/fluentreports.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=519"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/fluentreports.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=519"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/fluentreports.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=519"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}