Error when i run the comand "cordova build android"

Please I need help

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)

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

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.

Run npm install promise-polyfill --save-exact
See this issue.

1 Like

Another try ?

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`
1 Like

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

[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.

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).