I am trying to run the app on Note8 device using Android Studio and facing this issue after updating the variant output Directory path inside app/build.gradle file. There are lot of similar kind of issues I have seen, but none of their solutions are working for me.
I am on Android studio 3.6.+ and note 8 device, Also the funny things is path it's showing doesn't exist currently, it is the old path for variant.output in my app/build.gradle file.
changes after which the error started:
applicationVariants.all { variant ->
variant.outputs.each { output ->
def outputDir = new File("${project.buildDir.absolutePath}/outputs/apk")
def outputFileName = "DEMO-${variant.flavorName}-Build-${versionName}.apk"
variant.packageApplicationProvider.get().outputDirectory = new File("$outputDir")
output.outputFileName = outputFileName
}
}
before changes: outputDir is the where it's showing the file is missing error.
def outputDir = new File("${project.buildDir.absolutePath}/outputs/apk/${variant.flavorName}/${variant.buildType.name}")
def outputFileName = "DEMO-${variant.flavorName}-${variant.buildType.name}-${versionName}.apk"
Things I have tried so far: I have tried clean and rebuild project, I have tried invalid cache and restart, I have tried deleting .idea, cache and .build directories, Also I have no application with the same package name already installed in my device.
Could some one suggest the possible cause and how to resolve it?