# Error when i run the comand "cordova build android"

**URL:** <https://forum.ionicframework.com/t/error-when-i-run-the-comand-cordova-build-android/97329>\
**Category:** ionic-v3\
**Created:** [July 7, 2017, 1:46pm UTC](https://forum.ionicframework.com/t/error-when-i-run-the-comand-cordova-build-android/97329 "2017-07-07T13:46:46Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Espemss](https://avatars.discourse-cdn.com/v4/letter/e/ec9cab/32.png) [@Espemss](https://forum.ionicframework.com/u/Espemss)\
**Post date:** [July 7, 2017, 1:46pm UTC](https://forum.ionicframework.com/t/error-when-i-run-the-comand-cordova-build-android/97329/1 "2017-07-07T13:46:47Z")

</div>

![image](https://global.discourse-cdn.com/ionicframework/original/3X/2/e/2e3bb4375e870f5ecc3f2418ff389c883f66883a.png)

Please I need help

---

<div class="post-metadata">

**Author:** ![Sujan12](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/sujan12/32/108395_2.png) [@Sujan12](https://forum.ionicframework.com/u/Sujan12)\
**Post date:** [July 7, 2017, 1:52pm UTC](https://forum.ionicframework.com/t/error-when-i-run-the-comand-cordova-build-android/97329/2 "2017-07-07T13:52:05Z")

</div>

I can’t see a thing. Please post the error message as text.  
(Add " \> file.txt" to log the output of the command to a file)

---

<div class="post-metadata">

**Author:** ![Espemss](https://avatars.discourse-cdn.com/v4/letter/e/ec9cab/32.png) [@Espemss](https://forum.ionicframework.com/u/Espemss)\
**Post date:** [July 7, 2017, 2:01pm UTC](https://forum.ionicframework.com/t/error-when-i-run-the-comand-cordova-build-android/97329/3 "2017-07-07T14:01:50Z")

</div>

Like that ?

Error: ./~/firebase/app/shared\_promise.js  
Module not found: Error: Can’t resolve ‘promise-polyfill’ in 'C:\Users\espem\Desktop\Universidad\Desarrollo de Apps\Practicas\node\_modules\firebase\app’  
resolve ‘promise-polyfill’ in 'C:\Users\espem\Desktop\Universidad\Desarrollo de Apps\Practicas\node\_modules\firebase\app’  
Parsed request is a module  
using description file: C:\Users\espem\Desktop\Universidad\Desarrollo de Apps\Practicas\node\_modules\firebase\package.json (relative path: ./app)  
Field ‘browser’ doesn’t contain a valid alias configuration  
after using description file: C:\Users\espem\Desktop\Universidad\Desarrollo de Apps\Practicas\node\_modules\firebase\package.json (relative path: ./app)  
resolve as module  
looking for modules in C:\Users\espem\Desktop\Universidad\Desarrollo de Apps\Practicas\node\_modules  
using description file: C:\Users\espem\Desktop\Universidad\Desarrollo de Apps\Practicas\package.json (relative path: ./node\_modules)  
Field ‘browser’ doesn’t contain a valid alias configuration  
after using description file: C:\Users\espem\Desktop\Universidad\Desarrollo de Apps\Practicas\package.json (relative path: ./node\_modules)  
using description file: C:\Users\espem\Desktop\Universidad\Desarrollo de Apps\Practicas\package.json (relative path: ./node\_modules/promise-polyfill)  
as directory  
C:\Users\espem\Desktop\Universidad\Desarrollo de Apps\Practicas\node\_modules\promise-polyfill doesn’t exist  
no extension  
Field ‘browser’ doesn’t contain a valid alias configuration  
C:\Users\espem\Desktop\Universidad\Desarrollo de Apps\Practicas\node\_modules\promise-polyfill doesn’t exist  
.ts  
Field ‘browser’ doesn’t contain a valid alias configuration  
C:\Users\espem\Desktop\Universidad\Desarrollo de Apps\Practicas\node\_modules\promise-polyfill.ts doesn’t exist  
.js  
Field ‘browser’ doesn’t contain a valid alias configuration  
C:\Users\espem\Desktop\Universidad\Desarrollo de Apps\Practicas\node\_modules\promise-polyfill.js doesn’t exist  
.json  
Field ‘browser’ doesn’t contain a valid alias configuration  
C:\Users\espem\Desktop\Universidad\Desarrollo de Apps\Practicas\node\_modules\promise-polyfill.json doesn’t exist  
[C:\Users\espem\Desktop\Universidad\Desarrollo de Apps\Practicas\node\_modules\promise-polyfill]  
[C:\Users\espem\Desktop\Universidad\Desarrollo de Apps\Practicas\node\_modules\promise-polyfill]  
[C:\Users\espem\Desktop\Universidad\Desarrollo de Apps\Practicas\node\_modules\promise-polyfill.ts]  
[C:\Users\espem\Desktop\Universidad\Desarrollo de Apps\Practicas\node\_modules\promise-polyfill.js]  
[C:\Users\espem\Desktop\Universidad\Desarrollo de Apps\Practicas\node\_modules\promise-polyfill.json]  
@ ./~/firebase/app/shared\_promise.js 37:35-62  
@ ./~/firebase/app/firebase\_app.js  
@ ./~/firebase/app.js  
@ ./~/firebase/firebase-browser.js  
@ ./src/app/app.module.ts  
@ ./src/app/main.ts

---

<div class="post-metadata">

**Author:** ![Sujan12](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/sujan12/32/108395_2.png) [@Sujan12](https://forum.ionicframework.com/u/Sujan12)\
**Post date:** [July 7, 2017, 2:12pm UTC](https://forum.ionicframework.com/t/error-when-i-run-the-comand-cordova-build-android/97329/4 "2017-07-07T14:12:07Z")

</div>

Almost. Please the whole output, also the correct one including the command your are executing. And then format it:

Use the `</>` button above the input field to format your code, command line output or error message (select the text first, then click the button or wrap it in ````` manually). Check the preview if it looks better. This will make sure your text is readable and if it recognizes the programming language it also automatically adds code syntax highlighting. Thanks.

---

<div class="post-metadata">

**Author:** ![pwespi](https://avatars.discourse-cdn.com/v4/letter/p/b3f665/32.png) [@pwespi](https://forum.ionicframework.com/u/pwespi)\
**Post date:** [July 7, 2017, 2:32pm UTC](https://forum.ionicframework.com/t/error-when-i-run-the-comand-cordova-build-android/97329/5 "2017-07-07T14:32:45Z")

</div>

Run `npm install promise-polyfill --save-exact`  
See [this issue](https://github.com/ionic-team/ionic-app-scripts/issues/1001).

---

<div class="post-metadata">

**Author:** ![Espemss](https://avatars.discourse-cdn.com/v4/letter/e/ec9cab/32.png) [@Espemss](https://forum.ionicframework.com/u/Espemss)\
**Post date:** [July 7, 2017, 2:39pm UTC](https://forum.ionicframework.com/t/error-when-i-run-the-comand-cordova-build-android/97329/6 "2017-07-07T14:39:40Z")

</div>

Another try ?

```auto
ionic cordova build android
Running app-scripts build: --iscordovaserve --externalIpRequired --nobrowser

[09:38:03] build dev started ...
[09:38:03] clean started ...
[09:38:03] clean finished in 5 ms
[09:38:03] copy started ...
[09:38:03] transpile started ...
[09:38:07] transpile finished in 3.60 s
[09:38:07] preprocess started ...
[09:38:07] deeplinks started ...
[09:38:07] deeplinks finished in 32 ms
[09:38:07] preprocess finished in 36 ms
[09:38:07] webpack started ...
[09:38:07] copy finished in 3.97 s
[WARN] Error occurred during command execution from a CLI plugin (@ionic/cli-plugin-cordova). Your plugins may be out of
       date.
Error: ./~/firebase/app/shared_promise.js
Module not found: Error: Can't resolve 'promise-polyfill' in 'C:\Users\espem\Desktop\Universidad\Desarrollo de Apps\Practicas\node_modules\firebase\app'
resolve 'promise-polyfill' in 'C:\Users\espem\Desktop\Universidad\Desarrollo de Apps\Practicas\node_modules\firebase\app'
  Parsed request is a module
  using description file: C:\Users\espem\Desktop\Universidad\Desarrollo de Apps\Practicas\node_modules\firebase\package.json (relative path: ./app)
    Field 'browser' doesn't contain a valid alias configuration
  after using description file: C:\Users\espem\Desktop\Universidad\Desarrollo de Apps\Practicas\node_modules\firebase\package.json (relative path: ./app)
    resolve as module
      looking for modules in C:\Users\espem\Desktop\Universidad\Desarrollo de Apps\Practicas\node_modules
        using description file: C:\Users\espem\Desktop\Universidad\Desarrollo de Apps\Practicas\package.json (relative path: ./node_modules)
          Field 'browser' doesn't contain a valid alias configuration
        after using description file: C:\Users\espem\Desktop\Universidad\Desarrollo de Apps\Practicas\package.json (relative path: ./node_modules)
          using description file: C:\Users\espem\Desktop\Universidad\Desarrollo de Apps\Practicas\package.json (relative path: ./node_modules/promise-polyfill)
            as directory
              C:\Users\espem\Desktop\Universidad\Desarrollo de Apps\Practicas\node_modules\promise-polyfill doesn't exist
            no extension
              Field 'browser' doesn't contain a valid alias configuration
              C:\Users\espem\Desktop\Universidad\Desarrollo de Apps\Practicas\node_modules\promise-polyfill doesn't exist
            .ts
              Field 'browser' doesn't contain a valid alias configuration
              C:\Users\espem\Desktop\Universidad\Desarrollo de Apps\Practicas\node_modules\promise-polyfill.ts doesn't exist
            .js
              Field 'browser' doesn't contain a valid alias configuration
              C:\Users\espem\Desktop\Universidad\Desarrollo de Apps\Practicas\node_modules\promise-polyfill.js doesn't exist
            .json
              Field 'browser' doesn't contain a valid alias configuration
              C:\Users\espem\Desktop\Universidad\Desarrollo de Apps\Practicas\node_modules\promise-polyfill.json doesn't exist
[C:\Users\espem\Desktop\Universidad\Desarrollo de Apps\Practicas\node_modules\promise-polyfill]
[C:\Users\espem\Desktop\Universidad\Desarrollo de Apps\Practicas\node_modules\promise-polyfill]
[C:\Users\espem\Desktop\Universidad\Desarrollo de Apps\Practicas\node_modules\promise-polyfill.ts]
[C:\Users\espem\Desktop\Universidad\Desarrollo de Apps\Practicas\node_modules\promise-polyfill.js]
[C:\Users\espem\Desktop\Universidad\Desarrollo de Apps\Practicas\node_modules\promise-polyfill.json]
 @ ./~/firebase/app/shared_promise.js 37:35-62
 @ ./~/firebase/app/firebase_app.js
 @ ./~/firebase/app.js
 @ ./~/firebase/firebase-browser.js
 @ ./src/app/app.module.ts
 @ ./src/app/main.ts`Preformatted text`

```

---

<div class="post-metadata">

**Author:** ![Espemss](https://avatars.discourse-cdn.com/v4/letter/e/ec9cab/32.png) [@Espemss](https://forum.ionicframework.com/u/Espemss)\
**Post date:** [July 7, 2017, 3:03pm UTC](https://forum.ionicframework.com/t/error-when-i-run-the-comand-cordova-build-android/97329/7 "2017-07-07T15:03:29Z")

</div>

I run this code an then i run again cordova build android and then appeard that:

```auto
[09:40:56] lint finished in 5.39 s
✖ Running command - failed!

[ERROR] Cordova encountered an error.
        You may get more insight by running the Cordova command above directly.

[ERROR] An error occurred while running cordova build android (exit code 1):

        (truncated) ... mpilationSafeguard UP-TO-DATE
        :CordovaLib:compileDebugJavaWithJavac UP-TO-DATE
        :CordovaLib:processDebugJavaRes UP-TO-DATE
        :CordovaLib:transformResourcesWithMergeJavaResForDebug UP-TO-DATE
        :CordovaLib:transformClassesAndResourcesWithSyncLibJarsForDebug UP-TO-DATE
        :CordovaLib:mergeDebugJniLibFolders UP-TO-DATE
        :CordovaLib:transformNative_libsWithMergeJniLibsForDebug UP-TO-DATE
        :CordovaLib:transformNative_libsWithSyncJniLibsForDebug UP-TO-DATE
        :CordovaLib:bundleDebug UP-TO-DATE
        :CordovaLib:preReleaseBuild UP-TO-DATE
        :CordovaLib:checkReleaseManifest
        :CordovaLib:prepareReleaseDependencies
        :CordovaLib:compileReleaseAidl UP-TO-DATE
        :CordovaLib:compileReleaseNdk UP-TO-DATE
        :CordovaLib:copyReleaseLint UP-TO-DATE
        :CordovaLib:mergeReleaseShaders UP-TO-DATE
        :CordovaLib:compileReleaseShaders UP-TO-DATE
        :CordovaLib:generateReleaseAssets UP-TO-DATE
        :CordovaLib:mergeReleaseAssets UP-TO-DATE
        :CordovaLib:mergeReleaseProguardFiles UP-TO-DATE
        :CordovaLib:packageReleaseRenderscript UP-TO-DATE
        :CordovaLib:compileReleaseRenderscript UP-TO-DATE
        :CordovaLib:generateReleaseResValues UP-TO-DATE
        :CordovaLib:generateReleaseResources UP-TO-DATE
        :CordovaLib:packageReleaseResources UP-TO-DATE
        :CordovaLib:processReleaseManifest UP-TO-DATE
        :CordovaLib:generateReleaseBuildConfig UP-TO-DATE
        :CordovaLib:processReleaseResources UP-TO-DATE
        :CordovaLib:generateReleaseSources UP-TO-DATE
        :CordovaLib:incrementalReleaseJavaCompilationSafeguard UP-TO-DATE
        :CordovaLib:compileReleaseJavaWithJavac UP-TO-DATE
        :CordovaLib:processReleaseJavaRes UP-TO-DATE
        :CordovaLib:transformResourcesWithMergeJavaResForRelease UP-TO-DATE
        :CordovaLib:transformClassesAndResourcesWithSyncLibJarsForRelease UP-TO-DATE
        :CordovaLib:mergeReleaseJniLibFolders UP-TO-DATE
        :CordovaLib:transformNative_libsWithMergeJniLibsForRelease UP-TO-DATE
        :CordovaLib:transformNative_libsWithSyncJniLibsForRelease UP-TO-DATE
        :CordovaLib:bundleRelease UP-TO-DATE
        :prepareComAndroidSupportSupportCompat2520Library UP-TO-DATE
        :prepareComAndroidSupportSupportCoreUi2520Library UP-TO-DATE
        :prepareComAndroidSupportSupportCoreUtils2520Library UP-TO-DATE
        :prepareComAndroidSupportSupportFragment2520Library UP-TO-DATE
        :prepareComAndroidSupportSupportMediaCompat2520Library UP-TO-DATE
        :prepareComAndroidSupportSupportV42520Library UP-TO-DATE
        :prepareComGoogleAndroidGmsPlayServicesBase1101Library UP-TO-DATE
        :prepareComGoogleAndroidGmsPlayServicesBasement1101Library UP-TO-DATE
        :prepareComGoogleAndroidGmsPlayServicesLocation1101Library UP-TO-DATE
        :prepareComGoogleAndroidGmsPlayServicesMaps1101Library UP-TO-DATE
        :prepareComGoogleAndroidGmsPlayServicesTasks1101Library UP-TO-DATE
        :prepareOrgApacheCordovaCordovaLib623DebugLibrary UP-TO-DATE
        :prepareDebugDependencies
        :compileDebugAidl UP-TO-DATE
        :compileDebugRenderscript UP-TO-DATE
        :generateDebugBuildConfig UP-TO-DATE
        :generateDebugResValues UP-TO-DATE
        :generateDebugResources UP-TO-DATE
        :mergeDebugResources
        Error: Failed to crunch file C:\Users\espem\Desktop\Universidad\Desarrollo de
        Apps\Practicas\platforms\android\build\intermediates\exploded-aar\com.google.android.gms\play-services-base\11.0.1\res\drawable-xxhdpi-v4\common_google_signin_btn_icon_light_normal_background.9.png
        into C:\Users\espem\Desktop\Universidad\Desarrollo de
        Apps\Practicas\platforms\android\build\intermediates\res\merged\debug\drawable-xxhdpi-v4\common_google_signin_btn_icon_light_normal_background.9.png
        :mergeDebugResources FAILED

        BUILD FAILED

        Total time: 25.985 secs

        FAILURE: Build failed with an exception.

        * What went wrong:
        Execution failed for task ':mergeDebugResources'.
        > Error: Failed to crunch file C:\Users\espem\Desktop\Universidad\Desarrollo de
        Apps\Practicas\platforms\android\build\intermediates\exploded-aar\com.google.android.gms\play-services-base\11.0.1\res\drawable-xxhdpi-v4\common_google_signin_btn_icon_light_normal_background.9.png
        into C:\Users\espem\Desktop\Universidad\Desarrollo de
        Apps\Practicas\platforms\android\build\intermediates\res\merged\debug\drawable-xxhdpi-v4\common_google_signin_btn_icon_light_normal_background.9.png

        * Try:
        Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
        Error: cmd: Command failed with exit code 1 Error output:
        FAILURE: Build failed with an exception.

        * What went wrong:
        Execution failed for task ':mergeDebugResources'.
        > Error: Failed to crunch file C:\Users\espem\Desktop\Universidad\Desarrollo de
        Apps\Practicas\platforms\android\build\intermediates\exploded-aar\com.google.android.gms\play-services-base\11.0.1\res\drawable-xxhdpi-v4\common_google_signin_btn_icon_light_normal_background.9.png
        into C:\Users\espem\Desktop\Universidad\Desarrollo de
        Apps\Practicas\platforms\android\build\intermediates\res\merged\debug\drawable-xxhdpi-v4\common_google_signin_btn_icon_light_normal_background.9.png

        * Try:
        Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

```

---

<div class="post-metadata">

**Author:** ![Sujan12](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/sujan12/32/108395_2.png) [@Sujan12](https://forum.ionicframework.com/u/Sujan12)\
**Post date:** [July 7, 2017, 3:09pm UTC](https://forum.ionicframework.com/t/error-when-i-run-the-comand-cordova-build-android/97329/8 "2017-07-07T15:09:18Z")

</div>

That is an unrelated problem, actually quite common and googling and searching the forum for parts of [quote=“Espemss, post:7, topic:97329”]  
Error: Failed to crunch file C:\Users\espem\Desktop\Universidad\Desarrollo de  
Apps\Practicas\platforms\android\build\intermediates\exploded-aar\com.google.android.gms\play-services-base\11.0.1\res\drawable-xxhdpi-v4\common\_google\_signin\_btn\_icon\_light\_normal\_background.9.png  
into C:\Users\espem\Desktop\Universidad\Desarrollo de  
Apps\Practicas\platforms\android\build\intermediates\res\merged\debug\drawable-xxhdpi-v4\common\_google\_signin\_btn\_icon\_light\_normal\_background.9.png  
:mergeDebugResources FAILED  
[/quote]

should help you find a solution. (especally the `mergeDebugResources`).
