2017-02-03 45 views
0

Nativescript 2.5.0版發生了什麼重大變化?Nativescript 2.5.0更新後插件安裝掛起

由於我自己的錯誤而導致。我不小心通過疏忽卸載Nativescript,並重新安裝它,使我的版本從2.4.1(我相信)到2.5.0。在這個過程中,我破壞了我的工作文件。

建立一個新的,似乎做工精細,但2.5.0帶來了,我不能安裝nativescript-plugin-firebase插件足以改變(對app/package.json文件也許)。它只是掛在開始安裝的圖片上,但沒有console.log信息,這是典型的。 See picture.,無論是通過nativescript CLI還是通過在​​文件中將其設置爲依賴項來安裝,都無需完成構建。我注意到的一件事是,tns build android會將版本更新爲2.5.0。 enter image description here

我甚至試過設置整個package.json文件是我以前使用TNS更新設置nativescript版本中使用的版本。

有沒有一種方法可以重新安裝Nativescript 2.4.1作爲我的主要安裝?

看來插件本身安裝了一切,但不是腳本文件夾中的文件。他們從不會促使我創建firebase.nativescript.json文件。

這裏是運行tns create [MYAPP] --ng 根/的package.json

{ 
    "description": "NativeScript Application", 
    "license": "SEE LICENSE IN <your-license-filename>", 
    "readme": "NativeScript Application", 
    "repository": "<fill-your-repository-here>", 
    "nativescript": { 
    "id": "org.nativescript.[MYAPP]" 
    }, 
    "dependencies": { 
    "@angular/common": "2.4.3", 
    "@angular/compiler": "2.4.3", 
    "@angular/core": "2.4.3", 
    "@angular/forms": "2.4.3", 
    "@angular/http": "2.4.3", 
    "@angular/platform-browser": "2.4.3", 
    "@angular/platform-browser-dynamic": "2.4.3", 
    "@angular/router": "3.4.3", 
    "nativescript-angular": "1.4.0", 
    "nativescript-theme-core": "~1.0.2", 
    "reflect-metadata": "~0.1.8", 
    "rxjs": "~5.0.1", 
    "tns-core-modules": "^2.4.1" 
    }, 
    "devDependencies": { 
    "nativescript-dev-android-snapshot": "^0.*.*", 
    "nativescript-dev-typescript": "~0.3.5", 
    "typescript": "~2.1.0", 
    "zone.js": "~0.7.2" 
    } 
} 

和應用程序/文件的package.json

{ 
    "android": { 
    "v8Flags": "--expose_gc" 
    }, 
    "main": "main.js", 
    "name": "tns-template-hello-world-ng", 
    "version": "2.5.0" 
} 

回答

1

的 「火力插件掛起」 的問題後,當前的package.json文件似乎被新的NativeScript 2.5 CLI絆倒,未處理firebase插件提示用戶輸入配置選項。

您可以在Github Issue上找到該插件的背景資料。

快速解決方法是在項目的根目錄下創建一個firebase.nativescript.json文件,並啓用您想要的功能。舉例來說,我只是用Android和google_auth,所以我的是這樣的:

{ 
    "using_ios": false, 
    "using_android": true, 
    "remote_config": false, 
    "messaging": false, 
    "crash_reporting": false, 
    "storage": false, 
    "facebook_auth": false, 
    "google_auth": true 
} 

一旦你創建與所需的配置這個文件,你可以愉快地運行tns plugin add nativescript-plugin-firebase,它會完成,因爲CLI不需要再次提示功能。

+0

供參考:插件的3.9.3版本可以避免這個問題。 –