androidkotlinmissing-dataaapt2

The data is invalid. (13) . AAPT2 . file missing


One of the autogenerated files (R file) is showing missing while building the project.

ext.kotlin_version = "1.5.0"

classpath 'com.android.tools.build:gradle:4.2.0'

compileSdkVersion 30 buildToolsVersion "30.0.2"

minSdkVersion 21 targetSdkVersion 30


Solution

  • Answer Update :

    The Antivirus was interfering and capturing the autogenerated file as false positive. Ignoring the file or Add to exception or Allowing the Program in antivirus solved the problem.