无法在离子Cordova上构建apk,同样的错误一次又一次地出现。 尝试从新创建的应用中构建它,即使它不起作用。
ionic cordova run android
[INFO] Hardware device(s) found for android. Using --device.
> ionic-app-scripts.cmd build --target cordova --platform android
ionic-app-scripts 3.2.4
build dev started ...
typescript error
Argument for '--lib' option must be: 'es5', 'es6', 'es2015', 'es7', 'es2016', 'es2017', 'esnext', 'dom',
'dom.iterable', 'webworker', 'scripthost', 'es2015.core', 'es2015.collection', 'es2015.generator',
'es2015.iterable', 'es2015.promise', 'es2015.proxy', 'es2015.reflect', 'es2015.symbol',
'es2015.symbol.wellknown', 'es2016.array.include', 'es2017.object', 'es2017.sharedmemory', 'es2017.string',
'es2017.intl', 'esnext.asynciterable'.
[12:26:11] ionic-app-script task: "build"
[12:26:11] TypeError: Cannot read property 'replace' of null
TypeError: Cannot read property 'replace' of null
at Object.escapeHtml (C:\Users\admin\AppData\Roaming\npm\node_modules\@ionic\app-scripts\dist\util\helpers.js:253:10)
at generateCodeBlock (C:\Users\admin\AppData\Roaming\npm\node_modules\@ionic\app-scripts\dist\logger\logger-diagnostics.js:187:77)
at generateDiagnosticHtml (C:\Users\admin\AppData\Roaming\npm\node_modules\@ionic\app-scripts\dist\logger\logger-diagnostics.js:179:12)
at Array.map (<anonymous>)
at Object.printDiagnostics (C:\Users\admin\AppData\Roaming\npm\node_modules\@ionic\app-scripts\dist\logger\logger-diagnostics.js:15:39)
at getTsConfig (C:\Users\admin\AppData\Roaming\npm\node_modules\@ionic\app-scripts\dist\transpile.js:322:34)
at Object.<anonymous> (C:\Users\admin\AppData\Roaming\npm\node_modules\@ionic\app-scripts\dist\transpile.js:298:46)
at step (C:\Users\admin\AppData\Roaming\npm\node_modules\@ionic\app-scripts\dist\transpile.js:32:23)
at Object.next (C:\Users\admin\AppData\Roaming\npm\node_modules\@ionic\app-scripts\dist\transpile.js:13:53)
at C:\Users\admin\AppData\Roaming\npm\node_modules\@ionic\app-scripts\dist\transpile.js:7:71
[ERROR] An error occurred while running subprocess ionic-app-scripts.
ionic-app-scripts.cmd build --target cordova --platform android exited with exit code 1.
Re-running this command with the --verbose flag may provide more information.