Error:FAILURE: Build failed with an exception.
What went wrong: Execution failed for task ':app:clean'.
Unable to delete directory: /media/user/7EA01F5FA01F1CE9/GitWorkSpace/Myapplication/app/build/intermediates/exploded-aar/com.android.support/animated-vector-drawable/23.3.0/jars
Try: Run with --stacktrace option to get the stack trace. Run with
--debug option to get more log output.
How to fix this issue in android studio? Whenever i'm trying to take build in different emulator i have to delete manually build folder inside the app then only i can successfully build the application.
How to fix this issue permanently?
I have faced the same problem, my android studio version 2.0 and OS Ubuntu. So, far I didn't found any permanent solution and this problem is current IDE version. You can also check details from here:
https://code.google.com/p/android/issues/detail?can=2&start=0&num=100&q=&colspec=ID%20Status%20Priority%20Owner%20Summary%20Stars%20Reporter%20Opened&groupby=&sort=&id=206219
So, you can use lower IDE version temporarily (I know this is not a good solution)
Related
I want to run a flutter application that I wrote on Visual Studio Code on the device. However, when I do this, I always get the following error. Normally this wouldn't happen, it's just starting to happen. I'm not entirely sure what I should do.
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:compileDebugKotlin'.
> Kotlin could not find the required JDK tools in the Java installation '/usr/lib/jvm/oracle-java8-jre-amd64' used by Gradle. Make sure Gradle is running on a JDK, not JRE.
* 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
BUİLD FAILED in 45s
Exception: Gradle task assembleDebug failed with exit code 1
OS : Ubuntu
Mobile Device : Samsung J500F
Android Version : 6.0.1
You need to have installed a JDK. Depending on which version of Ubuntu you should just be able to do sudo apt install openjdk-8-jre-headless
That said, I would target a higher Java version, if I were you, maybe 11?
Either way, if you look at the path your JRE is in, it's '/usr/lib/jvm/oracle-java8-jre-amd64'
You don't want to be using the regular JRE to build/run your application. You want to build and run with openjdk. That's why your error message says,
"Make sure Gradle is running on a JDK, not JRE."
The message Execution failed for task ':app:compileDebugKotlin' and the Gradle issue indicate that your problem is not about Flutter but about Android, and more precisely about the lack of JDK (which allows to execute Java and Kotlin code).
To solve this problem, it is necessary to review the configuration of your project.
I advise you if possible to use Android Studio, an IDE recommended by Android developers and that will make things much easier with Android and Flutter.
This article from the official Android documentation and this one from JetBrains should help you solve your problem.
You can install Android Studio from snap store or zip
Trying to start programming Dart in Flutter. I wanted to work with VSCode instead of Android Studio, but when debug session starts I get the following problems.
I tried everything here in this link such as deleting the caches, deleting lock file, kill PID Task in cmd, but nothing works.
However, I'm able to run the test app in Android Studio, but still, I wanted to learn via VSCode. It will be great if you can share any suggestion that might help :)
Thanks!
FAILURE: Build failed with an exception.
* What went wrong:
Gradle could not start your build.
> Could not create service of type FileHasher using BuildSessionServices.createFileHasher().
> Unexpected lock protocol found in lock file. Expected 3, found 0.
* 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
Flutter SDK: windows 1.17.1 (from the website)
Android Studio: 3.6.3
Able to solve my own problem. Apparently, when I first sync the demo app in VSCode, it started to download package from gradle 5.62, whereas 6.4 available in my machine. Which then I changed the setting and distributionUrl thingy to that version 6.4 . And when I started to run it, that error stated in the question surfaced.
What I did was:
Go to project level .gradle file (app> android> .gradle)
Delete the file of gralde of the other version
Go to the gradle folder of the 6.4 version, delete the lock file in caches/filehashes
restart
In android/app/build.gradle
Try changing minSdkVersion to 21
I had same issue this worked
For Windows machine:
Open Task Manager(Ctrl-Alt-Delete and check Process)
-> Close All instances of Android Studio/VS Code (End Task)
-> Close Emulator (if Running)
-> Then close OpenJDK Platform Binary
it will work now
Hi I'm following the guidelines of https://rnfirebase.io/docs/v3.1.x/installation/initial-setup to install firebase for React Native. I'm using an Android Emulator.
After everything is done I cannot start the application. That's what happens when starting the app via 'react-native run-android':
Parsing json file: C:\Users\Studium\WebstormProjects\app-programming\android\app\google-services.json
:app:processDebugGoogleServices FAILED
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':app:processDebugGoogleServices'.
Failed to create folder: C:\Users\Studium\WebstormProjects\app-programming\android\app\build\generated\res\google-services\debug
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 25.864 secs
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
Does someone know what I did wrong?
In firebase console, you can get google-services.json file and place it in android/app directory and get googleServices-info.plist file and place it in /ios directory
if you want to use analytics only use firebase analytics it works for me.
I'm manually installing an Android-Gradle build server which means that I'm not using Android Studio SDK but instead using the android update sdk command to install the required tools.
I was able to install most of the packages which are required for the build to finish successfully but there are some tools which I'm unable to find:
com.android.support.constraint:constraint-layout:1.0.0-alpha(1-4)
com.android.support.constraint:constraint-layout-solver:1.0.0-alpha(1-4)
Following #CommonsWare comment, here's the output of the build (which shows that the tools are being looked for at the repositories automatically but not found:
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring project ':Company'.
> Could not resolve all dependencies for configuration ':Company:_productionDebugCompile'.
> Could not find com.android.support.constraint:constraint-layout:1.0.0-alpha4.
Searched in the following locations:
https://jcenter.bintray.com/com/android/support/constraint/constraint-layout/1.0.0-alpha4/constraint-layout-1.0.0-alpha4.pom
https://jcenter.bintray.com/com/android/support/constraint/constraint-layout/1.0.0-alpha4/constraint-layout-1.0.0-alpha4.jar
http://dl.bintray.com/optimizely/optimizely/com/android/support/constraint/constraint-layout/1.0.0-alpha4/constraint-layout-1.0.0-alpha4.pom
http://dl.bintray.com/optimizely/optimizely/com/android/support/constraint/constraint-layout/1.0.0-alpha4/constraint-layout-1.0.0-alpha4.jar
file:/Users/itai/work_repos/Company-Android_fork/.gradle/android-sdk-linux/extras/android/m2repository/com/android/support/constraint/constraint-layout/1.0.0-alpha4/constraint-layout-1.0.0-alpha4.pom
file:/Users/itai/work_repos/Company-Android_fork/.gradle/android-sdk-linux/extras/android/m2repository/com/android/support/constraint/constraint-layout/1.0.0-alpha4/constraint-layout-1.0.0-alpha4.jar
file:/Users/itai/work_repos/Company-Android_fork/.gradle/android-sdk-linux/extras/google/m2repository/com/android/support/constraint/constraint-layout/1.0.0-alpha4/constraint-layout-1.0.0-alpha4.pom
file:/Users/itai/work_repos/Company-Android_fork/.gradle/android-sdk-linux/extras/google/m2repository/com/android/support/constraint/constraint-layout/1.0.0-alpha4/constraint-layout-1.0.0-alpha4.jar
Required by:
Company-Android_fork:Company:unspecified
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 15.163 secs
Any idea how they can be installed manually (not through Android Studio)?
Thanks in advance,
Now you can install it through command line:
your_sdk_location/tools/bin/sdkmanager "extras;m2repository;com;android;support;constraint;constraint-layout;1.0.2"
It is not possible without Android Studio 2.2 Beta yet, but if you have it somewhere, then you just need to copy the m2repository from your sdk/extras to your project sdk/extras folder.
So if you have your project built in an Android Studio:
check the project's sdk location (File/Project Structure : SDK location).
go to your_sdk_location/extras folder and copy m2repository
paste the folder to your existing project's sdk/extras folder.
rebuild your project.
I've been banging my head on the wall for about a week trying to solve this issue.
I've recently started work on an app using the Ionic Framework, and I keep getting the following error:
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'android'.
> Could not resolve all dependencies for configuration ':classpath'.
> Could not resolve com.android.tools.build:gradle:1.0.0+.
Required by:
:android:unspecified
> Failed to list versions for com.android.tools.build:gradle.
> Unable to load Maven meta-data from http://repo1.maven.org/maven2/com/android/tools/build/gradle/maven-metadata.xml.
> Failure initializing default system SSL context
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
I've done some extensive Googling, wherein people have suggested removing some gradle config files from ~/.gradle, making sure my Android SDK is updated, and quite a lot about corporate proxies. Well, I deleted the configs and re-generated them, I've updated EVERYTHING in my SDK, and I am not using a proxy of any kind (at least I have not gone out of my way to set any up).
When I ping http://repo1.maven.org, I get:
ping: unknown host http://repo1.maven.org
However, I can type the address into the address bar on Chrome and it will show me the file(s).
It is very important for me to get this working, as it's for my Senior Capstone project at University. If anyone has any ideas, I am willing to try.
Thank you in advance!
Also make sure "Google Repository" from your Android SDK is installed. You will find this under Extras section.
I solved the issue by replacing my openjdk installation with Oracle's jdk, and updating my Android SDK with:
android update sdk --no-ui --filter extra
Apparently the GUI wasn't showing all extra options, even though I told it to reload several times.