I had a working project in eclipse. I made a new project in android studio and remade the same project here by copy pasting the code(I have too much problems with importing, so I preffered to make the project afresh). I loved everything in android studio except the rendering issue withe the main activity xml file. I have copy pasted the xml file as such from the eclipse project where it was working perfect. But in android studio it is showing rendering error. In fact android studio is taking none of the resources i have in the drawable/dimen/string/color, nothing to show and it is always showing this error message:
NOTE: One or more layouts are missing the layout_width or layout_height attributes. These are required in most layouts
I have gone through the entire thing and everything is well. The program is even running smoothly with the screens perfectly as it is. I just can't use the interface builder. What can be the issue here? How can I resolve it? Do I need to import something?
Ok.. It seems like the same fix as of eclipse works on android studio as well. I had previously tried rebuilding the project, cleaning and building again and everything, but closing android studio and restarting solved the problem. It is just that after restarting android studio, you may have to wait for some time until the sync is finished, but it is working perfectly well now.
Related
After upgrading to arctic fox, I faced this issue. Opened a project I worked previously with older version of android studio was fine, but after restart its files became full with gibberish values. I thought its a hardware failure issue. But this happening again today with other projects, so I want a solution.
After working, closing and reopening the project the files contents became corrupted/changed:
File contents changed on previous project, showing difference with git:
ArcticFoxPatch2, Projects are built with gradle 7.0.2.
Solutions tried:
I have tried potential solution of invalidating cache and restart, but the files stays same.
Android studio warns and suggest wrong encoding but reloading with multiple other encoding did not resolve file contents.
What should be a solution?
Should I change hardware, eg ssd? or downgrade android studio?
Please run android studio like this.
Click Android Studio and click right button on mouse, then click "Run as Administrator".
Hope it helpful for you.
I all of a sudden (actually a while ago, but it only bothers me now that I started to work on that app again) just got these empty folders in my app under the Project view. It only shows in the Project view. Those folders are empty. The app still runs fine under the emulator.
I would appreciate help fixing those.
If they aren't causing any harm/hindrance while building your project, then you can try deleting them. Android Studio will automatically warn you if there any usages of a directory/file which you're trying to delete.
Thanks to Jetbrains for this amazing feature.
I have recently updated to Android Studio 3.3 and have noticed that my layout preview is at a low resolution.
Is there any solution to fixing this? This issue occurs only with the preview and in the design tab (excluding the blueprint) - running the app is fine.
Thanks
UPDATE: I deleted all of my Android Studio files, including the SDK (which was somehow installed on my other SSD). Then I re-downloaded Android Studio 3.3 and opened my project, only to find that the issue still remained.
A lot of users are facing problems until now with Android Studio 3.3. I don't think it's a problem with graphic card, maybe they will release a new update fixing the problems in the near future. For the moment would suggest you to work with design/blueprint, and test by running the app.
I solved the problem by adding this line to my IDE custom properties:
hidpi=false
Just go to Help -> Edit Custom Properties (Create new file if it doesn't exits)
Then add the following line and restart your IDE.
Android Studio Code Completion seems not working on xml and also it doesn't recognize any xml attribute except the attrs on Android support v7 views.
Screenshot:
my views that is from android.support.design.v7 display correctly:
I had this issue for a while and tried all the "solutions" provided;
Sync Gradle files.
Invalidate cache.
Removed and re-add project.
Reinstall Android Studio.
Nothing worked, until I came across this answer (by 4gus71n) which has worked for me every time this rather rare, but annoying issue has presented itself: https://stackoverflow.com/a/53160674/5692877
In my case I;
Closed Android Studio.
Cleared the contents of the C:\Users\MyUsername\.AndroidStudio3.2\system\caches\ directory.
Relaunched Android Studio.
Worked a treat!
If you are Android Studio then go to tools and then Android then click on build with gradle, it will solve the error. I encountered it too.
Tools->Android->Build with Gradle
I've just updated Android Studio to 0.2.7 and my Project view (Alt+1) has gone strange.
That's all I get showing up there. I've tried restarting the IDE but it's still the same.
Anyone got any ideas what's happened?
EDIT: I've reverted to a Backup of my project from a few days ago and just copied in my java and res folder, and it seems to be working fine, but I'm still curious as to what happened in my original project
I made a new project and copied in the files.
This seems to be the "go to" fix for and Android Studio projects after it updates for me :p.