2016-08-20 33 views
0

檢查NativeScript。 創建示例android應用程序。沒有添加新文件。 只是改變顏色NativeScript示例應用程序僅需2.36秒即可查看簡單更改

<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和msg我重建。

我是否運行錯誤的命令只是爲了看到更改?

使用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. 

回答

1

您使用角+ NativeScript任何機會,如果是緩慢的構建是由於的JavaScript文件量角2個附帶。爲了使{N}完全直接訪問本地API,它將解析任何JavaScript文件並在構建時查找這些調用。如果node_modules或app文件夾中有很多js文件,這當然會導致構建速度變慢。

NativeScript repo上有一個關於此問題的github問題,在那裏有很多關於團隊如何處理這個問題的想法,但它仍然在進行中,而且Angular 2還沒有發佈,因此敬請期待。

+0

@ ladimir-amiorkov,謝謝。停止工作。展望另一種選擇。 – Pirzada

相關問題