运行android app时出错 - 离子

时间:2017-11-15 05:07:24

标签: android ionic-framework ionic3

我在运行应用程序时遇到问题...我想在我的Android手机中使用GPS测试位置,但我不能,......仅此而已。

这是我的离子信息

max(to_date(from_unixtime(unix_timestamp(b.Date,'MM-dd-yyyy')))

1

cli packages: (/usr/local/lib/node_modules)

    @ionic/cli-utils  : 1.18.0
    ionic (Ionic CLI) : 3.18.0

global packages:

    cordova (Cordova CLI) : 7.1.0

local packages:

    @ionic/app-scripts : 3.1.2
    Cordova Platforms  : android 6.2.3
    Ionic Framework    : ionic-angular 3.9.2

System:

    Node  : v7.0.0
    npm   : 3.10.8
    OS    : macOS Sierra
    Xcode : Xcode 8.3.2 Build version 8E2002

Environment Variables:

    ANDROID_HOME : not set

Misc:

    backend : pro

这是错误:

错误:

ionic cordova run android --prod

app.module.ts,我想测试位置,但我不能,有位置的库和调用webservice的服务

./src/app/main.ts
Module not found: Error: Can't resolve './app.module.ngfactory' in '/Users/eliascanaza/Documents/www/ionic/yofood/src/app'
resolve './app.module.ngfactory' in '/Users/eliascanaza/Documents/www/ionic/yofood/src/app'
  using description file: /Users/eliascanaza/Documents/www/ionic/yofood/package.json (relative path: ./src/app)
    Field 'browser' doesn't contain a valid alias configuration
  after using description file: /Users/eliascanaza/Documents/www/ionic/yofood/package.json (relative path: ./src/app)
    using description file: /Users/eliascanaza/Documents/www/ionic/yofood/package.json (relative path: ./src/app/app.module.ngfactory)
      no extension
        Field 'browser' doesn't contain a valid alias configuration
        /Users/eliascanaza/Documents/www/ionic/yofood/src/app/app.module.ngfactory doesn't exist
      .ts
        Field 'browser' doesn't contain a valid alias configuration
        /Users/eliascanaza/Documents/www/ionic/yofood/src/app/app.module.ngfactory.ts doesn't exist
      .js
        Field 'browser' doesn't contain a valid alias configuration
        /Users/eliascanaza/Documents/www/ionic/yofood/src/app/app.module.ngfactory.js doesn't exist
      .json
        Field 'browser' doesn't contain a valid alias configuration
        /Users/eliascanaza/Documents/www/ionic/yofood/src/app/app.module.ngfactory.json doesn't exist
      as directory
        /Users/eliascanaza/Documents/www/ionic/yofood/src/app/app.module.ngfactory doesn't exist
[/Users/eliascanaza/Documents/www/ionic/yofood/src/app/app.module.ngfactory]
[/Users/eliascanaza/Documents/www/ionic/yofood/src/app/app.module.ngfactory.ts]
[/Users/eliascanaza/Documents/www/ionic/yofood/src/app/app.module.ngfactory.js]
[/Users/eliascanaza/Documents/www/ionic/yofood/src/app/app.module.ngfactory.json]
[/Users/eliascanaza/Documents/www/ionic/yofood/src/app/app.module.ngfactory]
 @ ./src/app/main.ts 2:0-60
    at new BuildError (/Users/eliascanaza/Documents/www/ionic/yofood/node_modules/@ionic/app-scripts/dist/util/errors.js:16:28)
    at callback (/Users/eliascanaza/Documents/www/ionic/yofood/node_modules/@ionic/app-scripts/dist/webpack.js:121:28)
    at emitRecords.err (/Users/eliascanaza/Documents/www/ionic/yofood/node_modules/webpack/lib/Compiler.js:269:13)
    at Compiler.emitRecords (/Users/eliascanaza/Documents/www/ionic/yofood/node_modules/webpack/lib/Compiler.js:375:38)
    at emitAssets.err (/Users/eliascanaza/Documents/www/ionic/yofood/node_modules/webpack/lib/Compiler.js:262:10)
    at applyPluginsAsyncSeries1.err (/Users/eliascanaza/Documents/www/ionic/yofood/node_modules/webpack/lib/Compiler.js:368:12)
    at next (/Users/eliascanaza/Documents/www/ionic/yofood/node_modules/tapable/lib/Tapable.js:218:11)
    at Compiler.compiler.plugin (/Users/eliascanaza/Documents/www/ionic/yofood/node_modules/webpack/lib/performance/SizeLimitsPlugin.js:99:4)
    at Compiler.applyPluginsAsyncSeries1 (/Users/eliascanaza/Documents/www/ionic/yofood/node_modules/tapable/lib/Tapable.js:222:13)
    at Compiler.afterEmit (/Users/eliascanaza/Documents/www/ionic/yofood/node_modules/webpack/lib/Compiler.js:365:9)

所以,我需要你的帮助......有什么不对?非常感谢!

2 个答案:

答案 0 :(得分:0)

angular CLI报告了类似问题。请尝试以下步骤

  1. 将角度CLI升级到最新版本npm install @angular/cli并进行构建
  2. 如果仍然不能正常运行npm i enhanced-resolve@3.3.0

答案 1 :(得分:0)

它说**错误:无法解析'./app.module.ngfactory'**

1.检查你的main.ts文件,它应该有import { AppModule } from './app.module';,而不是app.module.ngfactory。

2.首先使用Ionic Serve确保您的应用无误地运行,并检查控制台是否存在任何特定于应用的错误。