Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't run my first flutter app [Error running Gradle] #23777

Closed
ShaikhahMaasher opened this issue Oct 31, 2018 · 103 comments
Closed

Can't run my first flutter app [Error running Gradle] #23777

ShaikhahMaasher opened this issue Oct 31, 2018 · 103 comments

Comments

@ShaikhahMaasher
Copy link

I have an issue with running flutter apps.

The log of flutter run

Launching lib\main.dart on Android SDK built for x86 in debug mode...
Initializing gradle...
Resolving dependencies...
* Error running Gradle:
Exit code 1 from: D:\SHOSH\Development\flutter\fst_app\android\gradlew.bat app:properties:
Project evaluation failed including an error in afterEvaluate {}. Run with --stacktrace for details of the afterEvaluate {} error.

FAILURE: Build failed with an exception.

* Where:
Build file 'D:\SHOSH\Development\flutter\fst_app\android\app\build.gradle' line: 25

* What went wrong:
A problem occurred evaluating project ':app'.
> Could not resolve all files for configuration 'classpath'.
   > Could not find lint-gradle-api.jar (com.android.tools.lint:lint-gradle-api:26.1.2).
     Searched in the following locations:
         https://jcenter.bintray.com/com/android/tools/lint/lint-gradle-api/26.1.2/lint-gradle-api-26.1.2.jar

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 2s

Finished with error: Please review your Gradle project setup in the android/ folder.

I couldn't figure out the issue as the output of running flutter doctor -v was clean:

[√] Flutter (Channel beta, v0.9.4, on Microsoft Windows [Version 10.0.17134.345], locale en-US)
    • Flutter version 0.9.4 at C:\flutter
    • Framework revision f37c235c32 (5 weeks ago), 2018-09-25 17:45:40 -0400
    • Engine revision 74625aed32
    • Dart version 2.1.0-dev.5.0.flutter-a2eb050044

[√] Android toolchain - develop for Android devices (Android SDK 28.0.3)
    • Android SDK at C:\Users\WinDows\AppData\Local\Android\sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-28, build-tools 28.0.3
    • Java binary at: C:\Program Files\Android\Android Studio1\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1136-b06)
    • All Android licenses accepted.

[√] Android Studio (version 3.2)
    • Android Studio at C:\Program Files\Android\Android Studio1
    • Flutter plugin version 29.1.1
    • Dart plugin version 181.5656
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1136-b06)

[√] VS Code, 64-bit edition (version 1.28.2)
    • VS Code at C:\Program Files\Microsoft VS Code
    • Flutter extension version 2.19.0

[√] Connected devices (1 available)
    • Android SDK built for x86 • emulator-5554 • android-x86 • Android 4.4.2 (API 19) (emulator)

• No issues found!
------------------------------------------------------------
Gradle 4.10.2
------------------------------------------------------------

Build time:   2018-09-19 18:10:15 UTC
Revision:     b4d8d5d170bb4ba516e88d7fe5647e2323d791dd

Kotlin DSL:   1.0-rc-6
Kotlin:       1.2.61
Groovy:       2.4.15
Ant:          Apache Ant(TM) version 1.9.11 compiled on March 23 2018
JVM:          1.8.0_101 (Oracle Corporation 25.101-b13)
OS:           Windows 10 10.0 amd64
@zoechi
Copy link
Contributor

zoechi commented Oct 31, 2018

Merging with #23404

@zoechi zoechi closed this as completed Oct 31, 2018
@GuptaWeber
Copy link

Same here too..!

Please Help!

`Launching lib\main.dart on ZUK Z1 in debug mode...
Initializing gradle...
Resolving dependencies...
* Error running Gradle:
Exit code 1 from: C:\Users\160040668\AndroidStudioProjects\flutter_app\android\gradlew.bat app:properties:
Project evaluation failed including an error in afterEvaluate {}. Run with --stacktrace for details of the afterEvaluate {} error.

FAILURE: Build failed with an exception.

* Where:
Build file 'C:\Users\160040668\AndroidStudioProjects\flutter_app\android\app\build.gradle' line: 25

* What went wrong:
A problem occurred evaluating project ':app'.
> Could not resolve all files for configuration 'classpath'.
   > Could not find lint-gradle-api.jar (com.android.tools.lint:lint-gradle-api:26.1.2).
     Searched in the following locations:
         https://jcenter.bintray.com/com/android/tools/lint/lint-gradle-api/26.1.2/lint-gradle-api-26.1.2.jar

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 2s

Finished with error: Please review your Gradle project setup in the android/ folder.
`

@EBR12
Copy link

EBR12 commented Nov 4, 2018

I have the same issue !

@ChangJoo-Park
Copy link

same issue here.

https://jcenter.bintray.com/com/android/tools/lint/lint-gradle-api/26.1.2/lint-gradle-api-26.1.2.jar

{
  "errors" : [ {
    "status" : 404,
    "message" : "Could not find resource"
  } ]
}

@GuptaWeber
Copy link

GuptaWeber commented Nov 4, 2018

yaa It had solved for me..!
Just go to flutter sdk folder and go to this path \flutter\packages\flutter_tools\gradle\flutter.gradle
and in flutter.gradle file change from this code

buildscript {
    repositories {

        jcenter()
        maven {
            url 'https://dl.google.com/dl/android/maven2'
        }

    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.1.2'
    }
}

to this code

buildscript {
    repositories {
        maven {
            url 'https://dl.google.com/dl/android/maven2'
        }
        jcenter()

    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.1.2'
    }
}

@advertiva
Copy link

advertiva commented Nov 4, 2018

yaa It had solved for me..!
Just go to flutter sdk folder and go to this path \flutter\packages\flutter_tools\gradle\flutter.gradle
and in flutter.gradle file change from this code

buildscript {
    repositories {

        jcenter()
        maven {
            url 'https://dl.google.com/dl/android/maven2'
        }

    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.1.2'
    }
}

to this code

buildscript {
    repositories {
        maven {
            url 'https://dl.google.com/dl/android/maven2'
        }
        jcenter()

    }
    dependencies {`enter code here`
        classpath 'com.android.tools.build:gradle:3.1.2'
    }
}

This work but remove the 'enter code here'
or just copy this code snippet and replace the original buildscript

//--------------------------------------------------

buildscript {
repositories {
maven {
url 'https://dl.google.com/dl/android/maven2'
}
jcenter()

}
dependencies {
    classpath 'com.android.tools.build:gradle:3.1.2'
}

}

//-------------------------------------------------

@stickyboiproject
Copy link

where do i open that file so i can change it?

@snehitvaddi
Copy link

where do i open that file so i can change it?

open flutter SDK which is the downloaded flutter file then follow the above steps as mentioned.

@JCzz
Copy link

JCzz commented Nov 5, 2018

I can also confirm that this works, but does it make any sense - it is the same code, just jcenter() has moved?

Thanks for sharing this!

@ZainAhmed05
Copy link

thanks a lot.

@ghost
Copy link

ghost commented Nov 5, 2018

where do i open that file so i can change it?

with nano flutter.gradle if you use mac or linux

@advertiva
Copy link

advertiva commented Nov 5, 2018

where do i open that file so i can change it?

open flutter SDK which is the downloaded flutter file then follow the above steps as mentioned.

\flutter\packages\flutter_tools\gradle\flutter.gradle

Locate where you extract the flutter files and then traverse the folder from
flutter > packages > flutter_tools > gradle

and then look for file named flutter.gradle

@l3s7r0z
Copy link

l3s7r0z commented Nov 6, 2018

With the new flutter (0.10.2), simply move "jcenter()" above "google()", since you won't have "maven{}" anymore.

@makama-md
Copy link

yaa It had solved for me..!
Just go to flutter sdk folder and go to this path \flutter\packages\flutter_tools\gradle\flutter.gradle
and in flutter.gradle file change from this code

buildscript {
    repositories {

        jcenter()
        maven {
            url 'https://dl.google.com/dl/android/maven2'
        }

    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.1.2'
    }
}

to this code

buildscript {
    repositories {
        maven {
            url 'https://dl.google.com/dl/android/maven2'
        }
        jcenter()

    }
    dependencies {`enter code here`
        classpath 'com.android.tools.build:gradle:3.1.2'
    }
}

This work but remove the 'enter code here'
or just copy this code snippet and replace the original buildscript

//--------------------------------------------------

buildscript {
repositories {
maven {
url 'https://dl.google.com/dl/android/maven2'
}
jcenter()

}
dependencies {
    classpath 'com.android.tools.build:gradle:3.1.2'
}

}

//-------------------------------------------------

It works for me. Thanks!

@AgmarTorres
Copy link

It's worked. Thank you.

@philip97hd
Copy link

I have the same problem here, and the solution (edit the "flutter.gradle" file), didn't solve the problem!!

@zaynab-raisi
Copy link

I have the same problem here, and the solution (edit the "flutter.gradle" file), didn't solve the problem!!

This solution didn't work for me too. Have you solved the problem?

@zoechi
Copy link
Contributor

zoechi commented Jan 17, 2019

@heyran is this this for a new project or a project that you created with an older Flutter version?
What Flutter version are you using now?
https://github.com/flutter/flutter/wiki/Workarounds-for-common-issues#generated-project-files-outdated might help.

@philip97hd
Copy link

philip97hd commented Jan 17, 2019 via email

@zaynab-raisi
Copy link

@heyran is this this for a new project or a project that you created with an older Flutter version?
What Flutter version are you using now?
https://github.com/flutter/flutter/wiki/Workarounds-for-common-issues#generated-project-files-outdated might help.

A new project. I use version 1.0.0

@zoechi
Copy link
Contributor

zoechi commented Jan 18, 2019

@heyran What does gradle --version print and what version do you have in
android/gradle/wrapper/gradle-wrapper.properties distributionUrl?

@zaynab-raisi
Copy link

@heyran What does gradle --version print and what version do you have in
android/gradle/wrapper/gradle-wrapper.properties distributionUrl?

when I type gradle --version in cmd, it doesn,t recognize gradle. In android/gradle/wrapper/gradle-wrapper.properties: 4.10.2. I have flutter, what's the problem?

@zoechi
Copy link
Contributor

zoechi commented Jan 18, 2019

@heyran please post your full error output and the output of flutter doctor -v

@zaynab-raisi
Copy link

zaynab-raisi commented Jan 18, 2019

@zoechi

flutter doctor
android studio

Launching lib\main.dart on Samsung Galaxy S8 in debug mode...
Initializing gradle...
Resolving dependencies...
* Error running Gradle:
ProcessException: Process "E:\as\startup_namer\android\gradlew.bat" exited abnormally:
Starting a Gradle Daemon, 1 incompatible and 1 stopped Daemons could not be reused, use --status for details


FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'android'.
> Could not resolve all artifacts for configuration ':classpath'.
   > Could not find com.android.tools.build:gradle:3.2.1.
     Searched in the following locations:
       - https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/3.2.1/gradle-3.2.1.pom
       - https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/3.2.1/gradle-3.2.1.jar
       - https://jcenter.bintray.com/com/android/tools/build/gradle/3.2.1/gradle-3.2.1.pom
       - https://jcenter.bintray.com/com/android/tools/build/gradle/3.2.1/gradle-3.2.1.jar
     Required by:
         project :

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 32s
  Command: E:\as\startup_namer\android\gradlew.bat app:properties

Finished with error: Please review your Gradle project setup in the android/ folder.

@zoechi
Copy link
Contributor

zoechi commented Jan 18, 2019

@heyran gladed/gradle-android-git-version#55 looks similar perhaps you can make sense of the comment.s

@GathuaKiragu
Copy link

Fixed the problem by updating my gradle plugin from
classpath 'com.android.tools.build:gradle:3.1.2'
to
classpath 'com.android.tools.build:gradle:3.2.1'

@zaynab-raisi
Copy link

I solved my problem by editing <gradle-wrapper.properties> file.
...//services.gradle.org/distributions/gradle-4.4-all.zip
to:
...//services.gradle.org/distributions/gradle-4.6-all.zip

Notice that find this file in C:\Users\<user name>\flutter, not in C:\flutter or C:\Program Files\flutter.

@demiscology
Copy link

I have the same problem here running my first flutter application.
screenshot 22

@zoechi
Copy link
Contributor

zoechi commented Feb 8, 2019

@demiscology run flutter doctor -v and you should get instructions how to proceed or follow the instructions in the error message you posted.

@bakabon86
Copy link

for me, i've got this error when create new flutter project.

FAILURE: Build failed with an exception.

  • What went wrong:
    A problem occurred configuring root project 'android'.

Could not resolve all artifacts for configuration ':classpath'.
Could not download kotlin-gradle-plugin.jar (org.jetbrains.kotlin:kotlin-gradle-plugin:1.2.71)
> Could not get resource
'https://jcenter.bintray.com/org/jetbrains/kotlin/kotlin-gradle-plugin/1.2.71/kotlin-gradle-plugin-1.2.71.jar'.
> Read timed out
Could not download kotlin-compiler-embeddable.jar (org.jetbrains.kotlin:kotlin-compiler-embeddable:1.2.71)
> Could not get resource
'https://jcenter.bintray.com/org/jetbrains/kotlin/kotlin-compiler-embeddable/1.2.71/kotlin-compiler-embeddable-1.2
.71.jar'.
> Could not GET
'https://jcenter.bintray.com/org/jetbrains/kotlin/kotlin-compiler-embeddable/1.2.71/kotlin-compiler-embeddable-
1.2.71.jar'.
> Read timed out
Could not download kotlin-reflect.jar (org.jetbrains.kotlin:kotlin-reflect:1.2.71)
> Could not get resource
'https://jcenter.bintray.com/org/jetbrains/kotlin/kotlin-reflect/1.2.71/kotlin-reflect-1.2.71.jar'.
> Read timed out

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with
    --scan to get full insights.

  • Get more help at https://help.gradle.org

solved this error by running flutter upgrade again.

@oskarsh
Copy link

oskarsh commented Sep 24, 2019

@bakabon86 can confirm, flutter upgrade solved this for me also!

@alextm86
Copy link

alextm86 commented Sep 27, 2019

Hello guys, I have the following problem with the gradle.

  • Error running Gradle:
    ProcessException: Process "C:\Users...\AndroidStudioProjects\flutter_signature\android\gradlew.bat" exited abnormally:
    Starting a Gradle Daemon, 1 incompatible and 1 stopped Daemons could not be reused, use --status for details
    Command: C:\Users...\AndroidStudioProjects\flutter_signature\android\gradlew.bat app:properties

Please review your Gradle project setup in the android/ folder.

I have already tried different versions of Gradle, but to no avail.

Can someone possibly help?

Now something else is coming:

  • Error running Gradle:
    ProcessException: Process exited abnormally:
    Starting a Gradle Daemon, 1 incompatible and 2 stopped Daemons could not be reused, use --status for details

Configure project :app
WARNING: The option setting 'android.enableR8=true' is experimental and unsupported.
The current default is 'false'
Consider disabling R8 by removing 'android.enableR8=true' from your gradle.properties before publishing your app.

Deprecated Gradle features were used in this build, making it incompatible with Gradle 6.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/5.1.1/userguide/command_line_interface.html#sec:command_line_warnings

FAILURE: Build failed with an exception.

  • Where:
    Build file 'C:\Users...\AndroidStudioProjects\flutter_signature\android\app\build.gradle' line: 65

  • What went wrong:
    A problem occurred evaluating project ':app'.

Could not find method classpath() for arguments [com.android.tools.build:gradle:3.5.0] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org

BUILD FAILED in 26s
Command: C:\Users...\AndroidStudioProjects\flutter_signature\android\gradlew.bat app:properties

Please review your Gradle project setup in the android/ folder.

@phamminhhai8x
Copy link

I have same problem and solved it by update "android/gradle/wrapper/gradle-wrapper.properties" file same as the another project which can build success

@Shiba-Kar
Copy link

 dependencies {
        classpath 'com.android.tools.build:gradle:3.2.1'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
        classpath 'com.google.gms:google-services:3.2.1'
    }

use classpath 'com.google.gms:google-services:3.2.1'

@RobinManoli
Copy link

I solved this problem differently.

In order to find the problem, open the project's android folder in android studio. When it's syncing/building the same problem as before should show up. However, you can now click the icon next to the error to find the real problem.

In my case the problem was that my signing information wasn't included in the .git folder. I hadn't recreated the key.properties file in the project on the new computer and got the error as of this issue.

@h1amza
Copy link

h1amza commented Oct 19, 2019

i have this code on flutter.gradle
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
}
}
android {
compileOptions {
sourceCompatibility 1.8
targetCompatibility 1.8
}
}
and i have the same problem

@h1amza
Copy link

h1amza commented Oct 19, 2019

Error running Gradle:
ProcessException: Process "C:\Users\hamza\OneDrive\Bureau\task\5firebase\flutter_app_firebase_test\android\gradlew.bat" exited abnormally:

FAILURE: Build failed with an exception.

  • Where:
    Build file 'C:\Users\hamza\OneDrive\Bureau\task\5firebase\flutter_app_firebase_test\android\app\build.gradle' line: 24

  • What went wrong:
    A problem occurred evaluating project ':app'.

ASCII

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org

BUILD FAILED in 1s
Command: C:\Users\hamza\OneDrive\Bureau\task\5firebase\flutter_app_firebase_test\android\gradlew.bat app:properties

Finished with error: Please review your Gradle project setup in the android/ folder.

@h1amza
Copy link

h1amza commented Oct 20, 2019

flutter doctor -v
[√] Flutter (Channel stable, v1.9.1+hotfix.5, on Microsoft Windows [version 10.0.18362.418], locale fr-FR)
• Flutter version 1.9.1+hotfix.5 at C:\src\flutter
• Framework revision 1aedbb1 (2 days ago), 2019-10-17 08:37:27 -0700
• Engine revision b863200
• Dart version 2.5.0

[√] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
• Android SDK at C:\Users\hamza\AppData\Local\Android\sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-29, build-tools 29.0.2
• Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b03)
• All Android licenses accepted.

[√] Android Studio (version 3.5)
• Android Studio at C:\Program Files\Android\Android Studio
• Flutter plugin version 40.2.2
• Dart plugin version 191.8593
• Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b03)

[√] Connected device (1 available)
• Android SDK built for x86 • emulator-5554 • android-x86 • Android 9 (API 28) (emulator)

@icripps
Copy link

icripps commented Oct 20, 2019

@h1amza were you able to solve it? i have the exact same problem. i'm using intellij idea IDE.

@TranThanhHieu
Copy link

giúp mình với các bác ơi
1 error

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org

BUILD FAILED in 2s

at checkExecSyncError (child_process.js:603:11)
at execFileSync (child_process.js:621:15)
at runOnAllDevices (C:\Users\Admin\Desktop\New folder\Demo\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:94:39)
at buildAndRun (C:\Users\Admin\Desktop\New folder\Demo\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\index.js:158:41)
at C:\Users\Admin\Desktop\New folder\Demo\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\index.js:125:12
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at async Command.handleAction (C:\Users\Admin\AppData\Roaming\npm\node_modules\react-native\node_modules\@react-native-community\cli\build\index.js:164:9)

@danishnafay
Copy link

same issue here...
Launching lib\main.dart on Android SDK built for x86 in debug mode...
Initializing gradle...
Resolving dependencies...

  • Error running Gradle:
    ProcessException: Process "C:\Users\HP\AndroidStudioProjects\flutter_app3\android\gradlew.bat" exited abnormally:

Configure project :app
Checking the license for package Android SDK Build-Tools 28.0.3 in C:\Users\HP\AppData\Local\Android\sdk\licenses
Warning: License for package Android SDK Build-Tools 28.0.3 not accepted.
Checking the license for package Android SDK Platform 28 in C:\Users\HP\AppData\Local\Android\sdk\licenses
Warning: License for package Android SDK Platform 28 not accepted.

FAILURE: Build failed with an exception.

  • Where:
    Build file 'C:\Users\HP\AndroidStudioProjects\flutter_app3\android\build.gradle' line: 26

  • What went wrong:
    A problem occurred evaluating root project 'android'.

A problem occurred configuring project ':app'.
Failed to install the following Android SDK packages as some licences have not been accepted.
build-tools;28.0.3 Android SDK Build-Tools 28.0.3
platforms;android-28 Android SDK Platform 28
To build this project, accept the SDK license agreements and install the missing components using the Android Studio SDK Manager.
Alternatively, to transfer the license agreements from one workstation to another, see http://d.android.com/r/studio-ui/export-licenses.html

 Using Android SDK: C:\Users\HP\AppData\Local\Android\sdk
  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org

BUILD FAILED in 8s
Command: C:\Users\HP\AndroidStudioProjects\flutter_app3\android\gradlew.bat app:properties

Finished with error: Please review your Gradle project setup in the android/ folder.

@danishnafay
Copy link

I tried updating the flutter.gradle file but it didn't solve the issue.

@helios1101
Copy link

helios1101 commented Nov 7, 2019

buildscript {
    repositories {
	jcenter()
        google()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.2.1'
    }
}

android {
    compileOptions {
        sourceCompatibility 1.8
        targetCompatibility 1.8
    }
}

Solved me the error !!
Just moved the jcenter() to top of google()

@sedhha
Copy link

sedhha commented Nov 7, 2019

where do i open that file so i can change it?

Just go to your c drive where you have installed flutter files. It's mostly in c directory.

@touhidsunny
Copy link

touhidsunny commented Nov 14, 2019

in your project_name/android/build.gradle directory

Change the google services version:

dependencies {
    classpath 'com.android.tools.build:gradle:3.2.1'
    classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
    classpath "com.google.gms:google-services:4.2.0"
}

@griotdonation
Copy link

in app/build.gradle replace dependencies with following code

dependencies {
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
}

@JubairSayeedLinas
Copy link

JubairSayeedLinas commented Nov 28, 2019

after trying all solution , This is my problem
Annotation 2019-11-28 121034

@hsyntnc
Copy link

hsyntnc commented Nov 28, 2019

Having the same issue. Is there any other solutions?

@hectorh123
Copy link

Exact same error as Jubair

@lucianocheng
Copy link

Just hit this issue. Check that your key.properties is in android/app.

The android/app/build.gradle file explicitly checks for this file, and fails if it does not find it.

@DinuwanB
Copy link

DinuwanB commented Dec 17, 2019

in your project_name/android/build.gradle directory

Change the google services version:

dependencies {
    classpath 'com.android.tools.build:gradle:3.2.1'
    classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
    classpath "com.google.gms:google-services:4.2.0"
}

classpath "com.google.gms:google-services:4.3.2" changed as
classpath "com.google.gms:google-services:4.2.0"
Yes this solution works for me , thank you

@easazade
Copy link

just 2 words. f--- gradle.

@gicounts
Copy link

gicounts commented Jan 3, 2020

If this is working for you on Windows can you share the app and project gradle files? And also the url in the gradle-wrapper.properties? It seems all three must be synced to specific versions in order for this to work. Thank you!

@sugandicode
Copy link

image

i will try all solution, but not work for me, please give me solution

@guit4eva
Copy link

Just hit this issue. Check that your key.properties is in android/app.

The android/app/build.gradle file explicitly checks for this file, and fails if it does not find it.

Thank you for this! My problem was that I mistakenly didn't add my key.properties to .gitignore, and then pulled the repo from PC to Mac, so the relative paths were out. I was truly stumped there for a while, glad I came across your comment!

@passionHunter
Copy link

 dependencies {
        classpath 'com.android.tools.build:gradle:3.2.1'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
        classpath 'com.google.gms:google-services:3.2.1'
    }

use classpath 'com.google.gms:google-services:3.2.1'

@SPK-RPI this works me . thank you 🎉

@lock
Copy link

lock bot commented Apr 2, 2020

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

@lock lock bot locked and limited conversation to collaborators Apr 2, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests