diff --git a/bramble-core/build.gradle b/bramble-core/build.gradle
index 54444b2a2233157f7289bb543738ab433df13e5e..db6dad04be861dd54a3871147f205c49f4c980ac 100644
--- a/bramble-core/build.gradle
+++ b/bramble-core/build.gradle
@@ -3,7 +3,6 @@ sourceCompatibility = 1.8
 targetCompatibility = 1.8
 
 apply plugin: 'ru.vyarus.animalsniffer'
-apply plugin: 'net.ltgt.apt'
 apply plugin: 'idea'
 apply plugin: 'witness'
 apply from: 'witness.gradle'
@@ -17,7 +16,7 @@ dependencies {
 	implementation 'org.whispersystems:curve25519-java:0.5.0'
 	implementation 'org.briarproject:jtorctl:0.3'
 
-	apt 'com.google.dagger:dagger-compiler:2.19'
+	annotationProcessor 'com.google.dagger:dagger-compiler:2.19'
 
 	testImplementation project(path: ':bramble-api', configuration: 'testOutput')
 	testImplementation 'org.hsqldb:hsqldb:2.3.5' // The last version that supports Java 1.6
@@ -28,11 +27,26 @@ dependencies {
 	testImplementation "org.hamcrest:hamcrest-library:1.3"
 	testImplementation "org.hamcrest:hamcrest-core:1.3"
 
-	testApt 'com.google.dagger:dagger-compiler:2.19'
+	testAnnotationProcessor 'com.google.dagger:dagger-compiler:2.19'
 
 	signature 'org.codehaus.mojo.signature:java16:1.1@signature'
 }
 
+sourceSets.configureEach { sourceSet ->
+	tasks.named(sourceSet.compileJavaTaskName).configure {
+		options.annotationProcessorGeneratedSourcesDirectory = file("$buildDir/generated/source/apt/${sourceSet.name}")
+	}
+}
+
+idea {
+	module {
+		sourceDirs += compileJava.options.annotationProcessorGeneratedSourcesDirectory
+		generatedSourceDirs += compileJava.options.annotationProcessorGeneratedSourcesDirectory
+		testSourceDirs += compileTestJava.options.annotationProcessorGeneratedSourcesDirectory
+		generatedSourceDirs += compileTestJava.options.annotationProcessorGeneratedSourcesDirectory
+	}
+}
+
 // needed to make test output available to bramble-java
 configurations {
 	testOutput.extendsFrom(testCompile)
diff --git a/bramble-java/build.gradle b/bramble-java/build.gradle
index 8825b1b5907a60534c8f51b5905ecd4f97771490..91a9b9b88948803e40c2daa420d44ed73a5d5908 100644
--- a/bramble-java/build.gradle
+++ b/bramble-java/build.gradle
@@ -2,7 +2,6 @@ apply plugin: 'java-library'
 sourceCompatibility = 1.8
 targetCompatibility = 1.8
 
-apply plugin: 'net.ltgt.apt'
 apply plugin: 'idea'
 apply plugin: 'witness'
 apply from: 'witness.gradle'
@@ -19,7 +18,7 @@ dependencies {
 	tor 'org.briarproject:tor:0.3.4.8@zip'
 	tor 'org.briarproject:obfs4proxy:0.0.7@zip'
 
-	apt 'com.google.dagger:dagger-compiler:2.19'
+	annotationProcessor 'com.google.dagger:dagger-compiler:2.19'
 
 	testImplementation project(path: ':bramble-api', configuration: 'testOutput')
 	testImplementation project(path: ':bramble-core', configuration: 'testOutput')
@@ -30,7 +29,22 @@ dependencies {
 	testImplementation "org.hamcrest:hamcrest-library:1.3"
 	testImplementation "org.hamcrest:hamcrest-core:1.3"
 
-	testApt 'com.google.dagger:dagger-compiler:2.19'
+	testAnnotationProcessor 'com.google.dagger:dagger-compiler:2.19'
+}
+
+sourceSets.configureEach { sourceSet ->
+	tasks.named(sourceSet.compileJavaTaskName).configure {
+		options.annotationProcessorGeneratedSourcesDirectory = file("$buildDir/generated/source/apt/${sourceSet.name}")
+	}
+}
+
+idea {
+	module {
+		sourceDirs += compileJava.options.annotationProcessorGeneratedSourcesDirectory
+		generatedSourceDirs += compileJava.options.annotationProcessorGeneratedSourcesDirectory
+		testSourceDirs += compileTestJava.options.annotationProcessorGeneratedSourcesDirectory
+		generatedSourceDirs += compileTestJava.options.annotationProcessorGeneratedSourcesDirectory
+	}
 }
 
 def torBinariesDir = 'src/main/resources'
diff --git a/briar-core/build.gradle b/briar-core/build.gradle
index 2c6e0f19a176d769d7fab6e7ba9b90a9b1131045..b044b804d6e0f3f0902a3a85ea84189d28f5179f 100644
--- a/briar-core/build.gradle
+++ b/briar-core/build.gradle
@@ -3,7 +3,6 @@ sourceCompatibility = 1.8
 targetCompatibility = 1.8
 
 apply plugin: 'ru.vyarus.animalsniffer'
-apply plugin: 'net.ltgt.apt'
 apply plugin: 'idea'
 apply plugin: 'witness'
 apply from: 'witness.gradle'
@@ -15,7 +14,7 @@ dependencies {
 	implementation 'com.squareup.okhttp3:okhttp:3.10.0'
 	implementation 'org.jsoup:jsoup:1.11.3'
 
-	apt 'com.google.dagger:dagger-compiler:2.19'
+	annotationProcessor 'com.google.dagger:dagger-compiler:2.19'
 
 	testImplementation project(path: ':bramble-core', configuration: 'default')
 	testImplementation project(path: ':bramble-core', configuration: 'testOutput')
@@ -28,7 +27,22 @@ dependencies {
 	testImplementation "org.hamcrest:hamcrest-library:1.3"
 	testImplementation "org.hamcrest:hamcrest-core:1.3"
 
-	testApt 'com.google.dagger:dagger-compiler:2.19'
+	testAnnotationProcessor 'com.google.dagger:dagger-compiler:2.19'
 
 	signature 'org.codehaus.mojo.signature:java16:1.1@signature'
 }
+
+sourceSets.configureEach { sourceSet ->
+	tasks.named(sourceSet.compileJavaTaskName).configure {
+		options.annotationProcessorGeneratedSourcesDirectory = file("$buildDir/generated/source/apt/${sourceSet.name}")
+	}
+}
+
+idea {
+	module {
+		sourceDirs += compileJava.options.annotationProcessorGeneratedSourcesDirectory
+		generatedSourceDirs += compileJava.options.annotationProcessorGeneratedSourcesDirectory
+		testSourceDirs += compileTestJava.options.annotationProcessorGeneratedSourcesDirectory
+		generatedSourceDirs += compileTestJava.options.annotationProcessorGeneratedSourcesDirectory
+	}
+}
diff --git a/build.gradle b/build.gradle
index b8c2de1aa637f47fc7fba17d822c8dbb97690122..877e866671998b87c02e0eef81b263469c17b409 100644
--- a/build.gradle
+++ b/build.gradle
@@ -28,7 +28,6 @@ buildscript {
 
 	dependencies {
 		classpath 'com.android.tools.build:gradle:3.2.1'
-		classpath 'net.ltgt.gradle:gradle-apt-plugin:0.18'
 		classpath 'ru.vyarus:gradle-animalsniffer-plugin:1.4.6'
 		classpath files('libs/gradle-witness.jar')
 	}