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
Cleaning the project didn't help me but manually deleting all the auto-generated build folders in all modules helped.
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.
Manually delete all the exiting build variant folder as well build folder in project folder worked for me.
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.