Design editor can not show anything in android studio 3.3 - android

After updating 'Android studio' to version 3.4 , design editor can't display UI and displays this message as you can see in image below.
Design editor is unavailable until a successful build
What can I do to solve this problem?

Your Gradle build failed, so Android Studio blocks access to the editor until the build is successful. No I don't know why it works like that, it just does.
So rebuild your project by going to the Build tab (in the bar at the top where you see "File", "View", etc) and press "Make project". Fix any errors from the build and you can use it again.
Alternatively, if the build did succeed but still shows like that, invalidate the caches and restart. Clean and rebuild is also a good option, though your problem will most likely be solved by building the project.

In my case, updating buildToolsVersion to latest version fixed my problem.
P.S: cache invalidating and restarting, clean and rebuild, and other typical solutions for android studio not worked for me.

Related

my layout folder get red lines after migrating Android Studio from 3.6.2 to 4.3.1

This is kinda weird
I just recently migrated my android studio from 3.6.2 to the latest version because of some need. When I reopen a project that was build from 3.6.2 there's suddenly red lines on the layout folder like this
The problem is , when I tried to run the project it will build and run successfully without any error. And there's no way to know what or why it got marked as error. This is kind of annoying, anyone know how to remove those red lines?
Try restarting Android Studio without caches.
File -> Invalidate Caches / Restart... -> Invalidate and Restart
If that doesn't work try cleaning them manually. Read this.

Cannot build or run in android studio

I was using android studio 4.1.1, I updated to the 4.1.3 version and after that I had some problems.
Gradle sync never finished.
the android view (top right) is not showing properly. it appears just like the project view
The buttons for build, make project and run are not working
I have errors all around the code.
What I have tried:
I tried to upgrade the Gradle to the latest version. but nothing worked
I went to File>Invalidate Caches/Restart. but it did not work
I wanted to Sync project with Gradle files. but that options is not even available (I guess it is due to the Gradle sync still in progress)
I cannot acces the project structure in File>Project Structure (it shows me the error in the snapshot below)
I have been stuck for two days now, and cannot proceed with coding. If anyone can help, I will gladly provide any further information you will need.

Android Studio shows continuous error with plugins and androidAnnotations.jar

I don't know why, but Android Studio 3.2.1 display a plugin error continuosly. The error is always related to androidAnnotations.jar, like this:
Android Studio/plugins/android/lib/androidAnnotations.jar!/android/content/annotations.xml: Content is not allowed in prolog.
I've updated to latest version of IDE and SDK but the error hasn't been solved. I tried to invalidate caches, reload the project from repository and resync gradle, disable and enable plugins, etc., but without success.
Any suggestion?
After some test and searchs on internet I've found how to solve this issue. Deleting some cache folders from .android, AS recreates it and problems are gone. I followed the steps from the answer posted by #Levi Rizki Saputra.

Error running 'app': Unknown error in Android studio 3.1

I have updated my android studio to new stable version 3.1.
After build project not able to run.
Let me know if anyone have face same issue or find any solution.
Just go to "Run/edit configurations.../" and scroll down to bottom of the window and here you see an option "Before launch..."
First, remove whatever already inside the little window and then click on (+) icon and select "Gradle-aware Make" and then type "assembleDebug" and select the first option or that you need. This will solve your problem.
Try deleting both your build folders in your project manually and rebuild. This usually happens when you update gradle version, in my experience.
The solution that worked for me was a combination of other answers here.
I had upgraded to the most recent stable version of Android Studio at the time, 3.1. Along with that, Android Studio prompted a dialog asking me if I wanted to upgrade my Gradle from 3.x to 4.4, and I accepted as well.
After that I got the error of this question, and then I did this:
Open menu Run -> Edit configurations...
In the Before launch: section, select any options you have listed (each option has the Android symbol), and remove them with the - symbol
Add the option Gradle-aware Make, with the value assembleDebug
Clean and rebuild your whole project
just clean and rebuild your project
I had the same problem. I change in build.gradle 'compile' with 'implementation', then clean and rebuild the project. Now it starts with no problem.
Run "Build-> Clean Project" normally will fix this problem.

Gradle project sync failed?

When I started up my project this morning it randomly gave me a message saying Gradle project sync failed. Basic Functionality(eg. editing, debugging) will not work properly. in Android Studio. I looked at other answers that people had put up for this problem but they haven't been working. I invalidated my chaches/restarted my project but no luck. I also deleted my .gradle folder from my project folder and still no luck. If any of you guys could help me that would be awesome! This didn't happen yesterday when I was working on the project or anything, I wonder why its happening now. Oh yea it also says this as a gradle message: Error:C:\Users\Dave\.gradle\caches\2.2.1\scripts\settings_ad4t0wp5ikihzl1y1o83b5sbw\SettingsScript\buildscript\cache.properties (The system cannot find the file specified) :
Thanks again for anyone who reads this/ can help!
There is a file - "cache.properties" that gradle creates for you, upon first time inception of any project. The path for this file is "~Home_Directory\.gradle\2.2.1\taskArtifacts". You may find this path in your home directory. So basically, this file - "cache.properties" is missing from the "taskArtifacts" folder.
One of the solution that worked for me is to copy file - "cache.properties" from any test project of yours to this project that's currently experiencing an issue.
Regards
I had to choose using the Default Gradle Wrapper instead of local.
<< SETTINGS -->/ BUILD TOOLS --> Gradle --> radio button switch... >>
It has helped me to fix the same problem.
I had experience similar sync failed problem with gradle based android project (in Android Studio 1.1.0). I solved this problem without deleting .gradle from my user directory,
steps I followed was
Go to File -> Settings -> Compiler(Gradle Based Android Project)
Change VM options to -Xmx512m -XX:MaxPermSize=512m.
Click Apply -> OK and then tap on Try Again option in sync failed message to clean build the project.
Works like charm!!
UPDATE - 1 : For Android Studio 1.3, Compiler option mentioned in above Step-1 is present inside tab Build, Execution, Deployment.
I had faced similar kind of problem earlier!
But don`t know after rebuild the project and cleaning it, it worked normally.
Invalidate dependency cache by running
gradle clean build --refresh-dependencies
from project root and then re-import your project. Worked for me once.
May be you have put Android Studio into offline mode. To fix it, go to Preferences -> Gradle and ensure that the "Offline work" checkbox is not checked.
Than do
File -> Invalidate caches / Restart
Shutdown Android Studio
Rename/remove .gradle folder in the user home directory
Restart Android Studio let it download all the Gradle stuff it needs
android studio 0.4.2: Gradle project sync failed error
Delete the folder C:\Users\.gradle and reopening the android studio solved my problem

Categories

Resources