Error compiling ionic - Android

1

Alright? I'm having trouble compiling APK for ionic. I already removed Android Studio and downloaded it again. But it did not work.

If I try to compile the terminal for the error, but if I import the gradle project to Android Studio it compiles and the APP works perfectly, but this process takes a long time. See the error that occurs when running "ionic cordova build android"

Running command - failed![ERROR] An error occurred while running cordova build android (exit code 1):

    (truncated) ... figure(DefaultBuildConfigurer.java:38)
        at 
    org.gradle.initialization.DefaultGradleLauncher$1.execute(DefaultGradleLauncher.java:161)
        at 
    org.gradle.initialization.DefaultGradleLauncher$1.execute(DefaultGradleLauncher.java:158)
        at org.gradle.internal.Transformers$4.transform(Transformers.java:169)
        at 
    org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:106)
        at 
    org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:56)
        at 
    org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:158)
        at 
    org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:119)
        at 
    org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:102)
        at 
    org.gradle.launcher.exec.GradleBuildController.run(GradleBuildController.java:71)
        at 
    org.gradle.tooling.internal.provider.ExecuteBuildActionRunner.run(ExecuteBuildActionRunner.java:28)
        at 
    org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
        at 
    org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:41)
        at 
    org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:26)
        at 
    org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:75)
        at 
    org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:49)
        at 
    org.gradle.tooling.internal.provider.ServicesSetupBuildActionExecuter.execute(ServicesSetupBuildActionExecuter.java:44)
        at 
    org.gradle.tooling.internal.provider.ServicesSetupBuildActionExecuter.execute(ServicesSetupBuildActionExecuter.java:29)
        at 
    org.gradle.launcher.daemon.server.exec.ExecuteBuild.doBuild(ExecuteBuild.java:67)
        at 
    org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
        at 
    org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
        at 
    org.gradle.launcher.daemon.server.exec.WatchForDisconnection.execute(WatchForDisconnection.java:47)
        at 
    org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
        at 
    org.gradle.launcher.daemon.server.exec.ResetDeprecationLogger.execute(ResetDeprecationLogger.java:26)
        at 
    org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
        at 
    org.gradle.launcher.daemon.server.exec.RequestStopIfSingleUsedDaemon.execute(RequestStopIfSingleUsedDaemon.java:34)
        at 
    org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
        at 
    org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:74)
        at 
    org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:72)
        at org.gradle.util.Swapper.swap(Swapper.java:38)
        at 
    org.gradle.launcher.daemon.server.exec.ForwardClientInput.execute(ForwardClientInput.java:72)
        at 
    org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
        at 
    org.gradle.launcher.daemon.server.exec.LogAndCheckHealth.execute(LogAndCheckHealth.java:55)
        at 
    org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
        at 
    org.gradle.launcher.daemon.server.exec.LogToClient.doBuild(LogToClient.java:60)
        at 
    org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
        at 
    org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
        at 
    org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment.doBuild(EstablishBuildEnvironment.java:72)
        at 
    org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
        at 
    org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
        at 
    org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy$1.run(StartBuildOrRespondWithBusy.java:50)
        at 
    org.gradle.launcher.daemon.server.DaemonStateCoordinator$1.run(DaemonStateCoordinator.java:297)
        at 
    org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:54)
        at 
    org.gradle.internal.concurrent.StoppableExecutorImpl$1.run(StoppableExecutorImpl.java:40)
        at 
    java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at 
    java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at java.lang.Thread.run(Thread.java:748)

    FAILURE: Build failed with an exception.

    * Where:
    Script 
    '/Users/pedrodaher/iConexBaixa/platforms/android/CordovaLib/cordova.gradle' 
    line: 64

    * What went wrong:
    A problem occurred evaluating root project 'android'.
    > No installed build tools found. Install the Android build tools 
    version 19.1.0 or higher.

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

Ionic info:

cli packages: (/ usr / local / lib / node_modules)

  • @ ionic / cli-utils: 1.13.0
  • ionic (Ionic CLI): 3.13.0

global packages:

  • Cordova (Cordova CLI): 7.0.1

local packages:

  • @ ionic / app-scripts: 3.0.0
  • Cordova Platforms: android 6.2.3 ios 4.4.0
  • Ionic Framework: ionic-angular 3.7.1

System:

  • ios-deploy: 1.9.2
  • Node: v6.11.0
  • npm: 5.3.0
  • OS: macOS Sierra
  • Xcode: Xcode 9.0 Build version 9A235

Misc:

  • backend: legacy
asked by anonymous 09.11.2017 / 12:34

1 answer

1

Your ANDROID_HOME folder is probably pointing to a folder that does not exist. Check the folder path, if set, or if you do not create the variable and point to the SDK folder.

    
09.11.2017 / 13:50