First of all, after upgrading there are a few changes to gradle.
Its important to upgrade to the latest gradle version to fix that.
That means that you need to add the proper version for your build gradle which is currently
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0'
}
the next step is to remove your android-apt
which is not longer needed.
its enough to have only apply plugin: 'com.android.application'
Onec you have done that, change your dependencies from
compile
to implementation
, apt
to annotationProcessor
and testCompile
to androidTestImplementation
If you have done that invalidate your cache and restart which is very important.
Then it should work.
You can find a working gradle file using the latest version at
app build.gradle and project build.gradle
p/s : For many people still use Realm old version,
Please update to latest version since old version still use "android-apt".