Android Studio Error : Could not find Android Buld Tools - java

So, My Friend who is in University wanted me to check out his Application,
He sent me the Project File and When I tried to Run it I was greeted with an Error Message that Detailed.
Could not Find com.android.tools.build:aapt2:3.3.2-5309881.
Any Help would be Highly Appreciated (:
Required by:
project: app

AAPT2 moved to Google's Maven repository, to use AAPT2, make sure that you have a google() dependency in your build.gradle file, as shown here:
buildscript {
repositories {
google() // here
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.3.2'
}
}
allprojects {
repositories {
google() // and here
jcenter()
}
See: https://developer.android.com/studio/releases/#aapt2_gmaven

Related

Could not GET 'https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/4.0.1/gradle-4.0.1.pom'

I got the following problem after updating the Gradle. I was not able to find any solution for it.
So please help me to solve the following problem.
Thanks in advance...
(PROBLEM-----Could not GET 'https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/4.0.1/gradle-4.0.1.pom'. Received status code 406 from server: Not Acceptable)
My build.gradle file...
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.0.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
you should set build.gradle(project level)
classpath 'com.android.tools.build:gradle:4.0.1'
and in gradle-wrapper.properties file
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip
then sync again project.
Android Gradle plugin 4.1.0 is not release yet. see on Google's Maven Repository. Try classpath 'com.android.tools.build:gradle:4.1.0-rc02' if you want to use 4.1.0.

Android Gradle dependency error for "com.otaliastudios:cameraview:2.0.0-rcl"?

I'm trying to follow the steps applied in this video to implement "QR Code reader with Firebase ML in real time".
While adding this line in dependencies,
implementation 'com.otaliastudios:cameraview:2.0.0-rcl'
I got the following error
ERROR: Failed to resolve: com.otaliastudios:cameraview:2.0.0-rcl
implementation 'com.otaliastudios:cameraview:2.0.0-rcl'
Is that an L on the end ... it should be 1.
Try:
implementation 'com.otaliastudios:cameraview:2.0.0-rc1'
Update your project gradle
buildscript {
repositories {
jcenter()
google()
}
}
allprojects {
repositories {
jcenter()
google()
}
}
After clean project and sync gradle again.

Could not find com.android.tools.build:gradle:3.5.1

I'm totally new to android studio and came up to this error that says it can not download gradle-3.5.1.pom and gradle-3.5.1.jar from google or jcenter repositories. But when I tried downloading them manually it was easy and straight forward though.
Here is the error text :
ERROR: Could not find com.android.tools.build:gradle:3.5.1.
Searched in the following locations:
- https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/3.5.1/gradle-3.5.1.pom
- https://dl.google.com/dl/android/maven2/com/android/tools/build/gradle/3.5.1/gradle-3.5.1.jar
- https://jcenter.bintray.com/com/android/tools/build/gradle/3.5.1/gradle-3.5.1.pom
- https://jcenter.bintray.com/com/android/tools/build/gradle/3.5.1/gradle-3.5.1.jar
Required by:
project :
Open File
I know that this is going to make me crazy because these gradle stuff always been a problem to all.
Make sure you have google() repo in your project's level build.gradle file.
Here's an example:
build.gradle
buildscript {
repositories {
google() // check if you have this
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.1'
}
}
allprojects {
repositories {
google() // and this
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Disable Offline Work in Android studio if you have enabled the checkbox and sync project.
Once the project is synced, you can enable the checkbox and run the app as long as you do not add another dependency manually.
It will automatically download the required dependencies.
File>Settings>Build>Gradle

Android Studio Error "lint-gradle-api-26.1.2 not found

When I run my App, AS comes up with this error. Says that the file was not found at https://repo.jfrog.org/artifactory/libs-release-bintray/com/android/tools/lint/lint-gradle-api/26.1.2/lint-gradle-api-26.1.2.jar?referrer. Please help! Putting google() repo doesn't work.
I ran into this issue as well. Basically, the issue is that mentioned jar file is no longer in jcenter. I resolved by changing the order of search in our app build.gradle:
buildscript {
repositories {
maven {
url 'https://dl.google.com/dl/android/maven2'
}
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.2'
}
}
allprojects {
repositories {
google()
jcenter()
}
}

Why does gradle try to download a Kotlin compiler during :app:lint?

I was trying to gradle build a plain Java Android project. It was an ADT project imported to Android Studio. To my astonishment, at one point Gradle tried to download the Kotlin compiler!
* What went wrong:
Execution failed for task ':app:lint'.
> Could not resolve all files for configuration ':app:lintClassPath'.
> Could not download kotlin-compiler.jar (com.android.tools.external.com-intellij:kotlin-compiler:26.2.0)
> Could not get resource 'https://dl.google.com/dl/android/maven2/com/android/tools/external/com-intellij/kotlin-compiler/26.2.0/kotlin-compiler-26.2.0.jar'.
> Read timed out
Why the heck did gradle attempt downloading a big package like the Kotlin compiler
How do I prevent that?
More generally, how do make gradle ask me before it tries to download anything or at least prevent it from downloading non-dependencies? Such things should be installed by my distro's package manager, after all!
1) Because Gradle supports linting Kotlin code, which requires parsing it, which is implemented using classes in the Kotlin compiler.
2) By not using the lint task I guess?
3) The Kotlin compiler is a dependency. Gradle requires a specific version of this dependency in a specific layout and in a specific location, and it can't use a version installed by your package manager.
change
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
}
}
allprojects {
repositories {
google()
jcenter()
}
}
to
buildscript {
repositories {
google()
maven {
url "https://maven2.google.com"
}
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
}
}
allprojects {
repositories {
google()
maven {
url "https://maven2.google.com"
}
jcenter()
}
}

Categories

Resources