Gradle on adroid studio not working properly - android

Hello there I seriously need a help, I am a python programmer who just have started learning flutter, I have been sitting on one single error for 12 hours now.
I have tried every possible solution on the internet. I have re-installed android studio too, tried to fix xml files too. I am attaching the error below and a screenshot of my build.gradle too, please ask for more if need.

I also get this issue and in my case I found two solutions. First, rebuild the project or you can also try clean project. Second if your project is not big, you creat another fresh project and copy all codes from previous project to this new one and third but not in the list, go to settings and search gradle and then select the latest version of gradle or download it after finishing it restart the android studio with "run as administrator ". Hope it will works.

Related

Not Resolving/Importing Any Class Android Studio

Okay its weird error though, but I will explain it, actually I did remove "emulator" folder from my android SDK folder because it's causing android studio to slows down on ita knees, and when I did it, it throws a Gradle related error like "Can not read from some file", well for that i did reinstall Gradle 4.1 and error gone, but the weirdest problem occurred, now i can not import any class except appcompatactivity and constraint layout which I implemented in build.gradle , for those who wonder what I have messed up with the Android SDK folder, I want to tell you guys I just downloaded everything from scratch except having JDK 1.8.0_171. I mean I can not even import core java classes or anything, studio is pointing out for "please specify android SDK" or something, but hey I have already fresh SDK, what will be the issue, help me guys, and I swear I will never mess with SDK, am running out of time, already wasted too much time with this, Thank You !😊
Okay so finally i deleted C:/users/username/.AndroidStudio3 folder with all files in it! Works like charm ! An stupid solution for a stupid problem, btw problem solved ! Thanks everyone !!😊😊
Close the current project and go to project location directory and delete
.idea folder
You can open your project again. This worked for me and problem comes most often when you are working with VCS. And this problem is not associated with android component classes but also to the libraries, both shows the same error.
You need specify the SDK in Modules section in Project Settings.
Right Click your Project Name in Android Studio and Select Settings..
or
Perform these three steps
Open gradle.buld in your app module
Change minSdkVersion and sync gradle
Revert back your minSdkVersion and sync gradle again

Android Studio does not load projects properly anymore

For some reason whenever I open my project in Android studio it looks like this
It happened before, I tried to reinstall Android Studio which fixed it for like 1 hour, then the same thing happened again, tried to reinstall android studio one more time and now it just doenst work at all.
.
Thank you very much for any answers
This is faced by many developers like me after updating to AS3.
Try Import Project... and navigate to your project. Select build.gradle file.
Be sure to wait for a while, so that android studios can load all your stuff. Sometimes a restart will help.
Gradle sync success is needed, cause project files will not be indexed if gradle build is not successful.

Android Studio 3.0 xml-layout file's preview not showing

When I open layout file in my new Android-Studio file and press preview tab it'll show a message Waiting for build to finish... for infinite time.
Has anyone faced the same issue or any solution?
Cleaning and rebuilding my project solved the issue.
try different theme (may be from Appcompat) and API level from top
OR
If you have made some changes in the layout just undo it.
delete .idea and .gradle folder from root of the project
close android studio , restart it
click on gradle icon from right sidebar and click sync icon to refresh project.
now rebuild the project and it should work.
After a lot searching and I tried all solution which people give here, but any of them didn't solve my problem, I guess this problem is from studio's developers, and they may fix it in next patch.
so I simply re-installed my android studio and it's solved.
Try Clean and rebuild project.and Also try Invalidate caches/Restart.And this issue is also facing because of Low Ram in laptops.
After upgrading to Android Studio version 3.1, in the Project Structure dialog the build tools version was empty. Selecting a build tools version solved the problem for me.
Hope it helps for someone facing the same issue.
See my response on similar question posted:
Android studio error java.lang.IllegalArgumentException: Resource name cannot be empty
This error can occur when you update to Android Studio 3.0. It doesn't affect your ability to build a project, but the error does not allow you to visually see your xml layout files. You will also get the error when committing files to GIT, but you can still commit and push.
What I found in one of my projects is that a file was added to the "menu" folder automatically upon Android Studio upgrade, and the file had no name. It was named simply ".xml". All you need to do is delete the file and clean your project, allowing a new build of the project. That should take care of the issue.
For me I had this problem with one file, so I simply created a new one with the same code.
Simply make a build from within AS - not the command line. I get this all the time because I'm mostly using the command line. It's been like this since early versions of AS so I recon it's not high on there list of issues.
Lately (3.2) there is a lot of new internal crashes and what not - not stable at all 🤐

android studio rendering timeout

I have a problem with Android Studio. Since this morning I can't edit my layouts through the Design interface. It's stuck on "Initializing Rendering Library" and the IDE freezes. All my layouts were working well yesterday and I haven't changed anything since then.
I have tried to invalidate the cache and restart but without any result.
Try that steps :
1.Update Android SDK and Android Developer Tools.
2.If that will not help, reinstall Android Studio using the newest available version (remember to do a backup of your data and projects).
3.If that will not help, install other IDE for example Eclipse and import all your projects to it.
Good luck !
For me helped such steps:
Remove .gradle folder from the project folder, all *.iml files and
.idea
Remove C:\Users\username.AndroidStudioPreview1.2
Run Android Studio without importing settings. This will allow to see a dialog where you can open your project from scratch. If you
import settings then Android Studio will open previously opened
*.xml files which caused the problem (hanging "Initializing Rendering Library") and the situation will happen again
Run Gradle cleanup
Sync project
Invalidate cache and Restart
Build the project from command line. If use Build from AndroidStudio I got hanging "scanning files to index..."
I reinstalled my android studio without success,
Then, I downloaded the sdk again, and change my old sdk-path to the new one
After I restarted my studio, it works.
The most mysterious thing is, I rechange my sdk-path back to my older one, then every thing is ok,I don't know why,but it solved the problem

Android application giving a weird error in Eclipse

i put this question in this forum because i am not sure whether this is an eclipse error or an Android error.
yesterday i created an Android application using Google Maps and GPS on Eclipse and it build and ran successfully however today i wanted to do some modification to the code so i started eclipse but it gave me an error.
SDK parse failed
if i try to run it. it says the apk cannot find. how can that be happened? the same application ran successfully on the same environment yesterday. i am using Ubuntu 10.04
Thanks !!
There is a problem with your project, as evidenced by the red x icon on your project title bar shown in the image above. Right-click your project, choose Properties and go through all your properties to make sure they are all still valid. It might be a reference to one of the jar files.
I get this problem all the time, hopefully my solution works for you.
To work around, goto your libraries inside the properties page.
Add any library and then rebuild your project.
Go back and remove the library later for clean up.
The project should still build.

Categories

Resources