Erro Could not find crash.jar in Android studio - android-studio

I'm having trouble finding no solution.
Please help if someone knows
Unexpected error occurred
Description in the picture below
Could not find crash.jar (com.android.tools.analytics-library:crash:26.2.1).
Searched in the following locations:
https://dl.google.com/dl/android/maven2/com/android/tools/analytics-library/crash/26.2.1/crash-26.2.1.jar
enter image description here
enter image description here

Delete all file ( .androidstudio .gradle) from user folder and open again android studio.
(sure when delete files android studio colsed.)

Deleting ~/.gradle ( in mac os ) should be enough. ( and make sure android studio is fully closed! )
For windows it's in C:/Users/YourUserName/
For me this error happened because network issue during downloading gradle stuff.. so after removing that directory everything works fine now.

Related

The specified Gradle distribution 'https://services.gradle.org/distributions/gradle-7.2-bin.zip' does not exist

In Android Studio, I am getting the following error when trying to run my app on an Android device:
The specified Gradle distribution 'https://services.gradle.org/distributions/gradle-7.2-bin.zip' does not exist.
All my Android Studio projects are affected by this and restoring them to older commits does not change anything.
The problems all started by following the advice given here: Could not install Gradle distribution from 'https://services.gradle.org/distributions/gradle-2.1-all.zip'
I deleted everything in my /.gradle/wrapper/dists/ folder. Now, I get the above error and I do not see how to solve it.
Here is how to reproduce it with Android Studio 2021.1.1 on Windows (but be warned: this might corrupt your projects, too):
Delete everything in /.gradle/wrapper/dists/
Create a new project "Test" in Android Studio (this might take a while, since gradle-7.2-bin.zip will be downloaded in the dists folder)
The project builds and runs without errors
Close Android Studio
Delete everything in /.gradle/wrapper/dists/ again
Open project "Test" in Android Studio
Try to run
Now you should get the above mentioned error.
At this point, /.gradle/wrapper/dists/ is still empty. Now you can do the following:
run gradlew tasks in Terminal in the Project Folder of "Test" (this will take a while, since gradle-7.2-bin.zip will be downloaded in the dists folder again)
run gradlew build (everything should build without errors)
But clicking on "Run" still yields the same error.
I am getting the impression that this is an AndroidStudio / IntelliJ bug.
Can anyone help me with this?
Running Android Studio as Administrator solved the problem for me
It turned out my Android Studio installation was heavily corrupted. Simply, uninstalling it and installing it again also did not help.
I basically had to do everything that was suggested here: How to completely uninstall Android Studio from windows(v10)? and delete everything related to Android Studio. I installed it again and now everything is fine again.
I do not know what the problem was. Maybe the .m2 folder, maybe the Jetbrains folder.
My advice to everyone facing the same issue:
First try around deleting caching folders. If nothing helps, go for the brute force approach and follow the answers (not only the accepted answer) of the above mentioned StackOverflow question.

Gradle not working in android studio [flutter]

When I executed my code for the first time on the android studio ( flutter - dart project ) I got the below error
I tried deleting it from %HOME%.gradle
I even tried deleting and re-installing JDK but I'm still facing the same problem.
and here is a picture of my environment variables and path if it may help
what worked for me :
i changed my user name ( as you can see it was MystoGan!
) , it had an ' ! ' on it so i figured it might be the problem, so after changing it and completely deleting android studio, i installed it again and it worked

Flutter Error Failed to extract manifest from APK: Exit code -1073741515

Getting this error in android studio 3.5
Android Version 3.5
SDK 28
flutter latest version
Any one help me with this error? Getting this in windows 7 ultimate
Failed to extract manifest from APK: Exit code -1073741515 from: C:\Users\Shahryar Ahmed\AppData\Local\Android\sdk\build-tools\29.0.2\aapt dump xmltree C:\Users\Shahryar Ahmed\AndroidStudioProjects\flutter_app\build\app\outputs\apk\app.apk AndroidManifest.xml.
No application found for TargetPlatform.android_arm.
Is your project missing an android\app\src\main\AndroidManifest.xml?
Consider running "flutter create ." to create one.
Try to do a
flutter clean
This solved lots of problems for me
From Menu Goto Tools->Flutter->Flutter Clean.
as shown in below picture.
File->Invalidate Caches/Restart..
I encountered the same problem and I fixed it by deleting the app.apk in the build/app/ouputs/apk directory and it worked.
This problem happened to me .
and the error was that the file aapt.exe in this ( C:\Users\username\AppData\Local\Android\sdk\build-tools\29.0.2\aapt.exe) is opened by antivirus .
the solution is : stop the antivirus and run again it will work .
also :
you can double click on aapt.exe file , if it opened by another program it will show what is this program , so you can stop or close this program and run again .
Consider opening as administrator your android studio .exe
I went through the same problem. I just uninstalled previous build in my emulator and did flutter run again... worked for me.
After this answer:
https://stackoverflow.com/a/68142732/14409491
I uninstalled the antivirus
Then I deleted all folders in the build-tools in C:\Users\user\AppData\Local\Android\Sdk\build-tools
After that, downloaded build-tools again from android studio
I was also facing this issue while using VS Code, then I tried running on Android Studio because sometimes issues are related to emulator.
Though running flutter clean on the terminal from the project
directly seemed to solve my problem. after that also get(pub get) your dependencies to avoid further build errors.

AVD emulator error in android studio

I'm a newbie, my problem is when I try to make a new AVD I get this message :
"an error occurred while creating the avd. see idea.log for details"
I just downloaded android studio , dunno what to do
this is from the log file : unable to find a 'userdata.img' file for ABI x86 to copy into the avd folder
If you are in linux, try this:
sudo apt-get install lib32stdc++6
It worked for me!
You pasted x86_64 file inside the default folder
C:\Users\(User Name)\AppData\Local\Android\Sdk\system-images\android-29\default
Past it in android-29 folder not in default folder.
On windows:
Used 'Clone Device' option on device definition, it will add new device into list with appending '(edited)1' string.
select this clone device: press 'Next'
select this clone device: press 'Next'
select system image as per your requirement: press 'Next'
select 'Show Advance Setting' scroll down: in 'Memory and Storage' choose 'External file' (which is disable/gray-out in actual device but available in clone device) keep entry empty.
press 'Finish'
Hope this will solve your issue.
I had this same issue and after trying #Tiago Elias's answer, I got passed that stage but ran into another problem whereby the emulator could not launch. Surprisingly, all of these where happening because I did not install the Android Emulator from SDK Tools. To do this,
Open the SDK Manager
Select the SDK Tools tab, If Android Emulator is unchecked, then check it and click on OK.
You can now create a new emulator and run your app in it.
There might be several reason for this error, but this solution worked for me:
Go to your avd location "C:\Users.android\avd", delete all the files inside this, and create the AVD Emulators once again from the Android Studio.
Update for latest Android 2021 September - on Windows i deleted the SDK and reinstalled it, that fixed it for me.
when avd runs gradle build is running sudden error occured that:
Darkaction bar theme is not found and resource linking failed.

Fix Android Studio Corrupted Project Workspace Settings

I had this problem for a while and was able to solve it myself.
If in opening your project in Android Studio and something similar to this error message pops up:
Cannot load settings from file (C:\Users\User\AndroidStudioProjects\ProjectName\.idea\workspace.xml): Error on line 1: Content is not allowed in prolog. Please correct the file content.
It probably means your project workspace settings file is corrupted by whatever reason and Android Studio could not read it. Mine is probably because of BSOD, because Windows.
To solve the error, just delete the workspace.xml as specified in the error message. It is ok to delete it since you probably already lost all your custom workspace settings when the file got corrupted and you will never be able to save new workspace settings unless you fix the corrupted file. After deleting it, the next time you open your project in Android Studio, it will try to look for the workspace file, and if it can't find it, it will just create a new valid one.
I hope this helps! :)
Step 1 :Exit Android Studio.
Step 2 :Delete workspace.xml file found in the \ProjectName\.idea\ directory.
Step 3 :Run Android Studio again.
On a Mac, I found File > Invalidate Caches/Restart did the trick.
on a windows 8.1, I found File > Invalidate Caches/Restart did the trick
I have encountered similar problem many times, and there just one thing that can be done to solve this.
Just delete idea folder.
I would like to suggest restart Android studio File > invalidate caches and restart... > invalidate caches and restart option before deleting workspace.xml
if restarting android studio fail to solve your problem, kindly run check disk from disk properties because I notice that this error is raise due to file indexing / file system error or sometime permission denied by OS.
Just Delete idea folder ..
Thank you.
in Terminal navigate to your project directory, and run these
rm -rf .idea
rm *.iml
then go into your app directory and do that same thing as above.
Finally, "File" -> "New" -> "Import", this should solve the corruption.
Just delete .idea folder from project directory an re run android studio.
it worked for me.
I am using Android Studio 4.0 I solved this by:
Deleting .idea folder in the Project
Restart Android Studio
Done :)
I have encountered similar problem many times, and there just one thing that can be done to solve this.
step 1 : delete the .xml files containing error, or cut and paste to some backup folder if you want to inspect that file later on. However, it's unlikely that you'd find anything.
step 2 : try to open android studio after having deleted those files, it must be running perfect. if it doesn't and still contains errors try 'invalidate catches and restart' option in file menu.
I just deleted the workspace.xml after closing the studio and started again.
It works fine.
Since for me didn't worked to delete the file i just override the actual workspace.xml with the one i had on backup directory of my project. Now it works.
Had Today the same Problem, but i found a "workspace.xml" with something like "jpt_tmp" at his end, in the same directory. After swaping the "tmp" once with the original, i got everything back to work.
I tried many options but finally for windows 10, File > Invalidate Caches/Restart worked for me.
I guess the problems depends on each situation. I was using Flutter in Android Studio and suddenly one day this problem occurred.
Just delete the project_name.iml in Flutter project and project_name_android.iml in android module.
For android projects simply delete .iml file in the project.
After deleting restart Android Studio and follow the steps as in this video. It was of great help.
Sorry for delay response, I also came across this scenario, so tried to resolve it using many way available on internet which include
invalidate cache and restart
restart android studio
deleting *.iml file
restart system
The only solution worked for me is, I export my project into zip format and then I open it from there. The project open and build successfully without any problem.
I hope this will help for you.
In my case it was iml file which was corrupted, so i deleted it, restarted android studio,
pasted the same file as it was before, restarted android studio and everything was working fine.
A gradle sync did the trick for me.
Just press the button from the toolbar named "sync project with gradle files". The icon is an elephant with a little blue arrow.
If it still does not work, try deleting the .idea folder first, before syncing the gradle files again.

Resources