My build.gradle:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.kotlin_version = '1.1.3-2'
ext.realm_version = '3.7.2'
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
classpath 'com.google.gms:google-services:3.1.0'
classpath "io.realm:realm-gradle-plugin:$realm_version"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
maven { url "https://maven.google.com" }
maven { url 'https://dl.bintray.com/jetbrains/anko' }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
repositories {
mavenCentral()
}
My app/build.gradle
buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'io.fabric.tools:gradle:1.+'
}
}
apply plugin: 'com.android.application'
apply plugin: 'kotlin-kapt'
apply plugin: 'kotlin-android'
apply plugin: 'io.fabric'
apply plugin: 'realm-android'
realm {
syncEnabled = true;
}
repositories {
maven { url 'https://maven.fabric.io/public' }
mavenCentral()
}
android {
compileSdkVersion 26
buildToolsVersion "25.0.3"
dexOptions {
jumboMode = true
}
defaultConfig {
applicationId "com.my.project"
minSdkVersion 15
targetSdkVersion 23
versionCode 54
versionName "1.3.54"
multiDexEnabled true
}
}
def AAVersion = '4.3.1'
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:26.1.0'
compile('com.crashlytics.sdk.android:crashlytics:2.6.0#aar') {
transitive = true;
}
compile('com.digits.sdk.android:digits:1.11.0#aar') {
transitive = true;
}
compile 'com.android.support:multidex:1.0.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.android.volley:volley:1.0.0'
compile 'com.baoyz.swipemenulistview:library:1.3.0'
compile 'com.google.android.gms:play-services-gcm:11.0.4'
compile 'com.google.code.gson:gson:2.7'
compile 'com.miguelcatalan:materialsearchview:1.4.0'
compile 'com.squareup.okhttp:okhttp-urlconnection:2.7.3'
compile 'com.squareup.okhttp:okhttp:2.7.3'
compile 'com.theartofdev.edmodo:android-image-cropper:2.2.5'
compile 'commons-codec:commons-codec:1.9'
compile 'commons-io:commons-io:2.4'
compile 'io.realm:android-adapters:2.0.0'
compile 'org.apache.commons:commons-lang3:3.4'
compile 'org.apache.httpcomponents:httpcore:4.4.4'
compile 'org.apache.httpcomponents:httpmime:4.3.6'
compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
compile 'us.feras.mdv:markdownview:1.1.0'
compile 'org.jetbrains.anko:anko-sdk15:0.9.1'
compile "org.androidannotations:androidannotations-api:$AAVersion"
// for annotaions
kapt "io.realm:realm-android-library:$realm_version"
kapt "org.androidannotations:androidannotations:$AAVersion"
compile 'com.firebaseui:firebase-ui-auth:2.3.0'
compile 'com.google.firebase:firebase-auth:11.0.4'
compile "com.android.support:design:26.1.0"
compile "com.android.support:customtabs:26.1.0"
compile "com.android.support:cardview-v7:26.1.0"
testCompile 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'
When I build I get error:
Error:Execution failed for task ':app:processDevGoogleServices'.
> File google-services.json is missing. The Google Services Plugin cannot function without it.
Searched Location:
com\my_project\app\src\dev\google-services.json
com\my_project\\app\google-services.json
OK.In Android Studio select menu: Tools->Friebase
Firebase-> Authentification
Click on Email and password authentification
Connect to your app to Firebase
and get error:
Could not parse the Android Application module
I've just resolve this problem.
I was upgrading the old GCM to FCM, and the Firebase Assistant shows the same error message as yours.
Solved by:
Go to Firebase console, in the Settings of my project, download google-servics.json to app/ folder. (Replace my old GCM's json file)
doing Add Firebase to your app again,
Then I can use the Firebase Assistans of AndroidStudio, again.
For me, the issue was classpath 'com.google.gms:google-services:4.3.0' was giving error, then I changed to classpath 'com.google.gms:google-services:4.2.0', resync'd Project with Gradle Files', then pressed Connect to firebase, :D
You might want to try 'Sync Project with Gradle Files'.
Sometimes I forget to sync the implementations after adding them to the gradle file.
Related
My project was working. But when I tried to open the project, android studio gave error:
Could not find method compile() for arguments [com.google.gms:google-services:4.2.0] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.
Project gradle file are like below:
buildscript {
ext.kotlin_version = '1.2.61'
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.4'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
compile 'com.google.gms:google-services:4.2.0'
}
}
allprojects {
repositories {
google()
jcenter()
maven{url 'https://jitpack.io'}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
App gradle file are like below:
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.asnus.moviefinder"
minSdkVersion 19
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
compile 'com.android.support:appcompat-v7:28.0.0-rc01'
compile 'com.android.support.constraint:constraint-layout:1.1.2'
compile 'com.android.support:support-v4:28.0.0-rc01'
compile 'com.android.support:design:28.0.0-rc01'
testCompile 'junit:junit:4.12'
androidTestCompile 'com.android.support.test:runner:1.0.2'
androidTestCompile 'com.android.support.test.espresso:espresso-core:3.0.2'
//cardview
compile "com.android.support:cardview-v7:28.0.0-rc01"
//recylerview
compile 'com.android.support:recyclerview-v7:28.0.0-rc01'
//picasso
compile 'com.squareup.picasso:picasso:2.71828'
//retrofit
compile 'com.squareup.retrofit2:retrofit:2.4.0'
compile 'com.squareup.retrofit2:converter-gson:2.4.0'
//Firebase
compile 'com.google.firebase:firebase-auth:16.0.3'
compile 'com.google.android.gms:play-services-auth:16.0.0'
compile 'com.google.firebase:firebase-firestore:17.1.0'
//Seekbar
compile 'com.crystal:crystalrangeseekbar:1.0.0'
//Search Dialog
compile 'com.github.mirrajabi:search-dialog:1.1'
//Fab Button
compile 'com.github.dimorinny:floating-text-button:0.0.4'
//Circle ImageView
compile 'de.hdodenhof:circleimageview:2.1.0'
}
apply plugin: 'com.google.gms.google-services'
Add maven { url 'https://dl.bintray.com/android/android-tools' } in your project's build.gradle like this:
buildscript {
repositories {
maven { url 'https://dl.bintray.com/android/android-tools' }
...
}
}
For more information see this answer
Move the compile 'com.google.gms:google-services:4.2.0' dependency from project's build.gradle to the app's build.gradle file.
From
repositories {
google()
mavenCentral()
}
To
repositories {
google()
maven {
url "https://maven.google.com"
}
}
I Want to add Firestore in app, my android studio version is 2.3.2, but i am unable to see firestore option in Firebase assistant, And when i am adding librar for Firestore:-
compile 'com.google.firebase:firebase-firestore:10.0.1'
it is showing me this error:-
Error:(32, 13) Failed to resolve: com.google.firebase:firebase-firestore:10.0.1
Please help me out with this problem !!
this is my app level build gradel file:-
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion "27.0.3"
defaultConfig {
applicationId "in.anew.trysafeblog"
minSdkVersion 21
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner
"android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:26.+'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.google.firebase:firebase-auth:10.0.1'
compile 'de.hdodenhof:circleimageview:2.1.0'
compile 'com.theartofdev.edmodo:android-image-cropper:2.5.+'
compile 'com.google.firebase:firebase-storage:10.0.1'
compile 'com.google.firebase:firebase-firestore:10.0.1'
testCompile 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'
Please help me out !!!
build gradle file:-
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.2'
// in the individual module build.gradle files
classpath 'com.google.gms:google-services:4.0.1'
//classpath 'com.google.gms:google-services:3.0.0'
}
}
allprojects {
repositories {
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
To solve this, please change the following lines of code:
compile 'com.google.firebase:firebase-storage:10.0.1'
compile 'com.google.firebase:firebase-firestore:10.0.1'
compile 'com.google.firebase:firebase-auth:10.0.1'
to
implementation 'com.google.firebase:firebase-storage:16.0.1'
implementation 'com.google.firebase:firebase-firestore:17.0.2'
implementation 'com.google.firebase:firebase-auth:16.0.2'
implementation 'com.google.firebase:firebase-core:16.0.1'
And please also don't forget to add:
classpath 'com.google.gms:google-services:4.0.1'
To your build.gradle file. Please see here more info.
Use
on your app/build.gradle
compile 'com.google.firebase:firebase-firestore:17.0.2'
compile 'com.google.firebase:firebase-storage:16.0.1'
compile 'com.google.firebase:firebase-auth:16.0.2'
on your project/build.gradle
buildscript {
repositories {
jcenter()
maven {
url "https://jitpack.io"
}
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.2'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
classpath 'com.google.gms:google-services:3.2.1'
}
}
allprojects {
repositories {
jcenter()
maven { url 'https://jitpack.io' }
}
}
task clean(type: Delete) { delete rootProject.buildDir }
This app was running perfectly OK without any issue. Suddenly i saw this gradle sync problems.I'm really stuck and need help. What to do now? I've uninstalled and reinstalled android support repository from SDK manager.
C:\Users\DELL\AndroidStudioProjects\Prokriti\app\build.gradle
Error:Error:Failed to resolve: com.android.support:support-annotations:27.0.1
Install Repository and sync project
Error:Error:Failed to resolve: com.android.support:appcompat-v7:27.0.1
Install Repository and sync project
Error:Error:Failed to resolve: com.android.support:customtabs:27.0.1
Install Repository and sync project
Error:Error:Failed to resolve: com.android.support:cardview-v7:27.0.1
Install Repository and sync project
Error:Error:Failed to resolve: com.android.support:support-v4:27.0.1
Install Repository and sync project
Error:Error:Failed to resolve: com.android.support:support-core-utils:27.0.1
Install Repository and sync project
build.gradle (app)
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "26.0.1"
defaultConfig {
applicationId "com.avtro.prokriti.prokriti"
minSdkVersion 16
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support:cardview-v7:25.3.1'
compile 'com.android.support:design:25.3.1'
compile 'com.android.support:support-core-utils:25.3.1'
compile 'com.android.support:support-annotations:25.3.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.google.android.gms:play-services-auth:11.0.4'
compile 'com.google.firebase:firebase-core:11.0.2'
compile 'com.google.firebase:firebase-messaging:11.0.2'
compile 'com.google.firebase:firebase-database:11.0.2'
compile 'com.google.firebase:firebase-auth:11.0.2'
compile 'com.google.firebase:firebase-ads:11.0.2'
compile 'com.afollestad.material-dialogs:core:0.9.4.5'
compile 'com.wang.avi:library:2.1.3'
compile 'com.google.android.gms:play-services-ads:11.0.4'
compile 'de.hdodenhof:circleimageview:2.1.0'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.survivingwithandroid:weatherlib:1.6.0'
compile 'com.amitshekhar.android:android-networking:1.0.0'
compile 'com.android.support:multidex:1.0.1'
compile 'com.squareup.okhttp:okhttp:2.0.0'
compile 'com.facebook.android:facebook-android-sdk:[4,5)'
compile 'com.google.firebase:firebase-storage:11.0.2'
androidTestCompile 'junit:junit:4.12'
compile 'javax.inject:javax.inject:1'
compile 'com.android.support:support-v4:25.3.1'
compile 'com.github.bumptech.glide:glide:3.8.0'
}
apply plugin: 'com.google.gms.google-services'
build.gradle (project)
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
classpath 'com.google.gms:google-services:3.0.0'
}
}
allprojects {
repositories {
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
i didnt update android studio or gradle. Android support repository is installed.
I solve the problem by removing
compile 'com.facebook.android:facebook-android-sdk:[4,5)'
And adding
compile 'com.facebook.android:facebook-android-sdk:4.26.0'
You need to change only one line.
Fixed by updating facebook sdk version
from
compile 'com.facebook.android:facebook-android-sdk:[4,5)'
to
compile 'com.facebook.android:facebook-android-sdk:4.26.0'
'com.facebook.android:facebook-android-sdk:[4,5)'
or
'com.facebook.android:facebook-android-sdk:4.+'
above replace with below
'com.facebook.android:facebook-android-sdk:4.26.0'
Replace
compile 'com.facebook.android:facebook-android-sdk:[4,5)'
by
compile 'com.facebook.android:facebook-android-sdk:4.26.0'
hope it will work
Add google() in buildscript.repositories and allprojects.repositories :
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
classpath 'com.google.gms:google-services:3.0.0'
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
This should solve your problem.
Its work for me
Its work for me
Update Android SDK Build -Tools and SDK platforms
Changed in project build file.
buildscript {
repositories {
jcenter()
maven {
url "https://maven.google.com"
}
}
}
allprojects {
repositories {
jcenter()
maven {
url "https://maven.google.com"
}
}
}
changed in app build file
compileSdkVersion 26
buildToolsVersion "26.0.2"
Disable dependencies inspection.
compile 'com.android.support:design:25.3.1
use this
repositories {
maven { url 'https://maven.google.com/' }
}
For react-native projects: Add maven repo to your project. (Removes react-native-fbsdk error after adding maven repo links).
buildscript {
repositories {
jcenter()
mavenCentral()
maven { // Add this block
url "https://maven.google.com"
}
}
}
allprojects {
repositories {
mavenLocal()
jcenter()
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url "$rootDir/../node_modules/react-native/android"
}
// If something is not found from above maven repo.
maven { url 'https://maven.google.com' } // Add this block
}
}
More Info here
Don't
compile 'com.facebook.android:facebook-android-sdk:[4,5)'
According to Facebook SDK for Android, You should use
// Facebook Android SDK (everything)
compile 'com.facebook.android:facebook-android-sdk:4.+'
for updated case read Changelog and release notes for the Facebook SDK for Android.
compile 'com.facebook.android:facebook-android-sdk:4.26.0'
compile 'com.facebook.android:facebook-android-sdk:4.27.0'
compile 'com.facebook.android:facebook-android-sdk:4.28.0'
compile 'com.facebook.android:facebook-android-sdk:4.29.0'
started today with Firebase - it seems pretty easy, but currently I'm doing something completely wrong.
My build error:
Error:Execution failed for task ':app:preDebugBuild'. Android dependency
'com.google.firebase:firebase-core' has different version for the compile
(9.0.0) and runtime (11.2.0) classpath. You should manually set the same version via DependencyResolution```
with apply plugin: 'com.google.gms.google-services' in the base feature's build.gradle
Without this line there are no build errors, but, Firebase stops working (that was pretty predictable :D)
base feature's build.gradle:
apply plugin: 'com.android.feature'
apply plugin: 'kotlin-android'
apply plugin: 'com.google.gms.google-services'
android {
baseFeature = true
compileSdkVersion 26
buildToolsVersion "26.0.1"
defaultConfig {
minSdkVersion 17
targetSdkVersion 26
versionCode 35
versionName "1.1.1"
}
buildTypes {
release {
minifyEnabled false
}
}
}
repositories {
flatDir {
dirs 'libs'
}
mavenCentral()
}
dependencies {
androidTestCompile('com.android.support.test.espresso:espresso- core:2.2.2', {
exclude group: 'com.android.support', module: 'support- annotations'
})
testCompile 'junit:junit:4.12'
compile fileTree(dir: 'libs', include: ['*.jar'])
compile "com.android.support:appcompat-v7:$support_version"
compile "com.android.support:support-v13:$support_version"
compile "com.android.support:recyclerview-v7:$support_version"
compile "com.android.support:design:$support_version"
compile "com.android.support:customtabs:$support_version"
compile "com.android.support:support-vector-drawable:$support_version"
implementation "com.google.firebase:firebase-messaging:$firebase_version"
implementation "com.google.firebase:firebase-database:$firebase_version"
implementation "com.google.firebase:firebase-appindexing:$firebase_version"
implementation "com.google.firebase:firebase-core:$firebase_version"
compile "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
}
and the project's one:
buildscript {
ext.kotlin_version = '1.1.4-3'
ext.firebase_version = '11.2.0'
ext.support_version = '26.0.2'
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0-beta4'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
classpath 'com.google.gms:google-services:3.1.0'
}
}
allprojects {
repositories {
jcenter()
maven {
url "https://maven.google.com"
}
google()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Any help? Thanks a lot!
You should put apply plugin: 'com.google.gms.google-services' at the BOTTOM of your gradle file not the top.
https://developers.google.com/android/guides/google-services-plugin
For Instant Apps should be:
**implementation 'com.google.firebase:firebase-messaging:11.8.0'**
instead of
implementation 'com.google.firebase:firebase-messaging:11.8.0'
I try to execute from my terminal the command : ./gradlew testfairyDebug.
This return the next error:
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':app:testfairyDebug'.
Could not get unknown property 'outputFile' for task ':app:packageDebug' of type com.android.build.gradle.tasks.PackageApplication.
Have you any idea to solve this problem.
For information, i work on Android Studio 3 and my gradle version is 'com.android.tools.build:gradle:3.0.0-alpha6'
My build.gradle :
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.kotlin_version = '1.1.2-4'
repositories {
maven { url 'https://maven.google.com' }
maven { url 'https://www.testfairy.com/maven' }
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.0-alpha6'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.testfairy.plugins.gradle:testfairy:1.+'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
maven { url 'https://maven.google.com' }
mavenCentral()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
and my app.build.gradle :
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'testfairy'
android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
defaultConfig {
applicationId "com.name.application"
minSdkVersion 15
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
testfairyConfig {
apiKey "xxxxxxxxxxxxxxxxxxxxxxxx"
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
//noinspection GradleCompatible
compile 'com.android.support:appcompat-v7:25.3.1'
testCompile 'junit:junit:4.12'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.android.support:design:25.3.1'
compile 'org.greenrobot:eventbus:3.0.0'
compile 'com.squareup.retrofit2:retrofit:2.1.0'
compile 'com.squareup.retrofit2:converter-gson:2.1.0'
compile 'com.lorentzos.swipecards:library:1.0.9'
compile 'com.github.rey5137:material:1.2.2'
compile 'com.squareup.picasso:picasso:2.5.2'
// Android SDK
compile 'com.facebook.android:facebook-android-sdk`enter code here`:4.+'
compile 'org.greenrobot:eventbus:3.0.0'
compile 'com.android.support:recyclerview-v7:25.1.1'
compile 'testfairy:testfairy-android-sdk:1.+#aar'
}
Thanks a lot.
The error indicates that you are trying to access 'outputFile' from PackageApplication. But I didn't see it in your gradle file. Maybe it is caused by one of your modules? If that's the case, Variant API to manipulate variant outputs is broken with Gradle plugin 3.0. Only simple tasks work. Check out this page: https://developer.android.com/studio/build/gradle-plugin-3-0-0-migration.html#variant_api
Can you please update TestFairy gradle plugin to version 2.+.
Change the classpath com.testfairy.plugins.gradle:testfairy:1.+ to com.testfairy.plugins.gradle:testfairy:2.+
in the dependencies section of your build.gradle file.