Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

android gradle plugin version column is empty

after I downloaded the new version of gradle 6.6.1 there was an error showing "Cannot resolve external dependency com.android.tools.build:gradle because no repositories are defined. Required by: project :app " I dont know what to do now. The android gradle plugin version is empty.what do i fill in it?
enter image description here

like image 631
Aditi Vakeel Avatar asked Oct 02 '20 11:10

Aditi Vakeel


People also ask

Why is my Gradle plugin not working?

Changes in Android Gradle plugin 4.0 can trigger a race condition in Gradle when running with --no-daemon and versions of Gradle 6.3 or lower, causing builds to hang after the build is finished. This issue will be fixed in Gradle 6.4. This version of the Android plugin requires the following: Gradle 5.6.4 .

How to change the Gradle version in Android Studio?

You can specify the Gradle version in either the File > Project Structure > Project menu in Android Studio, or by editing the Gradle distribution reference in the gradle/wrapper/gradle-wrapper.properties file.

Why is androidtestapi not working in Gradle?

Because local modules can't depend on your app's test APK, adding dependencies to your instrumented tests using the androidTestApi configuration, instead of androidTestImplementation, causes Gradle to issue the following warning: Fixes an issue where Android Studio doesn't properly recognize dependencies in composite builds.

What's new in Gradle version 40?

4.0.0 (April 2020) 1 New features. This version of the Android Gradle plugin includes the following new features. ... 2 Behavior changes. When using this version of the plugin, you might encounter the following changes in behavior. ... 3 Automatic packaging of prebuilt dependencies used by CMake. ... 4 Known issues. ...


1 Answers

Get the most recent version (binaries are enough) on gradle's website:

https://gradle.org/

Extract it to :~/.gradle/wrapper/dists

Then go inside this directory until you find the bin version:

~/.gradle/wrapper/dists/gradle-6.8/bin

And now create a symbolic link:

sudo rm /usr/bin/gradle
sudo ln -s ~/.gradle/wrapper/dists/gradle-6.8/bin/gradle  /usr/bin/gradle

Check the version:

gradle --version

Will give you this kind of output:

------------------------------------------------------------
Gradle 6.8
------------------------------------------------------------

Build time:   2021-01-08 16:38:46 UTC
Revision:     b7e82460c5373e194fb478a998c4fcfe7da53a7e

Kotlin:       1.4.20
Groovy:       2.5.12
Ant:          Apache Ant(TM) version 1.10.9 compiled on September 27 2020
JVM:          11.0.9.1 (Ubuntu 11.0.9.1+1-Ubuntu-0ubuntu1.18.04)
OS:           Linux **********

In android studio, go to Settings->Build,Execution&Deployment,Gradle and change gradle user home to: ~/.gradle/wrapper/dists/gradle-6.8/bin/gradle

Then file->invalidate cache and restart.

Now click on the play button (shift+f10 on linux), on the right of main.dart, it should run smoothly.

enter image description here

like image 109
Antonin GAVREL Avatar answered Jan 03 '23 00:01

Antonin GAVREL