cannot find lint-checks.jar - android

I've downloaded a new android project and for some reason I get this error when I am trying to build the app:
Could not find lint-checks.jar (com.android.tools.lint:lint-checks:26.0.1). Searched in the following locations: https://jcenter.bintray.com/com/android/tools/lint/lint-checks/26.0.1/lint-checks-26.0.1.jar
Weirdly, when I go to that url I can download the jar, so i'm really unsure why Android studio is complaining. I've downloaded the latest version - 3.1.2.
I've also tried disabling lint but no luck with removing the error!
Any help would be greatly appreciated!
My gradle file:
buildscript {
repositories {
jcenter()
mavenCentral()
google()
maven { url 'https://maven.fabric.io/public' }
maven { url 'http://oss.jfrog.org/artifactory/oss-snapshot-local' }
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
//noinspection GradleDynamicVersion
classpath 'io.fabric.tools:gradle:1.+'
classpath 'com.google.gms:google-services:3.1.2'
classpath 'com.android.tools.lint:lint-checks:26.0.1'
classpath 'com.github.ben-manes:gradle-versions-plugin:0.17.0'
classpath "io.realm:realm-gradle-plugin:4.3.3"
}
}
allprojects {
repositories {
google()
jcenter()
mavenCentral()
google()
maven { url "https://jitpack.io" }
maven { url 'https://maven.fabric.io/public' }
maven { url "https://dl.bintray.com/drummer-aidan/maven" }
flatDir {
dirs '../aars'
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}

I also started getting this issue this morning. I had not updated anything, not really sure what changed over the weekend.
I managed to fix the issue by updating my buildToolsVersion from 26.0.2 to 27.0.3, which also required me to update my Gradle version from 4.3 to 4.4 and my Gradle Plug-in from 3.0.1 to 3.1.2.
This was before I saw the solution provided by Floern, which also works. Not sure why though and i figured it's always better to stay up to date with the latest versions of Gradle.

try to add "com.android.tools.lint:lint-checks:26.0.1" to your gradle dependencies

Related

Android Studio Gradle: Please remove usages of `jcenter()` Maven repository from your build scripts / JCenter is at end of life

In Android Studio 4.2 there is a warning:
buildscript {
ext.kotlin_version = '1.5.0'
repositories {
google()
//jcenter()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.2.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
allprojects {
repositories {
google()
//jcenter()
mavenCentral()
}
}
If I remove jcenter() then it can't find some dependencies of my app project:
> Could not find org.koin:koin-core:2.0.1.
Required by:
project :app
> Could not find org.koin:koin-androidx-scope:2.0.1.
Required by:
project :app
> Could not find org.koin:koin-androidx-viewmodel:2.0.1.
Required by:
project :app
> Could not find com.google.ads.mediation:chartboost:8.1.0.0.
Required by:
project :app
In replace of jcenter() I added mavenCentral()
Move mavenCentral() above jcenter().
do a clean/build on your project.
comment out jcenter()
By moving mavenCentral() above jcenter(), mavenCentral() now becomes the primary repository for all non Google artifacts. By doing a clean and build, all artifacts are now moved to mavenCentral().
I had to look this up and tried it. I went from all heck breaking loose after I removed jcenter() to being able to build my final project for school again.
For koin, change the group id from org.koin to io.insert-koin - the latter is published on maven central.
For chartboost, you can use the following repo:
maven {
url "https://dl.bintray.com/google/mobile-ads-adapters-android/"
}
Also note that there are newer versions such as koin 2.2.2 / 3.0.1 and chartboost 8.2.0.0. Older versions are likely not republished in non-jcenter repos.
mvnrepository is a good service for locating packages.
just commenting out jcenter() will help,
mavencentral() is already above jcenter.
Locate all build.gradle files in your project folder tree, open them and replace jcenter() by mavenCentral(). It works for me most of the time.
It is interesting that the AndroidStudio project template still adds the ref to jcenter() to gradle, but then as soon as the project attempts to build it requests that you remove it.
I just delete it from the gradle file and then it works.
So there are two issues here.
First, we need to move MavenCentral above jCenter in all projects
Second, Android build tools version need to upgraded to 4.2.0 and above. As Android internal build tool dependencies are going to jCenter
dependencies {
classpath("com.android.tools.build:gradle:4.2.0")
}
It should work
Hope this will help
Go to App/Gradle Scripts/build.gradle (Project:---)
Change the jcenter() on build script{} and in all project repositories.
and Sync now.
This is how it looklike before.
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.2.1'
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
and after.
buildscript {
repositories {
google()
mavencentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.2.1'
}
}
allprojects {
repositories {
google()
mavencentral()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
This might help someone.
allprojects {
repositories {
...
maven { url "https://jitpack.io" }
...
}
}
I used this to resolve:
> Could not find com.github.parse-community.Parse-SDK-Android:parse:1.26.0.
Required by:
project :app
I got the same error, while i was using the Android Studio Artic Fox Beta - 3 but after change Android Studio as Canary Build the error gone
The solution I did was to change build:gradle version:
dependencies {
classpath("com.android.tools.build:gradle:4.2.2")
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
The solution is simpe
just Locate build.gradle and replace jcenter() by mavenCentral().
good luck

ERROR: Could not find com.android.tools.build:gradle:3.4.1

I am trying to update my Android project.
I initially got this error:
ERROR: Gradle DSL method not found: 'classpath()'
Possible causes:
The project 'xxx' may be using a version of the Android Gradle plug-in that does not contain the method (e.g. 'testCompile' was added in 1.1.0).
Upgrade plugin to version 3.4.1 and sync project
So I tried this in my app's build.gradle:
buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'com.android.tools.build:gradle:3.4.1'
classpath 'io.fabric.tools:gradle:1.29.0'
}
}
But now I'm getting this error:
ERROR: Could not find com.android.tools.build:gradle:3.4.1.
What to do? Thanks for your help.
It seems the current versions of the Android Gradle plugin are not added to Maven Central, but they are present on jcenter. Add jcenter() to your list of repositories and Gradle should find version
repositories {
....
jcenter()
...
}
buildscript {
repositories {
jcenter()
google()
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'com.android.tools.build:gradle:3.4.0'
}
}

Error: could not find com.google.gms:google-services:4.2.0

today I was trying to update com.google.gms:google-services to 4.2.0 from 4.1.0 as it's the latest version and recommended by firebase. But I get this error:
Could not find com.google.gms:google-services:4.2.0.
Searched in the following locations:
https://jcenter.bintray.com/com/google/gms/google-services/4.2.0/google-services-4.2.0.pom
https://jcenter.bintray.com/com/google/gms/google-services/4.2.0/google-services-4.2.0.jar
https://dl.google.com/dl/android/maven2/com/google/gms/google-services/4.2.0/google-services-4.2.0.pom
https://dl.google.com/dl/android/maven2/com/google/gms/google-services/4.2.0/google-services-4.2.0.jar
https://maven.fabric.io/public/com/google/gms/google-services/4.2.0/google-services-4.2.0.pom
https://maven.fabric.io/public/com/google/gms/google-services/4.2.0/google-services-4.2.0.jar
Required by:
project :
And here is my project's build gradle:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
google()
maven {
url 'https://maven.fabric.io/public'
}
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
classpath 'com.google.gms:google-services:4.2.0'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4'
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
// These docs use an open ended version so that our plugin
// can be updated quickly in response to Android tooling updates
// We recommend changing it to the latest version from our changelog:
// https://docs.fabric.io/android/changelog.html#fabric-gradle-plugin
classpath 'io.fabric.tools:gradle:1.27.0'
}
}
allprojects {
repositories {
jcenter()
maven {
url 'https://maven.google.com/'
}
google()
}
}
UPDATE:
As Doug Stevenson said the dependency is now up and running so just use google() in your repositories.
If you have any problems with other google repositories (firebase, exoplayer) you can track the issue progress here.
Because google-services:4.2.0 is not available at Central Repository, so it needs to be downloaded from Android Tools Repository. To add this to your project add
maven { url 'https://dl.bintray.com/android/android-tools' }
this to buildscript repositories. For more refer to https://mvnrepository.com/artifact/com.google.gms/google-services/4.2.0
buildscript {
repositories {
jcenter()
google()
maven {
url 'https://maven.fabric.io/public'
}
// Add this to your project
maven { url 'https://dl.bintray.com/android/android-tools' }
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
classpath 'com.google.gms:google-services:4.2.0'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4'
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
// These docs use an open ended version so that our plugin
// can be updated quickly in response to Android tooling updates
// We recommend changing it to the latest version from our changelog:
// https://docs.fabric.io/android/changelog.html#fabric-gradle-plugin
classpath 'io.fabric.tools:gradle:1.27.0'
}
}
allprojects {
repositories {
jcenter()
maven {
url 'https://maven.google.com/'
}
google()
}
}
Monday December 10 2018, 1:30PM PST
The Google Play services plugin, the Firebase Performance monitoring plug, exoplayer, and possible other dependencies were found to be missing on jCenter. It's not clear why, but some of the teams are known to be moving their build artifacts to the Google maven repo.
As of right now, the Google Play services plugin has been migrated, and should be available through google() in your buildscript for now.
Try this, work for me:
buildscript {
repositories {
google()
//jcenter()
jcenter {url 'https://dl.bintray.com/android/android-tools'}
jcenter {url 'https://firebase.bintray.com/gradle'}
mavenCentral ()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
classpath 'com.google.gms:google-services:4.2.0'
classpath 'com.google.firebase:firebase-plugins:1.1.5'
}
}
allprojects {
repositories {
google()
//jcenter()
jcenter {url 'https://dl.bintray.com/android/android-tools'}
jcenter {url 'https://firebase.bintray.com/gradle'}
mavenCentral ()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
google-services:4.2.0 is now back on google maven repository, just sync gradle with default config:
allprojects {
repositories {
google()
jcenter()
}
}

Couldn't locate lint-gradle-api-26.1.2.jar for Flutter project

I'm new to Flutter and trying to run the example project when you create a new one. When trying to run it, I have this issue:
FAILURE: Build failed with an exception.
Where:
Build file 'PROJECTPATH/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
I understand it's trying to get the file "lint-gradle-api-26.1.2.jar" from the jcenter repository but when following the link I get this:
{
"errors" : [ {
"status" : 404,
"message" : "Could not find resource"
} ]
}
So I added the Google repository in my build.gradle file:
buildscript {
repositories {
maven { url 'https://dl.google.com/' }
google()
jcenter()
}
...and I also succeed to get the file by following this link:
https://dl.google.com/dl/android/maven2/com/android/tools/lint/lint-gradle-api/26.1.2/lint-gradle-api-26.1.2.jar
...but I'm still getting the same error when trying to run my project, whether it is by using Visual Studio Code, Android Studio or with the CLI.
How do I force Gradle to download the file from the link I've found?
Here's how my build.gradle file looks like:
buildscript {
repositories {
//maven { url 'https://dl.google.com/dl/android/maven2/com/android/tools/lint/lint-gradle-api/26.1.2/lint-gradle-api-26.1.2.jar' }
repositories {
google()
maven { url 'https://maven.fabric.io/public' }
mavenCentral()
jcenter()
}
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.2'
}
}
allprojects {
repositories {
google()
maven { url 'https://maven.fabric.io/public' }
mavenCentral()
jcenter()
}
}
repositories {
google()
maven { url 'https://maven.fabric.io/public' }
mavenCentral()
jcenter()
}
....
I solved the problem by moving:
maven {
url 'https://dl.google.com/dl/android/maven2'
}
in the top of:
jcenter()
in the file: .flutter/packages/flutter_tools/gradle/flutter.gradle:
buildscript {
repositories {
maven {
url 'https://dl.google.com/dl/android/maven2'
}
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.2'
}
}
Modify flutter.gradle under ./flutter/packages/flutter_tools/gradle to upgrade the tools version to 3.2.1 and add google() to the first line:
buildscript {
repositories {
google()
jcenter()
maven {
url 'https://dl.google.com/dl/android/maven'
}
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
}
}
Screenshot of my code
Regarding this error, I just changed this line in the build.gradle file:
classpath 'com.android.tools.build:gradle:3.1.2'
to:
classpath 'com.android.tools.build:gradle:3.1.3'
And that solved my problem.
This is just a bug in the Gradle file located at C:\flutter\packages\flutter_tools\gradle\flutter.gradle at line 25.
All you have to do is just edit this file by moving it to the top:
maven {
url 'https://dl.google.com/dl/android/maven2'
}
Change from this
buildscript {
repositories {
jcenter()
maven {
url 'https://dl.google.com/dl/android/maven2'
}
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.2'
}
}
to this:
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 is related to Flutter 0.9.4 at the moment. It will be fixed in the next release. In the meantime, you can update Flutter manually by running the commands described in "Flutter Upgrade". Basically they involve the following:
Change the Flutter GitHub channel to master by running on the command prompt:
flutter channel master
Upgrade Flutter itself by running
flutter upgrade
Once the upgrade is done, run the test drive application, and it should compile successfully.
Solution:
Put
maven {
url 'https://dl.google.com/dl/android/maven2'
}
at the top of:
jcenter()
in the file: .flutter/packages/flutter_tools/gradle/flutter.gradle :
The file is in the Flutter SDK.
this fixed my issue,SO reference here:
In your root build.gradle make sure google() is before jcenter().
repositories {
google()
jcenter()
}
In most projects you will have to update this at 2 spots.
buildscript {
repositories {
google()
jcenter()
}
}
allprojects {
repositories {
google()
jcenter()
}
}
All the previous answers resolve the problem. One comment to add is the location of the flutte.gradle.
You will find it in the directory that you installed Flutter in for the first time and not on the Flutter project.
Flutter Master Upgrade
I just had this problem. The fix for me however was a lot simpler. After switching branches to dev and upgrading, I switched back to master and it worked perfectly fine.
flutter checkout dev
flutter upgrade
Then switch back
flutter checkout master
flutter upgrade
flutter run
Just try to upgrade Flutter using the following:
flutter upgrade
(This issue has been fixed in the latest update.)
I also newbie in flutter and just installed it today. And I found the same problem as you, but after three hours googling I finally solved it.
The steps I have done are as follows:
Copy "flutter.gradle" file from "https://github.com/flutter/flutter/blob/master/packages/flutter_tools/gradle/flutter.gradle" into "C:\flutter\packages\gradle"
Then modify the content, for this part:
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
}
}
to:
buildscript {
repositories {
maven {
url 'https://dl.google.com/dl/android/maven2'
}
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
}
}
In "c:\flutter\bin", run this command:
flutter channel master
Wait until finished, and then run this command:
flutter upgrade
Wait until it finished, then re-run the project to debug,
and finally the application appeared on the emulator screen.
Picture finally running
For me, opening the gradle-wrapper.properties file and editing the below line like this version solved it:
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-all.zip
When I encountered this error Flutter 1.0 had been released. The previous issues were fixed and still I was getting the same error.
The following steps fixed it for me :
1) Changing Gradle plugin version from 3.1.2 to 3.2.1 in your_project/android/build.gradle inside 'dependencies' section -
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
}
2) Changing Gradle wrapper version from 4.4 to 4.6 in your_project/android/gradle/wrapper/gradle-wrapper.properties like so
distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip
I have fix just by replacing these sentences:
allprojects {
repositories {
mavenCentral()
jcenter()
maven {
url 'https://maven.google.com/'
name 'Google'
}
}
}
instead of these:
allprojects {
repositories {
jcenter()
google()
}
}
in build.gradle file and then replace compile with implementation in dependencies
I have fix it with update version build.gradle
dependencies {
classpath 'com.android.tools.build:gradle:3.3.2'
..............
}

android studio terminal not install gradlew

im trying too use commad "gradlew install" in android studio 3.0 terminal but it fails and show errors. any one an help?
my gradle configuration at top level like this:
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.2'
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.0'
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Did you follow the steps properly for setting up Bintray?
I think you have missed the below step
https://github.com/bintray/gradle-bintray-plugin#gradle--21
And one more problem in downloading gradle plug-in is, you haven't added maven url in buildscript -> repositories and allprojects -> repositories sections.
maven {
url 'https://maven.google.com'
}
I hope this information helps you.

Categories

Resources