Error compiling Ionic - Android

Asked

Viewed 642 times

1

all right? I’m having trouble compiling the APK by Ionic. I already removed Android Studio and downloaded again. But it did not work.

If I try to compile by the terminal it from 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 gives 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
  • From what I understand you have to install the SDK Build Tools. You have the Android SDK installed?

  • @Leandrosimões all right? I do have the SDK Build Tools, installed it by Android Studio 3.0

  • 1

    @Pedrodaher you have the ANDROID_HOME variable set and pointed correctly to the SDK folder?

  • @Grupocdsinformática went to do some research and I saw that it was actually pointing to an old folder. I made the change using the link [ANDROID_HOME SET] (https://stackoverflow.com/questions/19986214/setting-android-home-enviromental-variable-on-mac-os-x) and it worked! Thank you very much, I could write you a reply so I evaluate you as solution rsrs I don’t know how to use this site very well yet. Hugs.

  • @Pedrodaher Done!

1 answer

1


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

Browser other questions tagged

You are not signed in. Login or sign up in order to post.