> Could not resolve all files for configuration ':app:_internal_aapt2_binary' - android

i tried to build and i got this error
Execution failed for task ':app:mergeDebugResources'.
Could not resolve all files for configuration ':app:_internal_aapt2_binary'.
Could not find aapt2-4.1.2-6503028-windows.jar (com.android.tools.build:aapt2:4.1.2-6503028).
Searched in the following locations:
https://dl.google.com/dl/android/maven2/com/android/tools/build/aapt2/4.1.2-6503028/aapt2-4.1.2-6503028-windows.jar
Possible solution:
Declare repository providing the artifact, see the documentation at https://docs.gradle.org/current/userguide/declaring_repositories.html
that's my build gradle
buildscript {
repositories {
google()
mavenCentral()
}
dependencies {
classpath "com.android.tools.build:gradle:4.1.2"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
mavenCentral()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
build gradle version: 6.4
how can i fix this?

Please check if you have an active internet connection
There was a failed download most probably
You can also try disabling the offline mode for gradle
Look Here
In the above image,Toggle offline mode sign

Related

Could not find aapt2-4.1.3-6503028-windows.jar in Android Studio

I'm traying to run my app in android studio but I have this error:
Execution failed for task ':app:mergeDebugResources'.
> Could not resolve all files for configuration ':app:_internal_aapt2_binary'.
> Could not find aapt2-4.1.3-6503028-windows.jar (com.android.tools.build:aapt2:4.1.3-6503028).
Searched in the following locations:
https://dl.google.com/dl/android/maven2/com/android/tools/build/aapt2/4.1.3-6503028/aapt2-4.1.3-6503028-windows.jar
Possible solution:
- Declare repository providing the artifact, see the documentation at https://docs.gradle.org/current/userguide/declaring_repositories.html
My build.gradle is:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.1.3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
mavenCentral()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
I tried toggle offline mode but I have same error. and I can download it manually from the link in the error but in android studio not

Could not find com.twitter.sdk.android:twitter:2.2.0

I am using Android Studio 4.1. For some reason, it is failing to run my project. Below is the error I am getting. (I'm not even sure as to why it's asking me for the Twitter SDK, yet I don't use it anywhere in my app.)
Execution failed for task ':app:checkDebugAarMetadata'.
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
> Could not find com.twitter.sdk.android:twitter:2.2.0.
Searched in the following locations:
- https://dl.google.com/dl/android/maven2/com/twitter/sdk/android/twitter/2.2.0/twitter-2.2.0.pom
- https://maven.google.com/com/twitter/sdk/android/twitter/2.2.0/twitter-2.2.0.pom
- https://jcenter.bintray.com/com/twitter/sdk/android/twitter/2.2.0/twitter-2.2.0.pom
Required by:
project :app > com.firebaseui:firebase-ui:1.0.1 > com.firebaseui:firebase-ui-auth:1.0.1
Possible solution:
- Declare repository providing the artifact, see the documentation at https://docs.gradle.org/current/userguide/declaring_repositories.html
build.gradle:
buildscript
{
repositories {
google()
maven {
url "https://maven.google.com"
}
jcenter()
}
dependencies {
classpath "com.android.tools.build:gradle:4.1.1"
classpath 'com.google.gms:google-services:4.3.4'
classpath 'com.android.tools.build:gradle:3.0.1'
}
}
allprojects {
repositories {
google()
maven {
url "https://maven.google.com"
}
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
I implemented the instructions in the link below to configure the Twitter Sign-in, The project runs fine now. But I can't fathom why it had to force me to use Twitter.
I also updated my Firebase UIto 7.1.1
https://firebase.google.com/docs/auth/android/firebaseui

:app:mergeDebugAssets > unable to create new thread when updating to Android Studio 3.0.1

I was building a project with a previous version of Android Studio and I decided to update it. So once I updated it I keep getting the same error on application Run (not on clear, not on synching grandle). The error is the following:
Error:Execution failed for task ':app:mergeDebugAssets'. > unable to create new native thread
I tried to clean and build again. I tried to change studio.vmoptions but none of them worked for me.
Here is the full build.gradle file:
// Top-level build file where you can add configuration options common to all
sub-projects/modules.
buildscript {
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
google()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Pls update distributionUrl=https://services.gradle.org/distributions/gradle-4.1-all.zip in gradle-wrapper.properties file at gradle folder then rebuild your project.

Cannot find the firebase:crash-plugin:1.1.0

I have been trying to add the firebase performance dependency, I followed
Get Started with Firebase Performance Monitoring for Android
guide
I have added in the top gradle file the classpath 'com.google.firebase:firebase-plugins:1.1.0' and the jcenter() repository.
But I am getting the following error that the com.google.firebase:firebase-plugins:1.1.0 dependency cannot be found.
Also I have the latest version of the google play services(40) and the google repository(51) installed.
Here is my top build.gradle file:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.2'
classpath 'com.google.gms:google-services:3.0.0'
classpath 'com.google.firebase:firebase-plugins:1.1.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
maven { url "https://jitpack.io" }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Here is the error message:
Error:Could not find com.google.firebase:crash-plugin:1.1.0. Searched in the following locations:
file:/Applications/Android Studio.app/Contents/gradle/m2repository/com/google/firebase/crash-plugin/1.1.0/crash-plugin-1.1.0.pom
file:/Applications/AndroidStudio.app/Contents/gradle/m2repository/com/google/firebase/crash-plugin/1.1.0/crash-plugin-1.1.0.jar
https://jcenter.bintray.com/com/google/firebase/crash-plugin/1.1.0/crash-plugin-1.1.0.pom
https://jcenter.bintray.com/com/google/firebase/crash-plugin/1.1.0/crash-plugin-1.1.0.jar Required by: project : > com.google.firebase:firebase-plugins:1.1.0
Unfortunately the plugin was not yet approved on bintray.
It has now been approved, so if you try again it should work!

error with gradle 2.2.1

I updated Android Studio to 1.4.1 version. gradle sync said needs to version 2.2.1.
I downloaded gradle 2.2.1 and in file-->settings-->gradle set use default gradle wrapper and in 'project location/gradle/wrapper/gradle-wrapper.properties' set distributionUrl=https://services.gradle.org/distributions/gradle-2.2.1-all.zip.
but android studio has errors:
Error:A problem occurred configuring root project 'Scanner'.
Could not resolve all dependencies for configuration ':classpath'.
Could not resolve com.android.tools.build:transform-api:2.0.0-deprecated-use-gradle-api.
Required by:
:Scanner:unspecified > com.android.tools.build:gradle:2.2.1 > com.android.tools.build:gradle-core:2.2.1
Could not resolve com.android.tools.build:transform-api:2.0.0-deprecated-use-gradle-api.
Could not parse POM https://jcenter.bintray.com/com/android/tools/build/transform-api/2.0.0-deprecated-use-gradle-api/transform-api-2.0.0-deprecated-use-gradle-api.pom
Content is not allowed in prolog.
what is problem? and how can solve this?
gradle file:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
If you are behind a proxy, try Gradle proxy configuration. From the error log you posted it looks like gradle is not able to resolve addresses. Make sure gradle has internet access.
Also you can try the following change in jcenter().
buildscript {
repositories {
jcenter {
url "http://jcenter.bintray.com/"
}
}
}
allprojects {
repositories {
jcenter {
url "http://jcenter.bintray.com/"
}
}
}
This many a times fixes the issue.

Categories

Resources