diff --git a/bramble-android/build.gradle b/bramble-android/build.gradle
index b372cf7f3d8d4a9fb88c16f41dc1aa2729e748c2..c94dc003f3fb23d9ec1106df864cd16fb88f88f4 100644
--- a/bramble-android/build.gradle
+++ b/bramble-android/build.gradle
@@ -26,6 +26,9 @@ android {
 dependencies {
 	compile project(path: ':bramble-core', configuration: 'default')
 	compile fileTree(dir: 'libs', include: '*.jar')
+
+	annotationProcessor 'com.google.dagger:dagger-compiler:2.0.2'
+
 	provided 'javax.annotation:jsr250-api:1.0'
 }
 
diff --git a/bramble-api/build.gradle b/bramble-api/build.gradle
index f1d0018e602664d0727c51f89bec899f25c6d102..bded3ab754b15bf66877a6a960550f23f100b1b0 100644
--- a/bramble-api/build.gradle
+++ b/bramble-api/build.gradle
@@ -6,7 +6,6 @@ apply plugin: 'witness'
 
 dependencies {
 	compile "com.google.dagger:dagger:2.0.2"
-	compile 'com.google.dagger:dagger-compiler:2.0.2'
 	compile 'com.google.code.findbugs:jsr305:3.0.2'
 
 	testCompile 'junit:junit:4.12'
@@ -20,11 +19,8 @@ dependencies {
 dependencyVerification {
 	verify = [
 			'com.google.dagger:dagger:84c0282ed8be73a29e0475d639da030b55dee72369e58dd35ae7d4fe6243dcf9',
-			'com.google.dagger:dagger-compiler:b74bc9de063dd4c6400b232231f2ef5056145b8fbecbf5382012007dd1c071b3',
 			'com.google.code.findbugs:jsr305:766ad2a0783f2687962c8ad74ceecc38a28b9f72a2d085ee438b7813e928d0c7',
 			'javax.inject:javax.inject:91c77044a50c481636c32d916fd89c9118a72195390452c81065080f957de7ff',
-			'com.google.dagger:dagger-producers:99ec15e8a0507ba569e7655bc1165ee5e5ca5aa914b3c8f7e2c2458f724edd6b',
-			'com.google.guava:guava:d664fbfc03d2e5ce9cab2a44fb01f1d0bf9dfebeccc1a473b1f9ea31f79f6f99',
 	]
 }
 
diff --git a/bramble-core/build.gradle b/bramble-core/build.gradle
index dfe194a316e57651fe2f2717243a28609558927c..93a6c2c946dd7ea9d5c6846f858dd9a75df9d041 100644
--- a/bramble-core/build.gradle
+++ b/bramble-core/build.gradle
@@ -1,12 +1,9 @@
-plugins {
-	id 'java'
-	id 'net.ltgt.apt' version '0.9'
-	id 'idea'
-}
-
+apply plugin: 'java'
 sourceCompatibility = 1.6
 targetCompatibility = 1.6
 
+apply plugin: 'net.ltgt.apt'
+apply plugin: 'idea'
 apply plugin: 'witness'
 
 dependencies {
@@ -15,7 +12,11 @@ dependencies {
 	compile 'com.h2database:h2:1.4.192' // This is the last version that supports Java 1.6
 	compile 'org.bitlet:weupnp:0.1.4'
 
+	apt 'com.google.dagger:dagger-compiler:2.0.2'
+
 	testCompile project(path: ':bramble-api', configuration: 'testOutput')
+
+	testApt 'com.google.dagger:dagger-compiler:2.0.2'
 }
 
 dependencyVerification {
diff --git a/bramble-j2se/build.gradle b/bramble-j2se/build.gradle
index 5b3cf67866c1cee49fdd14b8045e92a23642a119..a140432b6e2f8a60a5de7fe65b640f7bdf3e0702 100644
--- a/bramble-j2se/build.gradle
+++ b/bramble-j2se/build.gradle
@@ -2,6 +2,8 @@ apply plugin: 'java'
 sourceCompatibility = 1.7
 targetCompatibility = 1.7
 
+apply plugin: 'net.ltgt.apt'
+apply plugin: 'idea'
 apply plugin: 'witness'
 
 dependencies {
@@ -10,6 +12,8 @@ dependencies {
 	compile 'net.java.dev.jna:jna:4.4.0'
 	compile 'net.java.dev.jna:jna-platform:4.4.0'
 
+	apt 'com.google.dagger:dagger-compiler:2.0.2'
+
 	testCompile project(path: ':bramble-core', configuration: 'testOutput')
 }
 
diff --git a/briar-android/build.gradle b/briar-android/build.gradle
index d31f16b1f89843aaf98db3437c91e30cdc2728f3..da9bb4dd3c9b24eba72890909df3604fb3ba967c 100644
--- a/briar-android/build.gradle
+++ b/briar-android/build.gradle
@@ -30,6 +30,8 @@ dependencies {
 	compile 'com.github.bumptech.glide:glide:3.8.0'
 	compile 'uk.co.samuelwall:material-tap-target-prompt:1.9.2'
 
+	annotationProcessor 'com.google.dagger:dagger-compiler:2.0.2'
+
 	provided 'javax.annotation:jsr250-api:1.0'
 
 	testCompile project(path: ':bramble-core', configuration: 'testOutput')
diff --git a/briar-android/src/test/java/org/briarproject/briar/android/login/SetupActivityTest.java b/briar-android/src/test/java/org/briarproject/briar/android/login/SetupActivityTest.java
index 7841d792bfd30ef7b154b66aa1802bc42373b80b..72bffbf63c113f81c73599917e562afaf1156577 100644
--- a/briar-android/src/test/java/org/briarproject/briar/android/login/SetupActivityTest.java
+++ b/briar-android/src/test/java/org/briarproject/briar/android/login/SetupActivityTest.java
@@ -7,9 +7,6 @@ import android.support.design.widget.TextInputLayout;
 import android.widget.Button;
 import android.widget.EditText;
 
-import com.google.common.base.Strings;
-
-import org.briarproject.bramble.api.identity.AuthorConstants;
 import org.briarproject.briar.BuildConfig;
 import org.briarproject.briar.R;
 import org.briarproject.briar.android.TestBriarApplication;
@@ -35,6 +32,8 @@ import static org.briarproject.bramble.api.crypto.PasswordStrengthEstimator.QUIT
 import static org.briarproject.bramble.api.crypto.PasswordStrengthEstimator.QUITE_WEAK;
 import static org.briarproject.bramble.api.crypto.PasswordStrengthEstimator.STRONG;
 import static org.briarproject.bramble.api.crypto.PasswordStrengthEstimator.WEAK;
+import static org.briarproject.bramble.api.identity.AuthorConstants.MAX_AUTHOR_NAME_LENGTH;
+import static org.briarproject.bramble.util.StringUtils.getRandomString;
 import static org.junit.Assert.assertTrue;
 import static org.mockito.Matchers.anyString;
 import static org.mockito.Matchers.eq;
@@ -145,9 +144,7 @@ public class SetupActivityTest {
 	@Test
 	public void testNicknameUI() {
 		Assert.assertNotNull(setupActivity);
-		String longNick =
-				Strings.padEnd("*", AuthorConstants.MAX_AUTHOR_NAME_LENGTH + 1,
-						'*');
+		String longNick = getRandomString(MAX_AUTHOR_NAME_LENGTH + 1);
 		nicknameEntry.setText(longNick);
 		// Nickname should be too long
 		assertEquals(nicknameEntryWrapper.getError(),
diff --git a/briar-api/build.gradle b/briar-api/build.gradle
index 2c957a64520e5707072beb2326d6d4e6239a2624..33bc10b8cb79499104e8af12b7d84eaa3b96a4fb 100644
--- a/briar-api/build.gradle
+++ b/briar-api/build.gradle
@@ -2,8 +2,6 @@ apply plugin: 'java'
 sourceCompatibility = 1.6
 targetCompatibility = 1.6
 
-apply plugin: 'witness'
-
 dependencies {
 	compile project(path: ':bramble-api', configuration: 'default')
 }
diff --git a/briar-core/build.gradle b/briar-core/build.gradle
index 8976d7e3a5694c7a0b0ae693baea003cb94522db..6fc8e564bbd1ebcd8eee36c4a790a55a88e4198e 100644
--- a/briar-core/build.gradle
+++ b/briar-core/build.gradle
@@ -1,12 +1,9 @@
-plugins {
-	id 'java'
-	id 'net.ltgt.apt' version '0.9'
-	id 'idea'
-}
-
+apply plugin: 'java'
 sourceCompatibility = 1.6
 targetCompatibility = 1.6
 
+apply plugin: 'net.ltgt.apt'
+apply plugin: 'idea'
 apply plugin: 'witness'
 
 dependencies {
@@ -16,10 +13,14 @@ dependencies {
 	compile 'com.squareup.okhttp3:okhttp:3.8.0'
 	compile 'org.jsoup:jsoup:1.10.3'
 
+	apt 'com.google.dagger:dagger-compiler:2.0.2'
+
 	testCompile project(path: ':bramble-core', configuration: 'default')
 	testCompile project(path: ':bramble-core', configuration: 'testOutput')
 	testCompile project(path: ':bramble-api', configuration: 'testOutput')
 	testCompile 'net.jodah:concurrentunit:0.4.2'
+
+	testApt 'com.google.dagger:dagger-compiler:2.0.2'
 }
 
 dependencyVerification {
diff --git a/build.gradle b/build.gradle
index af816d45f5df1ef741390436724c737c487395ca..f022dce92f7fee8cab031a9ba5691882277685e2 100644
--- a/build.gradle
+++ b/build.gradle
@@ -11,11 +11,14 @@ buildscript {
 	repositories {
 		jcenter()
 		mavenLocal()
+		maven {
+			url "https://plugins.gradle.org/m2/"
+		}
 	}
 
 	dependencies {
 		classpath 'com.android.tools.build:gradle:2.3.3'
-		classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
+		classpath 'net.ltgt.gradle:gradle-apt-plugin:0.9'
 		classpath 'de.undercouch:gradle-download-task:3.2.0'
 		classpath files('libs/gradle-witness.jar')
 	}