Logcat prints System.out that does not exist in project Android studio - android-studio

In my Android Studio project i used to have a class FileHandlerImpl with a function onFilePartReceived and inside there i had a command that prints in the Logcat ## File part received ${some data}. Two months now i have changed the whole API of that part of the app, so i have deleted that methods and of course the println command. However, there are some times that i see that in my Logcat appearing like it does exist. However, if i search inside the Project by Right click -> Find in files..., I never find that line. Of course i am sure that i have deleted that and it does not exist. How does this still appear in the Logcat..? Has anybody faced that issue before??

Related

I work in Android Studio, and due to system crashes, one or more of the features crashed due to frequent system crashes. How should I restore it?

To complete the question: I believe either this is due to patch update to Gradle or project Gradle settings, but I am clueless.
gradleVersion = '4.2.2'
compileSdkVersion = 31
minSdkVersion = 21
targetSdkVersion = 31
buildToolsVersion = '31.0.0'
com.android.tools.build:gradle:4.2.2
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-bin.zip
I use Android Studio for development.
Version:
After frequent system crashes on Windows 10, due to corrupt memory modules, some of the features crashed. I searched in Google and Android Studio documents for troubleshooting, but it seems that my search keywords were not strong, to get me a relevant solution to roll back Android Studio to a stable state.
.git files corrupted: due to which I could see bad file contents where in fact the codes in the files were intact. What I was seeing in the files was due to .git files that were corrupted.
I simply left the project and cloned it in another directory. With .git restored I saw the files in their original form.
Problem started after that. Though the code compilation to the creation of APK was intact, the LINT worked partially correctly.
I re-installed the Android Studio, but due to the previous installation, there was no change. I want to restore the LINT to the previous state. I have the image to show what is happening.
Some keys and flow of control of Kotlin are not recognized showing unnecessary errors. It is difficult to know whether I am writing the correct spelling (one example for the difficulties I am facing) or not until I build my project.
When my .git files crashed, the code was intact, but show garbled texts in the Android Studio Editor for the same file.
Some Kotlin flow of controls are not recognized by Lint
Update:
Intelliscence and Lint are not working in Kotlin Android:-
Kotlin is unable to find OkHttp's extension method: toMediaOrNull().
I found this link :- Uninstall Android Studio with complete effect
Note: Some sections here will be moved to the question section above, and also some
sections from the above question section are worthy to be moved here in the answer.
Once verified whether this is working successfully, I will update a detailed answer.
Update:
The Lint and the IntelliSense, both are not working, and TODOs are not highlighting, after this solution. Now I don't see any red marks, so it is just like working in a plain text editor, except for the keywords highlighting.
IntelliSense not working:
The Analysis process (top end of the editor screen), never stops.
There is not a single change after I deleted the .gradle and .idea folders in the root folder.
Some of the IntelliSense came back after invalidating the cache and restarting Android Studio.
Following: Rename folders inside your {{user_dir}}/.android
folder.
Step by step, we are coming to a close and only this is left: Some of the newly added variables in the binding (layout) are not recognized while the older widget ids are still recognized (in the camel case (Kotlin), from snake case (layout XML)).
New Ids in layout --> binding, are not recognized:
Old Ids in layout --> binding, are still recognized:
Let me observe this for some time, to see whether it comes to normal and come up with more updates. As usual, I face no issues while building and running the APK on my Android device.

How i can't create Fragments and Activity on Android Studio? Error cannot find

I have an app example running with Navigation Drawer and I need to create a tabbed screen, I went to the example and I created TabLayout, but I want to add other tabs, when I try to create a new Fragment from the Android Studio options, it creates the class but cannot find the class .xml even though it is already existing.
Follow the images, for example:
And
But, in the class:
This error returned is "Cannot resolve symbol 'fragment_fragment_devices' "
BUT, THIS .XML EXIST .-
Don't know if you still getting that error, but it happened to me and i just found out how to solve it. Go to "File" -> "Invalidate Caches/Restart..." -> INVALIDATE AND RESTART. Then just reopen your project and it should be solved. I've learned that sometimes invalidating caches and restarting can solve problems of that style.

Android Studio wrong file executed

I am beginning to learn developing apps on android studio through android training website. I followed the steps and created an empty project. However I included c++ support while creating project. So when i ran the project, the output is "Hello from c++" from native-lib.cpp instead of "Hello World" in activity_main.xml.
My question is:
How do I get it to execute activity_main.xml and print hello world rather than native-lib.cpp?
Answered here:
If you're just changing the XML, but haven't changed the source code for the new project, then your XML is going to be overridden by the line
tv.setText(stringFromJNI());
Remove that line (or set your new text there instead) to fix your issue. It's caused by the fact that the XML is the starting point for your view, so any and all changes to that view during runtime will be the ones that you're likely to see.

Activity templates disappeared from new project in Android Studio

Hi I am new to programming and wanted to create a new project in Android Studio for experimentation.
I wanted to start with the Empty activity which creates the Hello World program but suddently its no longer possible. The window which I get when I click
is compleatly different.
Instead of getting the window which lets me select the target API and activity type I get this
And from there It only lets me select project name and whether or not it creates the basic main main java method. No XML no nothing.
I dont know what happened
EDIT: I would like to add that I deleted .gardle yesterday once because it was a solution to another problem I had earlier
I solved this myself by resetting Android studio by deleting .AndroidStudio2.3
Resetted all setting which sucks a bit, but I rather have that.

Constantly failing to add Sherlock Action Bar to an Android project

Following the instructional video on how to download, add and create an Android project using the Sherlock Action Bar, I'm constantly failing to add the library to the new Android project.
I followed the instructions to the letter but in the Android project's properties, under "Android", when I add the reference to the action bar, the following happens:
All looks fine, there's a nice green "V" sign with library's
location under the "Reference"
After pressing OK and re-opening this same window, there's a red "X"
with the file location and the "Project" row shows "?" for the
project's name.
Again, I followed the instructions to the letter and I don't understand this issue.
If anybody has an idea... I'd appreciate the help.
Thanks.
did you delete the android-support-v4? cause I deleted my android-support-v4 in the libs folder then error free, and if not i think ur problem is your jdk its should be jdk1.6
i used slidingmenu + abs with my project.. took me 2 days to set up... lol

Resources