Cause: buildOutput.apkData must not be null

后端 未结 28 1458
再見小時候
再見小時候 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:34

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

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

    The solution for me was to delete all files and folders from the apk output folder. I had this problem when creating a signed apk for a "production" flavor and the output.json in the "feature" output folder causes the problem -> Android Studio 3.6 Canary 7 showed me the correct error message. It is also working now for AS 3.5 stable with Gradle Plugin 3.5.0.

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

    Manually delete all the exiting build variant folder as well build folder in project folder worked for me.

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

    FOR Android Studio 3.5 | 3.6

    debug builds finish without any error. During the 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 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 current destination path is

    c:\user\folder\project\app

    change it to

    c:\user\folder\project\

    then it will generate the signed apk successfully.

    0 讨论(0)
提交回复
热议问题