Cause: buildOutput.apkData must not be null

后端 未结 28 1460
再見小時候
再見小時候 2020-12-07 12:03

My android application using Kotlin is throwing this exception when I try to Run \'app\' in the emulator o in my cellphone. When I build my project it runs well, with no err

相关标签:
28条回答
  • 2020-12-07 12:28

    AS 4.0.1 (installed via snap)

    Ubuntu 18.04 lts

    configuring builds via build variant.

    Combinations of invalidate cache / build / clean etc didnt help on their own, the only thing that helped was to switch build the active build variant back to armDebug and clean / rebuild after that.

    Once I switched back to the desired variant I could build correctly.

    0 讨论(0)
  • 2020-12-07 12:29

    The solution :-

    1- Build -> Clean Project didn't help

    2-Build -> Make Project didn't help

    3- restart android studio didn't help

    4- Manually remove Build folder from app and project didn't help

    the only solution for me was to remove all old builds from destination folder

    0 讨论(0)
  • 2020-12-07 12:30

    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...

    0 讨论(0)
  • 2020-12-07 12:30

    All the solutions didn't work with me
    In my case from AndroidStudio 3.4+ update to 3.5.
    And finally I solve it by modify 'Destination Folder' to "app/build/outputs/apk"
    detail pic

    0 讨论(0)
  • 2020-12-07 12:30

    I have android studio 3.5.1 . For me below steps are worked

    1. File -> Invalidate Caches/Restart
    2. After android studio restarted click on Build -> Clean project
    3. Then Build -> Rebuild Project
    0 讨论(0)
  • 2020-12-07 12:32

    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'
    
    0 讨论(0)
提交回复
热议问题