i have created 4 activities they all were work well but suddenly the preview of design in XML file is not showing I have tried to reopen my android studio also that specific XML. but the problem is still here.
XML code is showing but only the preview of design is not showing here the ss of screen.
please check and help me to solve this out.
please try the following steps:
clean project
delete .idea and .gradle file
remove app/build folder
now do invalid cache and restart
if still your problem is not solved then try to restart your computer
you just need to do invalidate Caches and restart, I have provided an image for you to know what to do exactly. in android studio, go to the top left corner and select file and click on Invalidate Caches/restart and that will restart your android studio. than try to open your xml layout.
Image
This is a log on StackOverFlow for those who continue to have problems after doing a clean build, invalidating caches and restarting, and restarting the computer.
Check if the element of the view has a custom view imported from an external library.
Ex.
In my case, I was using YouTubePlayerView of YouTubeAPI.
Obviously, the preview worked fine until Chipmunk.
However, the preview has not been released since Dolphin.
So I annotated the YouTube player view.
Then the preview was displayed normally.
In fact, I've confirmed that other people are experiencing the same problem as above.
So my guess is that custom views from libraries that are no longer updated as Gradle versions go up are not compatible with each other.
In that case
It seems to be a problem caused by using an external library view called de.hdodenhof.
enter image description here
Related
My problem:
I'm not getting suggestion in xml file of android studio while working on relative layout. 0 suggestions are available, if I press control+space.
What I have tried?
I tried to solve this by deleting .idea folder and .ime folder, but still it is not working I'm getting 0 suggestions, but suggestions are available in Java file and on constraint layout.
Try Invalidate Cache/Restart. If nothing changes then try to restart your computer. Keep the Internet Connection On and then Launch Android Studio.
I think the problem is not with Layout.
I am adding some icons from the drawables folder to a layout. I had an image that I replaced which got the same name as the old one. I have overridden the file, rebuilt the project and the Android Studio's graphical layout showed the new icon. However, when I ran the app, the old icon appeared. I went over all the drawables folders to see if there might be one with the old icon, but it was replaced in every folder. I also tried reinstalling the app and it's still showing the wrong icon.
Why won't the app show the correct icon?
May be due to some bug of Android Studio, Try it out it will work :
Delete .apk from local path manually (Path : \YourProjectFolder\app\build\outputs\apk\app-debug.apk)
then Rebuild Project and finally Run it.
Because of instant run feature,
Once your app is installed, Instant Run allows you to push code changes without building a new APK
new apk is not creating. Try after deleting apk file from path ...\apk\app-debug.apk
Then build and generate apk again.
Rebuild Your Project then it works fine
Delete your icon from the drawables folder, set another image in the application instead of the deleted one, run the application, close the application, add your image again in the drawables folder, add it on your control and run again. It should work now.
What eventually happened is that the images were replaced in a library module, while the app module also contained the old image. Since the app resources overrides the library's resources, the old image was shown.
I'm getting this painful error everytime I try to save my project for the last couple of days.
I've tried running android studio as administrator but I still get the same error.
I've tried to go to that path but the folder .AndroidStudio doesn't appears under User\Lucian\, and I can access the folder through the Address bar, but the folder seems to be empty.
I'd appreciate any directions on where I should be looking.
I've had the same issue since I installed Android Studio several weeks ago.
Today I found out that the 'Android1.3' folder (and some sub-folders) were invisible. Since I turned on the visibility of this folder, I am no longer getting this error. :)
Hope this will help you too.
Go to the path mentioned inside the error message. If you see any hidden folders listed in there change its properties and set its visibility to normal.
For example, C:\Users\Username\.AndroidStudio2.1 was hidden in my system. Removing the hidden properties worked for me.
When i open android studio it shows me blank screen like i don't have any projects with a yellow message at the top corner that says "can't load setting from file workspace.xml..."
After i tried to delete the workspace.xml file as suggested here and open android studio again the message didn't appear but it was still without any projects. Yesterday everything worked fine and i can still see my project data on the windows explorer. Can someone please tell me how to fix this issue.
go to your user folder
[SYSDRIVE]:\Users[your username] (ex. C:\Users\aman)
In this folder there should be a folder called .AndroidStudioBeta or .AndroidStudio (notice the period at the start - so on some OSes it would be hidden).
Delete this folder (or better yet, move it to a backup location - so you can return it if something goes wrong).
this will solve your problem.
I have created the android application project but if i try to save the "activity_main.xml" it is saying that.
Message
The original file 'activity_main.xml' has been deleted or is not accessible.
If I click ok it is trying to replace the xml. But it did not happen before. I am using eclipse.
If I create any other activity and try to save that xml then it is working fine. This error is happening only for launcher activity with the project name FCI.
It works fine if I change the project name.
This issue occurs to me every time I delete a project from a workspace, and then import one with the same name from another location. (Using eclipse Kepler sr 2)
I guess eclipse caches the workspace session metadata, but doesn't update it on such overwrites.
Restarting the workbench solves this problem every time.
Please try to restart your eclipse... I hope it would work for you