Cause: buildOutput.apkData must not be null

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

    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.

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

    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.

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

    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
    

    > **For Android Studio `3.4` Update.**

    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.

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

    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.

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

    It works for me:

    1. delete build folder from your project manually.

    2. in terminal of android studio type this command

    if windows user

    gradlew clean build
    

    if linux user

    ./gradlew clean build
    
    0 讨论(0)
  • 2020-12-07 12:28

    Seems cleaning the project may resolve the issue, but for me it worked like this.

    File->sync project with gradle files.

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