【问题标题】:ionic Erorr After add platform android添加平台android后的离子错误
【发布时间】:2018-04-10 21:32:45
【问题描述】:

您好,在我将以下代码添加到在 android studio 上工作并尝试构建 APK 的 android 项目中后,我收到了此错误。但是有一些错误。可能是因为这个错误:

add platform android

You have been opted out of telemetry. To change this, run: cordova telemetry on.
Using cordova-fetch for cordova-android@^7.0.0
Adding android project...
Creating Cordova project for the Android platform:
        Path: platforms\android
        Package: com.oneweb.otlob
        Name: otlob
        Activity: MainActivity
        Android target: android-26
Subproject Path: CordovaLib
Subproject Path: app
Android project created with cordova-android@7.0.0
Android Studio project detected
Android Studio project detected
(node:11204) UnhandledPromiseRejectionWarning: Error: Source path does not exist: resources/android/icon/drawable-hdpi-icon.png
    at updatePathInternal (c:\Users\hussien\app\platforms\android\cordova\node_modules\cordova-common\src\FileUpdater.js:145:19)
    at c:\Users\hussien\app\platforms\android\cordova\node_modules\cordova-common\src\FileUpdater.js:223:19
    at Array.forEach (<anonymous>)
    at Object.updatePaths (c:\Users\hussien\app\platforms\android\cordova\node_modules\cordova-common\src\FileUpdater.js:221:33)
    at updateIcons (c:\Users\hussien\app\platforms\android\cordova\lib\prepare.js:388:17)
    at c:\Users\hussien\app\platforms\android\cordova\lib\prepare.js:49:9
    at _fulfilled (c:\Users\hussien\app\platforms\android\cordova\node_modules\q\q.js:854:54)
    at self.promiseDispatch.done (c:\Users\hussien\app\platforms\android\cordova\node_modules\q\q.js:883:30)
    at Promise.promise.promiseDispatch (c:\Users\hussien\app\platforms\android\cordova\node_modules\q\q.js:816:13)
    at c:\Users\hussien\app\platforms\android\cordova\node_modules\q\q.js:624:44
(node:11204) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:11204) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
events.js:183
      throw er; // Unhandled 'error' event
      ^

Error: spawn npm ENOENT
    at _errnoException (util.js:1022:11)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:190:19)
    at onErrorNT (internal/child_process.js:372:16)
    at _combinedTickCallback (internal/process/next_tick.js:138:11)
    at process._tickCallback (internal/process/next_tick.js:180:9)
    at Function.Module.runMain (module.js:695:11)
    at startup (bootstrap_node.js:188:16)
    at bootstrap_node.js:609:3

请问如何解决?

【问题讨论】:

    标签: android node.js cordova ionic-framework npm


    【解决方案1】:

    你的日志显示这一行:

    UnhandledPromiseRejectionWarning: Error: Source path does not exist: resources/android/icon/drawable-hdpi-icon.png
    

    那么,resources/android/icon/drawable-hdpi-icon.png 真的存在吗?

    编辑: 要产生错误,以下是可能有帮助的解决方案: How do I debug "Error: spawn ENOENT" on node.js?

    【讨论】:

    • 是的,但很容易解决我需要知道这个Error: spawn npm ENOENT at _errnoException (util.js:1022:11) at Process.ChildProcess._handle.onexit (internal/child_process.js:190:19) at onErrorNT (internal/child_process.js:372:16) at _combinedTickCallback (internal/process/next_tick.js:138:11) at process._tickCallback (internal/process/next_tick.js:180:9) at Function.Module.runMain (module.js:695:11) at startup (bootstrap_node.js:188:16) at bootstrap_node.js:609:3
    • 要调试它,答案是:stackoverflow.com/questions/27688804/…
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2021-09-18
    • 1970-01-01
    • 1970-01-01
    • 2019-12-24
    • 2016-04-11
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多