'Scala 2.12: Compile error - type PlainNioFile is not a member of package scala.reflect.io

I'm trying to compile my spark scala application and getting below error. Same code was working fine with scala 2.11 version.

I did look at this solution and tried adding scala-reflect as the dependency but still getting the same error. I do see scala-reflect is added as dependency

Can't import scala.reflect.runtime.universe

Scala version 2.12.10

[info] Non-compiled module 'compiler-bridge_2.12' for Scala 2.12.0. Compiling...
/var/folders/92/9c7h444d28x8rtcm91n0r7bc0000gq/T/sbt_97534c54/scala/ZincCompat.scala:19: error: type PlainNioFile is not a member of package scala.reflect.io
  type PlainNioFile = scala.reflect.io.PlainNioFile
                                       ^
/var/folders/92/9c7h444d28x8rtcm91n0r7bc0000gq/T/sbt_97534c54/scala/ZincCompat.scala:23: error: type mismatch;
 found   : pf.type (with underlying type scala.ZincCompat.PlainNioFile)
 required: ?{def getClass: ?}
    val f = pf.getClass.getDeclaredField("nioPath") // it's not val'd in 2.12 :-/
two errors found
[info] Attempting to fetch org.scala-sbt:compiler-bridge_2.12:1.6.0.
[warn] Unrecognized repository Scala Plugin Bundled Repository, ignoring it
[warn] Unrecognized repository Scala Plugin Bundled Repository, ignoring it
[error] (Compile / compileIncremental) Error compiling the sbt component 'compiler-bridge_2.12'


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source