I have an app which I am compiling against API level 21:
and then debug it on a real device with API level 23:
The problem is when I try debugging
I tried the solutions given here while working on an application that used Bluetooth Low Energy(BLE). I tried,
all of these failed.
What I did was debug the points where I thought I was getting the warning, I still got the warning but the application was working fine. You can disregard the warning.
Go to Project Settings > Artifacts. Select the artifact which has the problem. There is an option "Include in project build". This needs to be checked(enabled). For older versions of IntelliJ this option is "Make on build".
I had the same issue and found a solution. If you have a line flagged in red, it will give you this error, but if you un-flag all of the lines it will work normally.
by flagged I mean when you click on the left side where the line numbers are and it highlights the line.
If that is not clear here are pictures.
go from:
flagged line
to:
not flagged line