NativeScript 示例应用程序需要 2.36 秒才能看到简单的更改

NativeScript Sample App takes 2.36 seconds just to see simple changes

正在检查 NativeScript。 仅创建示例 android 应用程序。没有添加新文件。 只是改变颜色

<color name="ns_primary">#2196F3</color>    
<color name="ns_primaryDark">#1565C0</color>

和 运行 tns run android 需要 Total time: 2 mins 26.62 secs 才能看到我的更改。因为 livesync 不能为 app\App_Resources\Android\values\colors.xml 工作,请告诉我重建。

我 运行 错误的命令只是为了查看更改吗?

使用Microsoft Android Emulator

λ tns run android
Executing before-prepare hook from E:\Development\Mobile\NativeScript\todo-app\hooks\before-prepare\nativescript-dev-typescript.js
Found peer TypeScript 1.8.10
Project successfully prepared (android)

:config phase:  createDefaultIncludeFiles
        +found plugins: tns-core-modules-widgets

:config phase:  createPluginsConfigFile
         Creating product flavors include.gradle file in E:\Development\Mobile\NativeScript\todo-app\platforms\android/configurations folder...

:config phase:  pluginExtend
        +applying configuration from: E:\Development\Mobile\NativeScript\todo-app\platforms\android\configurations\include.gradle
        +applying configuration from: E:\Development\Mobile\NativeScript\todo-app\platforms\android\configurations\tns-core-modules-widgets\include.gradle

:config phase:  copyAarDependencies

:config phase:  addAarDependencies
        +adding dependency: E:\Development\Mobile\NativeScript\todo-app\platforms\android\libs\aar\widgets-release.aar
Observed package id 'system-images;android-15;default;armeabi-v7a' in inconsistent location 'E:\Libraries\android-sdk-windows\system-images\android-15\armeabi-v7a' (Expected 'E:\Libraries\android-sdk-windows\system-images\android-15\default\armeabi-v7a')
Observed package id 'system-images;android-19;default;armeabi-v7a' in inconsistent location 'E:\Libraries\android-sdk-windows\system-images\android-19\armeabi-v7a' (Expected 'E:\Libraries\android-sdk-windows\system-images\android-19\default\armeabi-v7a')
Observed package id 'system-images;android-23;default;armeabi-v7a' in inconsistent location 'E:\Libraries\android-sdk-windows\system-images\android-23\armeabi-v7a' (Expected 'E:\Libraries\android-sdk-windows\system-images\android-23\default\armeabi-v7a')
Incremental java compilation is an incubating feature.
:preBuild UP-TO-DATE
:preF0DebugBuild UP-TO-DATE
:checkF0DebugManifest
:preF0ReleaseBuild UP-TO-DATE
:prepareComAndroidSupportAnimatedVectorDrawable2340Library UP-TO-DATE
:prepareComAndroidSupportAppcompatV72340Library UP-TO-DATE
:prepareComAndroidSupportSupportV42340Library UP-TO-DATE
:prepareComAndroidSupportSupportVectorDrawable2340Library UP-TO-DATE
:prepareTodoappRuntimeUnspecifiedLibrary UP-TO-DATE
:prepareWidgetsReleaseLibrary UP-TO-DATE
:prepareF0DebugDependencies
:compileF0DebugAidl UP-TO-DATE
:compileF0DebugRenderscript UP-TO-DATE
:generateF0DebugBuildConfig UP-TO-DATE
:cleanLocalAarFiles
:ensureMetadataOutDir
:collectAllJars
:setProperties
:asbg:generateInterfaceNamesList
:asbg:runAstParser
inputDir: E:\Development\Mobile\NativeScript\todo-app\platforms\android\src\main\assets\app
                                                                                            outFile: ../bindings.txt
                                                                                              :asbg:generateBindings
:mergeF0DebugShaders UP-TO-DATE
:compileF0DebugShaders UP-TO-DATE
:generateF0DebugAssets UP-TO-DATE
:mergeF0DebugAssets
:generateF0DebugResValues UP-TO-DATE
:generateF0DebugResources UP-TO-DATE
:mergeF0DebugResources
:processF0DebugManifest UP-TO-DATE
:processF0DebugResources
:generateF0DebugSources
:incrementalF0DebugJavaCompilationSafeguard UP-TO-DATE
:compileF0DebugJavaWithJavac UP-TO-DATE
:compileF0DebugNdk UP-TO-DATE
:compileF0DebugSources UP-TO-DATE
:buildMetadata UP-TO-DATE
:prePackageMarkerForF0Debug
:transformClassesWithDexForF0Debug UP-TO-DATE
:mergeF0DebugJniLibFolders UP-TO-DATE
:transformNative_libsWithMergeJniLibsForF0Debug UP-TO-DATE
:processF0DebugJavaRes UP-TO-DATE
:transformResourcesWithMergeJavaResForF0Debug UP-TO-DATE
:validateDebugSigning
:packageF0Debug
:zipalignF0Debug
:assembleF0Debug
:assembleDebug
:buildapk

BUILD SUCCESSFUL

Total time: 2 mins 26.62 secs
Project successfully built
Successfully deployed on device with identifier 'xxx.xxx.xx.xxx:5555'.
JS: Angular 2 is running in the development mode. Call enableProdMode() to enable the production mode.

您是否有机会使用 Angular + NativeScript,如果是这样,构建缓慢是由于 JavaScript 文件的数量 Angular 2 附带。为了让 {N} 提供对本机 API 的完全直接访问,它会解析任何 JavaScript 文件并在构建期间查找此类调用。如果您的 node_modules 或应用程序文件夹中有很多 js 文件,这当然会导致构建速度变慢。

NativeScript repo 上记录了一个 github 问题,那里有很多关于团队如何处理这个问题的想法,但它仍在进行中 Angular 2未发布,敬请期待