0

Hello I got this error after I added the following code to my android project working on android studio and trying to build an APK. But there is some error. Maybe it is because of this error:

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

How do I fix it please?

Sujit Poudel
  • 541
  • 7
  • 19
Sayed Mohamed
  • 173
  • 1
  • 6

1 Answers1

0

You log shows this line:

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

So, does resources/android/icon/drawable-hdpi-icon.png actually exist?

Edit: To spawn error, here's the solution that might help: How do I debug "Error: spawn ENOENT" on node.js?

Sujit Poudel
  • 541
  • 7
  • 19
  • yes but it easy to solve im nee to know about this `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` – Sayed Mohamed Apr 10 '18 at 22:37
  • To debug that, here's the answer: https://stackoverflow.com/questions/27688804/how-do-i-debug-error-spawn-enoent-on-node-js – Sujit Poudel Apr 10 '18 at 22:40