how do i solve this Build failed in adroid studio? - android-studio

I keep getting Build failed each time i try to run my app in android studio.
here is what i get each time i run the app
Execution failed for task ':app:mergeDebugResources'.
Could not resolve all files for configuration ':app:_internal_aapt2_binary'.
Could not resolve com.android.tools.build:aapt2:3.6.3-6040484.
Required by:
project :app
> No cached version of com.android.tools.build:aapt2:3.6.3-6040484 available for offline mode.
> No cached version of com.android.tools.build:aapt2:3.6.3-6040484 available for offline mode.
Please can somebody help me? thanks

Maybe you should try to disable gradle offline mode and try again

Related

After Android Studio update. Could not parse POM, Could not resolve all files for configuration ':app:_internal_aapt2_binary'

Hello I've been looking to other similar questions about this problem but none has helped me so far, after I updated to android studio to the new version 3.6.2 I have this error when I try to run any project.
Run info:
Execution failed for task ':app:mergeDebugResources'.
Could not resolve all files for configuration ':app:_internal_aapt2_binary'.
Could not resolve com.android.tools.build:aapt2:3.6.2-6040484.
Required by:
project :app
Could not resolve com.android.tools.build:aapt2:3.6.2-6040484.
Could not parse POM https://dl.google.com/dl/android/maven2/com/android/tools/build/aapt2/3.6.2-6040484/aapt2-3.6.2-6040484.pom
Content is not allowed in prolog.
Before the update the project was able to build now none of my projects build.
I tried invalidate cache and restart, I checked that I was not running in offline mode. still have the same failure. Any idea whay this could be and how I could fix it?
if you have problem with gradle
change your android stadio version to 3.6.2 or lower
file>project Strcture>
change to 3.6.2 and OK
I fixed the Error by going to my username and deleting .gradle, .AndroidStudio3.6 and .AndroidStudio3.5 folders. after I restarted android studio to download the folders again and resetting them. It worked.

Gradle Build Failed after updating android studio from 3.6.1 to 3.6.2

I have recently updated my ide and when I tried to run my old code that I have written before updating ide, it started showing a message that is below:
FAILURE:Build failed with a exception.
What went wrong: Execution failed for the task ':app:mergeDebugResources'.
Could not resolve all files for configuration ':app:_internal_aapt2_binary'.
Could not resolve com.android.tools.build:appt2:3.6.2-6040484. Required by:
project :app
No cached version of com.android.tools.build:appt2:3.6.2-6040484 available for offline mode.
No cached version of com.android.tools.build.appt2:3.6.2-6040484 available for offline mode.
So what's the problem in it and one more thing is that I have enabled the toggle offline mode and even after connecting to the network it's not running and showing the same message.
Plz reply soon.

Can't run or build my simple app on offline mode

I dont have internet connection at my place and im new to this android studio version. I was able to toggle the offline mode but still no luck.
error output here
ALSO the settings of my gradle is incomplete. photos attached.
Thanks guys!
Execution failed for task ':app:mergeDebugResources'.
Could not resolve all files for configuration ':app:_internal_aapt2_binary'.
Could not resolve com.android.tools.build:aapt2:3.6.1-6040484.
Required by:
project :app
No cached version of com.android.tools.build:aapt2:3.6.1-6040484 available for offline mode.
No cached version of com.android.tools.build:aapt2:3.6.1-6040484 available for offline mode.
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
The offline mode only works if you have resolved once all the dependencies of the project.
If there are missing dependencies that have not been downloaded to your local machine once, they cannot be retrieved from the dependency cache.
So the only solution is to execute at least once the project with an internet connection.

Gradle build error using react native

I get this error when trying to run an app on an android emulator(Android Studio) from a console window:
$ react-native run-android
Scanning folders for symlinks in C:\Users\Brian\desktop\codervets\arrive-alive\aa_app\node_modules (27726ms)
Starting JS server...
Building and installing the app on the device (cd android && gradlew.bat installDebug)...
Starting a Gradle Daemon (subsequent builds will be faster)
Configuration 'compile' in project ':app' is deprecated. Use 'implementation' instead.
FAILURE: Build failed with an exception.
What went wrong:
A problem occurred configuring project ':app'.
The SDK directory 'c:\Users\eelia001\AppData\local\android\sdk1' does not exist.
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
Get more help at https://help.gradle.org
BUILD FAILED in 4m 51s
Could not install the app on the device, read the error above for details.
Make sure you have an Android emulator running or a device connected and have
set up your Android development environment:
https://facebook.github.io/react-native/docs/android-setup.html
And yet my sdk directory in android studio has the following directory:
C:\Users\Brian\AppData\Local\Android\Sdk
Has anyone else ran into this issue? If so, how do I fix it?
The error states:
The SDK directory 'c:\Users\eelia001\AppData\local\android\sdk1' does not exist.
And you say your SDK is in:
C:\Users\Brian\AppData\Local\Android\Sdk
Since those aren't the same directory, my guess is that's the problem. Are you perhaps logged in as the wrong user? You're going to want to check that ANDROID_HOME is set correctly.
So I'm not sure why it was setup the way it was, but the way to fix it is to go to Advanced System Settings → Environment variables. Thank you to #Rich Churcher for the link to a proper tutorial (it's outdated but the steps worked).

Error:Execution failed for task ':app:validateSigningDebug'. > com.android.ide.common.signing.KeytoolException: Failed to create keystore

I downloaded an android studio project from Github. Whenever I try to import and run this on my android studio with Genymotion emulator, I get this error. Why I am getting this? .
Error : Execution failed for task ':app:validateSigningDebug' com.android.ide.common.signing.KeytoolException: Failed to create keystore.
Finally I found a solution. I enabled Instant run and it worked for me. Reason might be a code issue.

Resources