3 Replies Latest reply on Mar 20, 2017 4:16 AM by sethup51656429

    Android build error

    sethup51656429 Level 1

      Capture.JPG

       

      whnen i try to run "phonegap platform add android"

      it gives me Command failed with exit code 1

       

      can you please help me to solve this

       

      Moderator note:

       

      Additional logging information from dup build error with exit code 1 :

       

      D:\xamp\htdocs\phonegap\backbutton>phonegap platform add android

      Adding android project...

       

       

       

       

      Creating Cordova project for the Android platform:

       

       

              Path: platforms\android

              Package: com.phonegap.helloworld

              Name: Back_Button

              Activity: MainActivity

              Android target: android-24

       

       

      Subproject Path: CordovaLib

       

       

      Android project created with cordova-android@6.0.0

       

       

      Installing "com.red_folder.phonegap.plugin.backgroundservice" for android

       

       

      ANDROID_HOME=C:\Users\sethu\AppData\Local\Android\sdk

      JAVA_HOME=C:\Program Files (x86)\Java\jdk1.8.0_11

       

       

      Subproject Path: CordovaLib

       

       

      Starting a new Gradle Daemon for this build (subsequent builds will be faster).

       

       

       

       

       

       

       

       

      FAILURE: Build failed with an exception.

       

       

      * What went wrong:

      Unable to start the daemon process.

      This problem might be caused by incorrect configuration of the daemon.

      For example, an unrecognized jvm option is used.

      Please refer to the user guide chapter on the daemon at https://docs.gradle.org/

      2.14.1/userguide/gradle_daemon.html

      Please read the following process output to find out more:

      -----------------------

      Error occurred during initialization of VM

      Could not reserve enough space for 2097152KB object heap

       

       

       

       

       

       

      * Try:

      Run with --stacktrace option to get the stack trace. Run with --info or --debug

      option to get more log output.

       

       

      Failed to install 'com.red_folder.phonegap.plugin.backgroundservice':Error: cmd:

      Command failed with exit code 1

          at ChildProcess.whenDone (D:\xamp\htdocs\phonegap\backbutton\platforms\andro

      id\cordova\node_modules\cordova-common\src\superspawn.js:169:23)

          at emitTwo (events.js:106:13)

          at ChildProcess.emit (events.js:191:7)

          at maybeClose (internal/child_process.js:877:16)

          at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)

       

       

       

       

      Error: cmd: Command failed with exit code 1

       

      Message was edited by: Kerri Shotts to add logging information from dup https://forums.adobe.com/thread/2291288

        • 1. Re: Android build error
          kerrishotts Adobe Community Professional

          Try removing all your plugins -- does the issue still occur then?

          • 2. Re: Android build error
            sethup51656429 Level 1

            No ...

            It gives

             

            D:\xamp\htdocs\phonegap>phonegap create android

             

             

            You have been opted out of telemetry. To change this, run: cordova telemetry

             

             

             

             

            Creating a new cordova project.

             

             

             

             

            Using cordova-fetch for phonegap-template-hello-world

             

             

             

             

             

             

            D:\xamp\htdocs\phonegap>cd android

             

             

            D:\xamp\htdocs\phonegap\android>phonegap platform add android

            Adding android project...

             

             

             

             

            Creating Cordova project for the Android platform:

             

             

                    Path: platforms\android

             

             

                    Package: com.phonegap.helloworld

                    Name: helloworld

                    Activity: MainActivity

                    Android target: android-24

             

             

            Subproject Path: CordovaLib

             

             

            Android project created with cordova-android@6.0.0

             

             

             

             

            ls: no such file or directory: D:\xamp\htdocs\phonegap\android\res\mipmap-*

             

             

             

            But when i added a plugin

             

             

             

             

             

             

             

            D:\xamp\htdocs\phonegap\android>phonegap plugin add https://github.com/Red-Folde

            r/bgs-sample.git

            Fetching plugin "https://github.com/Red-Folder/bgs-sample.git" via git clone

             

             

             

             

            Repository "https://github.com/Red-Folder/bgs-sample.git" checked out to git ref

            "master".

             

             

             

             

            Installing "com.red_folder.phonegap.plugin.backgroundservice.sample" for android

             

             

             

             

             

             

            Fetching plugin "https://github.com/Red-Folder/bgs-core.git" via git clone

             

             

            Repository "https://github.com/Red-Folder/bgs-core.git" checked out to git ref "

            master".

             

             

            Installing "com.red_folder.phonegap.plugin.backgroundservice" for android

             

             

             

             

            ANDROID_HOME=C:\Users\sethu\AppData\Local\Android\sdk

             

             

            JAVA_HOME=C:\Program Files (x86)\Java\jdk1.8.0_11

             

             

            Subproject Path: CordovaLib

             

             

            Starting a new Gradle Daemon for this build (subsequent builds will be faster).

             

             

             

             

             

             

            FAILURE: Build failed with an exception.

             

             

            * What went wrong:

            Unable to start the daemon process.

            This problem might be caused by incorrect configuration of the daemon.

            For example, an unrecognized jvm option is used.

            Please refer to the user guide chapter on the daemon at https://docs.gradle.org/

            2.14.1/userguide/gradle_daemon.html

            Please read the following process output to find out more:

            -----------------------

            Error occurred during initialization of VM

            Could not reserve enough space for 2097152KB object heap

             

             

             

             

             

             

            * Try:

             

             

            Run with --stacktrace option to get the stack trace. Run with --info or --debug

            option to get more log output.

             

             

            Failed to install 'com.red_folder.phonegap.plugin.backgroundservice':Error: cmd:

            Command failed with exit code 1

                at ChildProcess.whenDone (D:\xamp\htdocs\phonegap\android\platforms\android\

            cordova\node_modules\cordova-common\src\superspawn.js:169:23)

                at emitTwo (events.js:106:13)

                at ChildProcess.emit (events.js:191:7)

                at maybeClose (internal/child_process.js:877:16)

                at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)

            Error: cmd: Command failed with exit code 1

             

             

             

             

            Failed to install 'com.red_folder.phonegap.plugin.backgroundservice.sample':Erro

            r: cmd: Command failed with exit code 1

                at ChildProcess.whenDone (D:\xamp\htdocs\phonegap\android\platforms\android\

            cordova\node_modules\cordova-common\src\superspawn.js:169:23)

                at emitTwo (events.js:106:13)

                at ChildProcess.emit (events.js:191:7)

                at maybeClose (internal/child_process.js:877:16)

                at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)

             

             

             

             

             

             

            D:\xamp\htdocs\phonegap\android>phonegap plugin

            com.red_folder.phonegap.plugin.backgroundservice 2.0.0 "Background Service Plugi

            n - Core logic"

            com.red_folder.phonegap.plugin.backgroundservice.sample 2.0.0 "Background Servic

            e Plugin - Sample Background Service"

             

             

             

             

             

             

            D:\xamp\htdocs\phonegap\android>

            • 3. Re: Android build error
              sethup51656429 Level 1

              Go to Start->Control Panel->System->Advanced(tab)->Environment Variables->System Variables->New: Variable name: _JAVA_OPTIONS Variable value: -Xmx512M

               

               

              This solved my problem and i got successful build...

              thanks guys..for your time