10

After I've updated Android Studio 3.4 to 3.5 and wanted to build a Signed APK, however I get the error :

Cause: buildOutput.apkData must not be null Error

I've already tried to Clean & Make the Project and to Clean & Rebuild the Project, with no success.

I am using Android Gradle 3.5.0 & Gradle Version 5.4.1

Kabir
  • 852
  • 7
  • 11
Tester2389
  • 149
  • 1
  • 12
  • Possible duplicate of [Cause: buildOutput.apkData must not be null](https://stackoverflow.com/questions/54503325/cause-buildoutput-apkdata-must-not-be-null) – 3dmg Aug 27 '19 at 09:11
  • Thank you, for your comment. However, as you can see in my post, I've already checked the Clean & Rebuild Fix – Tester2389 Aug 27 '19 at 09:37
  • I have added there another solution, which helped me today: https://stackoverflow.com/a/57670979/264750 – 3dmg Aug 27 '19 at 11:56
  • Please refer to this link **https://stackoverflow.com/questions/54503325/cause-buildoutput-apkdata-must-not-be-null/59191126#59191126** – Sachin Upreti Dec 05 '19 at 13:09

6 Answers6

20

This issue happens after update my Android studio v3.4 to v3.5 Now, it is working fine

I fixed this issue by deleting debug/output.json and release/output.json files
otherwise change your apk destination folder path.

Android Studio 3.5
compilesdkVersion 28

apk generating working
Pradeep P
  • 221
  • 1
  • 2
3

option 1 - change the destination folder of the apk generated and generate apk again.

option 2 - delete the output.json file under release folder and generate apk again.

It solved my problem. I hope it will help you too.

Win Phyoe Thu
  • 213
  • 2
  • 9
1

Manually delete the build directory and rebuild, That worked for me

Jorge Arimany
  • 5,814
  • 2
  • 28
  • 23
  • That's what 3dmg suggested, as well. I will try it out next week. – Tester2389 Aug 30 '19 at 11:38
  • 2
    Make sure you delete all the build folders - i didn't delete the app/build folder. Worked when i did (i also deleted the debug and release folders as well) – Nick Wright Sep 23 '19 at 11:32
1

I dont know why the issue was occurring but changing the

destination folder of output apk

fixed the issue.

Nadeem Iqbal
  • 2,357
  • 1
  • 28
  • 43
0

It's working on AS 3.4.2 version. I've tried everything (Clean & Make the Project and to Clean & Rebuild) and downgraded to 3.4.2 at last.

This issue might be fixed in the 3.6 release. https://androidstudio.googleblog.com/2019/07/android-studio-36-canary-5-available.html

Hemanth S. Vaddi
  • 413
  • 2
  • 5
  • 23
0

Delete the contents of the build folders (existing *.apk and output.json):-

  1. AndroidProject\app\build\outputs\apk\androidTest\debug\
  2. AndroidProject\app\build\outputs\apk\debug\
  3. AndroidProject\app\release\

And then rebuild the system by:-

File -> Sync Project with Gradle Files

nandal
  • 2,544
  • 1
  • 18
  • 23