Black line over the code in Android Studio and IntelliJ IDEA - android

I first got this problem in IntelliJ IDEA while writing code but now I"m having this in Android Studio also.
I get a black line over my code when I place the cursor in between the code.
Is there anyone who is having the same problem as me?
I'll appreciate your help.

Go to File->Settings
Under IDE Settings expand Editor -> Colors & Fonts ->General
In the list shown on right scroll to Line Number, Now change foreground and background colors.

I am experiencing the same problem. If your using Android Studio 3.0.1 update it to the latest version or click insert on the keyboard.
After updating to the latest version of Android Studio. Do not import your settings from your previous version
Or reset Android Studio's settings by deleting the .AndroidStudio3.0 file under C:\Users[username] in Windows
For Mac remove this files
~/Library/Application Support/AndroidStudio3.0
~/Library/Caches/AndroidStudio3.0
~/Library/Logs/AndroidStudio3.0
~/Library/Preferences/AndroidStudio3.0

Had this same problem in Android Studio, it seems to have come down as part of a buggy IDE update. Studio would work fine for about five minutes and then randomly start obscuring the current code line with a black highlight.
Anyway, clearing out all the AndroidStudio folders in C:\Users[Username] seems to have worked for me.

I restarted Android Studio 3.1.3 to solve this issue. File > Invalidates caches and restart.

Press insert key.
if you can not find,insert key near delete key.

Related

android studio projects getting corrupted after a restart

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.

Android Studio Layout Preview Low Resolution

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 does not show layout after updating to version 3.0.1

I updated Android Studio to version 3.0.1, but since then I can't see the layout of my application anymore. I can run my app, so the xml file is OK.I tried adding a new Virtual Device and updating my SDK, but I still can't see my layout. Has anyone faced this issue? Can I do anything to solve it out? Thanks.
2
Try Clean and Rebuilding the project. Worked for me
.
change into any api level now it is in null
Reference : Preview not Showing in Android 3.0
and
Android Studio 3.0 xml-layout file's preview not showing issue
I solved the problem by clicking the button "Sinc project with Gradle files". Now I can see my layout. Thanks to those who tried helping me.
Your Solution is here
First you Sync Your Project (See in the image red highlighted circle) Click on the Icon
See Below Image
Your problem is now fixed.

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 🤐

All Java Files becomes red marked as error. but project build successfully

I am using android studio 1.0. I am developing a small android application. When i was editing the code in one of my java file in android studio, power cut happened.
After power came, i open the android studio and open my project, all files in the java folder marked as red indicationg error.
but the projects build successfully. when i sync with gradle.
it also done successfully. and perfectly runs in the device after launced the app in my phone.. but the red mark not disappear
even i close the project and reopen. If i create new project also, the same things happen again.
i can't understand what's happened. i also tried re install my jdk 1.7
Can anyone help me, how to fix this bug. please give exact solution. i don't like suggestions like to re install android studio
Try to Update to androidstudio 1.2
Close Android Studio
Go to C:\Users\user\\.AndroidStudio2.3\system\caches directory and delete all files.
Restart Android Studio
Done.

Categories

Resources