Can't build Android bundle or APK

Answered

I'm using IDEA 2019.2.2 on Mac.  I'm trying to create a new release of one of my Android apps, but I can't get it to build either a bundle or APK.  I select Build->Generate Signed Bundle/APK.  If I choose "Android App Bundle" it gives this error message: "Generating signed bundle requires you to update the Android Gradle plugin to version 3.2.0 or higher."  It provides a link that says, "Close this dialog and update the plugin."  When I click, it asks me to confirm I want to upgrade.  I click Update and the dialog goes away, but nothing else happens.  I still can't build.  And if I select the Check For Updates command, it informs me, "You already have the latest version of IntelliJ IDEA and plugins installed."

As an alternative I tried telling it to build an APK.  That goes through building, but then fails with this error:

java.lang.AssertionError
at com.android.sdklib.BuildToolInfo.getPath(BuildToolInfo.java:388)
at org.jetbrains.android.exportSignedPackage.ExportSignedPackageWizard.createAndAlignApk(ExportSignedPackageWizard.java:464)
at org.jetbrains.android.exportSignedPackage.ExportSignedPackageWizard.access$1100(ExportSignedPackageWizard.java:81)
at org.jetbrains.android.exportSignedPackage.ExportSignedPackageWizard$1.run(ExportSignedPackageWizard.java:174)
at com.intellij.openapi.progress.impl.CoreProgressManager$TaskRunnable.run(CoreProgressManager.java:894)
at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:169)
at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:591)
at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:537)
at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:59)
at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:156)
at com.intellij.openapi.progress.impl.CoreProgressManager$4.run(CoreProgressManager.java:408)
at com.intellij.openapi.application.impl.ApplicationImpl$1.run(ApplicationImpl.java:294)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:834)

I tried reinstalling the IDE, updating the Android SDK, restarting, etc.  Nothing helps.

6 comments
Comment actions Permalink

I don't have a build.gradle file.  I'm using IDEA's built in build system, not gradle.

I tried going to Project Structure->Project as that link suggests, but there's nothing there about plugins or gradle.  The only options are Project Name, Project SDK, Project Language Level, and Project Compiler Output.

0
Comment actions Permalink

IntelliJ IDEA build system for Android is obsolete, please switch to the Gradle Android projects.

0
Comment actions Permalink

Is there a way to convert it automatically?  This isn't a new project.  I've been developing it continuously since 2010, and this is the first time IDEA has ever had a problem building a release.  And given that the IDEA project has years of history in it, recreating it from scratch would not be trivial.

There's also nothing in the UI saying the standard build system isn't supported anymore, or that my project needs to be recreated, or anything like that.

0
Comment actions Permalink

There is no way to convert legacy Android projects to Gradle projects automatically. You can use older IDE version as a workaround: https://www.jetbrains.com/idea/download/previous.html.

0

Please sign in to leave a comment.