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
Updating to Android Studio 3.4.?, i get the message
Cause: buildOutput.apkData must not be null
looking for an answer i found the procedure:
Build
-> Clean Project
but it doesn´t worked, i know that this procedure will delete the content into the /build
directory but for my experience it doesn´t work in all cases, so i tried the "raw" way, deleting the directory:
/app/build/
then i rebuild the project and it worked.
I was also annoyed by the same bug. But changing my Signed apk destination from c/users/project/app to c/users/project worked for me.
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
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.
I was using Android Studio 3.5 beta 2 and I was having the exact same error but only on my release build. After trying every other solution I found, the only way I was able to compile again was to go back to Android Studio 3.4.
It works for me:
delete build folder from your project manually.
in terminal of android studio type this command
if windows user
gradlew clean build
if linux user
./gradlew clean build
Seems cleaning the project may resolve the issue, but for me it worked like this.
File->sync project with gradle files.