Closed enchev closed 7 years ago
From @tsonevn on November 22, 2016 7:41
Hi @NgSculptor,
Try to upgrade the dependencies in your project package.json
file as following the below-attached code snippet.
{
"description": "NativeScript Application",
"license": "SEE LICENSE IN <your-license-filename>",
"readme": "NativeScript Application",
"repository": "<fill-your-repository-here>",
"nativescript": {
"id": "org.nativescript.sample3139"
},
"dependencies": {
"@angular/common": "2.1.2",
"@angular/compiler": "2.1.2",
"@angular/core": "2.1.2",
"@angular/forms": "2.1.2",
"@angular/http": "2.1.2",
"@angular/platform-browser": "2.1.2",
"@angular/platform-browser-dynamic": "2.1.2",
"@angular/router": "3.1.2",
"nativescript-angular": "1.1.3",
"nativescript-theme-core": "^0.2.1",
"reflect-metadata": "~0.1.8",
"rxjs": "5.0.0-beta.12",
"tns-core-modules": "2.4.0"
},
"devDependencies": {
"nativescript-dev-android-snapshot": "^0.*.*",
"nativescript-dev-typescript": "^0.3.2",
"typescript": "^2.0.10",
"zone.js": "~0.6.21"
}
}
Delete node_modules
, platforms
, hooks
folders and clear npm
cache npm cache clear
. Then rebuild your project with tns run android
.
Hope this helps.
From @NgSculptor on November 22, 2016 8:1
@tsonevn still getting the same error. I already tried what you have mentioned above, just copy pasted your package.json file just to be sure.
From @NgSculptor on November 22, 2016 8:31
@tsonevn I also noticed that the TS files are not longer compiled into JS files. Looks like something else is also messed up. Im using the package.json that you specified
From @NathanaelA on November 22, 2016 10:25
@tsonevn - I can confirm this issue on iOS; I don't understand the full reasons why yet.
I am using the latest TypeScript both installed as a Dev Dependency and Globally (2.0.10), and the latest ns-dev-typescript (0.3.3), along with 2.4 of Runtimes, common core, and tns command line program.
I took a project that worked perfectly in 2.3 and upgraded it to 2.4 and it seems to have issues deciding when (or if) it will build any TS in JS. Using tns run ios --emulator --watch
or tns livesync ios --emulator --watch
does not WATCH (nor appear to build) any of the TS files. Any JS I manually change does get synced, and changing the tsconfig file does cause a resync, but changing any TS files does NOT cause any rebuilding to happen.
A couple notes:
TNS ... --watch
does report Compilation complete. Watching for file changes.
so it is acting like tsc
is loaded and watching properly. (And according to ps
it is running:
501 2870 2844 0 12:27AM ttys002 12:00.62 /usr/local/bin/node --max_old_space_size=2048 /Users/mac/Source/project/node_modules/typescript/lib/tsc.js --project /Users/mac/Source/project --watch)
However, it is not doing anything.
Work around:
If I open up a second command prompt; switch to the project/app folder and then type tsc -w
it gives me the same watching message Compilation complete. Watching for file changes.
but it actually works, and see's any .ts file changes. (Same thing if I run tsc
in there, it builds the whole project properly)
More Notes
tsc
or tsc -w
works fine from inside the app folder./usr/local/bin/node --max_old_space_size=2048 /Users/mac/Source/project/node_modules/typescript/lib/tsc.js --project /Users/mac/Source/project --watch
to /usr/local/bin/node --max_old_space_size=2048 /Users/mac/Source/project/node_modules/typescript/lib/tsc.js --project /Users/mac/Source/project/app --watch
works.
(i.e. appending the /app
folder to the project path)From @NgSculptor on November 22, 2016 15:50
@NathanaelA Just to confirm, you are not having any issues with Android builds? Can you share your dependencies?
From @NathanaelA on November 22, 2016 20:19
@NgSculptor - To be honest I have NO idea if the Android LiveSync side works. Before Telerik actually created their LiveSync for NativeScript, I wrote my own (nativescript-liveedit); which is currently for only Android. I use my LiveEdit on Android exclusively because it offers many features including being considerably faster than the built in LiveSync. So I have NO idea if LiveSync on Android works, no need to use it. :-)
I haven't done any work to make it work on iOS; so I still have to use Telerik's LiveSync on iOS. But you can get around the issue if you do what I said above... This actually appears to be primarily an upstream TSC bug, not a NativeScript bug (per sey). But can be worked around by Telerik if they point it to the /app
folder.
From @NathanaelA on November 22, 2016 21:21
@NgSculptor - Which version of Node are you using. I'm using 5.11?
From @NgSculptor on November 23, 2016 0:26
@NathanaelA I am on v4.4.5, the only solution for me right now was to revert to 2.3.0
From @NathanaelA on November 23, 2016 2:35
Hmm, I also tested the current 6.9.1, didn't make a difference... I'm not sure why TSC doesn't want to work properly. Fortunately the workaround I listed does work in 2.4, a bit of an annoyance...
From @tsonevn on November 24, 2016 14:29
Hi @NgSculptor ,
I research further this problem and found that this problem could be caused due to haveing nativescript-imagepicker
and nativescript-telerik-ui
plugins in the same time in your project. The image picker plugin has a dependency for nativescript-telerik-ui
, because RadListView
component has been used in the plugin. Regarding to that, could you verify, whether removing `nativescript-imagepicker
will resolve your problem with building the application for android. We will investigate this problem deeper and will provide possible solution for using the both plugin in the same time. You should also upgrade the dependencies in your example by following the given code snippet from my previous comment.
Regards, @tsonevn
From @NathanaelA on November 25, 2016 4:15
Actually I ran into another reason which I posted on my blog; when I have a few more minutes I'll try and detail the reason it was broken for me here...
Conflict between nativescript-imagepicker
and nativescript-telerik-ui-pro
already solved.
From @NgSculptor on November 22, 2016 7:31
Did you verify this is a real problem by searching [Stack Overflow]
Yes
Tell us about the problem
Build is failing on android after update
Which platform(s) does your issue occur on?
Android
Please provide the following version numbers that your issue occurs with:
This is the package.json file that I have:
Is there code involved? If so, please share the minimal amount of code needed to recreate the problem.
This is the console output
Not sure if related, but I started seeing this warning message for both ios and android
Copied from original issue: NativeScript/NativeScript#3139