Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cause: buildOutput.apkData must not be null

Click Build -> Clean Project

Then Build -> Make Project

Tested on gradle 3.5.0-alpha3, -alpha5 and 3.4.0 (project gradle)

classpath 'com.android.tools.build:gradle:3.5.0-alpha03'

For Android Studio 3.5 & 3.6 Update (APK signed issue)

Step 1: I have resolved this issue by modifying the Destination Folder location.

Before

c:\user\folder\project\app

After

c:\user\folder\project\apk

enter image description here

For Android Studio 3.4 Update.

Step 1: After update Android Studio 3.4 you need to add all the dependency that used in your module or library in your app-level build.gradle.

Step 2: Clean Project(Build > Clean Project)

Step 3: Rebuild Project(Build > Rebuild Project)

Now, Your Project will compile Perfectly.


FOR Android Studio 3.5 | 3.6

debug builds finish without any error. Creating a signed .apk leads to the same error

buildOutput.apkData must not be null

the Simple solution that I found is. During the signing of the apk after entering the signing credentials when you navigate to the next screen then it will ask for the destination folder just change the default path.

Let's assume the current destination path is

c:\user\folder\project\app

change it to

c:\user\folder\project\

then it will generate the signed apk successfully.

Android studio destination folder screenshot


I was getting this error also, when trying to "Generate Signed APK" for my release version. I tried all of the above methods, unfortunately none worked for me.

What worked, was generating first the debug signed version of the app, and then generating again the release one.

I do not know what exactly changed or what the original problem was, but it worked. I hope it will help you too, because this error is quite annoying...


Cleaning the project didn't help me but manually deleting all the auto-generated build folders in all modules helped. enter image description here