I have this code snippet for my local notifications to work on Oreo devices.
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
NotificationChannel channel = new NotificationChannel(CHANNEL_ID,
CHANNEL_NAME,
level);
manager.createNotificationChannel(channel);
}
On my window desktop this is fine, no issues. However on my macbook, lint complains about NotificationChannel requiring SDK 26 and my min is 21. However if I change the version check to
if (Build.VERSION.SDK_INT >= 26)
the error goes away. I've tried restarting Android studio, clean/rebuild. Nothing works. When I do code inspection and use the suggested hints, its changing the Version_Code to 26. Its kinda bothering me having it act different on my 2 machines but same exact code. Anyone else seen this issue before?
compileSdkVersion = 26
buildToolsVersion = "26.0.2"
minSdkVersion = 21
targetSdkVersion = 26