build ionic2应用程序失败

时间:2016-10-28 14:32:17

标签: android ionic2

我在github上有我的第一个应用程序: https://github.com/eshk12/firstApp

我正在尝试将其构建为APK文件,但它失败了。 我已经安装了android sdk,并将android平台添加到项目中。

但是我得到了那些错误,我不知道是什么问题。

D:\ionic\firstApp>Ionic build android --v2 >> log.txt
[17:17:14]  Error: Error at D:/ionic/firstApp/.tmp/pages/currency/currency.ngfactory.ts:905:40
[17:17:14]  Property 'selectCurrencyInput' does not exist on type 'CurrencyPage'.
[17:17:14]  Error at D:/ionic/firstApp/.tmp/pages/currency/currency.ngfactory.ts:1200:43
[17:17:14]  Property 'selectCurrencyInput' does not exist on type 'CurrencyPage'.
[17:17:14]  Error at D:/ionic/firstApp/.tmp/pages/currency/currency.ngfactory.ts:1215:72
[17:17:14]  Property 'selectCurrencyInput' does not exist on type 'CurrencyPage'.
[17:17:14]  ngc failed
[17:17:14]  ionic-app-script task: "build"
[17:17:14]  Error: Error

npm ERR! Windows_NT 10.0.14393
npm ERR! argv "D:\\Program Files\\nodejs\\node.exe" "D:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "build"
npm ERR! node v6.3.0
npm ERR! npm  v3.10.3
npm ERR! code ELIFECYCLE
npm ERR! ionic-app-base@ build: `ionic-app-scripts build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the ionic-app-base@ build script 'ionic-app-scripts build'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the ionic-app-base package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     ionic-app-scripts build
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs ionic-app-base
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls ionic-app-base
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     D:\ionic\firstApp\npm-debug.log
Caught exception:
 undefined

Mind letting us know? https://github.com/driftyco/ionic-cli/issues

thx求助

1 个答案:

答案 0 :(得分:1)

view中,您使用的是名为selectCurrencyInput

的媒体资源

<ion-select okText="אשר" cancelText="בטל" [(ngModel)]="selectCurrencyInput">

但未在component code中声明。

@Component({
  selector: 'currency-page',
  templateUrl: 'currency.html',
  providers: [NetworkServices]
})
export class CurrencyPage {
  public load: any;
  public results: any;
  public amount: any;
  public keys: any;

  public selectCurrencyInput: string; // <- add this property to fix the issue

  constructor(public networkServices: NetworkServices) {
    this.load = false;
  }

  // ...
}