I still can't resolve symbol R - android

my android studio cannot resolve symbol R. everyone keeps saying all you have to do is check your XML files and sync bla bla. i have done all that like 10 times now but still. there is no error in my XML files. please someone should tell me something different

Use invalidate caches and restart option from the first menu (on a phone so can't remember the menu name) . That should work. After all is done, make sure to also clean build to ensure everything is fine.

Related

How to Completely Remove an Android Layout from Android Studio

I'm building an app in Android Studio and I accidentally created a base LoginActivity template but then deleted it because I wanted to make my own. Now, when I try creating another activity with the same name, it tells me "Layout name must be unique."
I could just name it something else but:
I don't want to
There would still be some sort of duplicate files in my system doing nothing
My goal is to just remove all mentions of activity_login, ultimately so I can make a new activity with the same name, but I can't figure out how.
Go to res->layout->activity_login.xml and delete it from android studio
Or open project in file explorer, then Go to app/src/main/res/layout/activity_login.xml and delete it
If it didn't solve it, Invalidate Caches and restart Android Studio.
That's happens sometimes.
just go to : File->Manage IDE Settings -> Restore Default Settings.
This will solve it for sure :)
I had the same problem. Empty res/layout/activity_xxxxx.xml and invalidate cache didn't work, until I found there's xxxxx.java existing in app\src\main\java\com\example\xxxxx. After deleting the .java file as well, I found that I'm able to create the Activity file with the same name.

Android code overwritten by gibberish characters

Hi all. Today when I opened my eclipse some of the files in my particular project were seen as below. I havent really experienced such a problem and i dont know how to recover my overwritten code. I have tried cleaning up the project and restarting eclipse but nothing seems to work. any help is welcome. As it is very important for me to recover these files. Thanks in advance.
You can watch the local history of the file in Eclipse. If something exists there, restore it.
Right click on project:

Problem facing while accessing already created project into the workspace

This is the problem am facing since many days. am trying to manage that but not able to solve that. while am try to access the project which is existing project into workspace then am getting some kind of error at the "#override" tag and when remove that the error disappear and single error will be shown at the application name and that cannot be removed. Am doing for the mean while is try to copy all the code from the each java file and paste it to another project that was created newly.
Can any one help me in this concern. Thanks in advance.
Your problem is related to JDK for this what you have to do is from menu options choose
Window > Preference then navigate to node displayed in below image and set "Compiler compliance level as 1.6"

Cannot find the culprit file in my android project even after expanding the main folder

The side bar in eclipse shows a red cross on the title of my project folder but there are no such signs in the directories below it in hierarchy. In which particular file does error exist? How can I know that?
Error log shows: Current file is not a match for the given config.
Sorry I just came across this now, but I've had the same error too, so I'm sure others have. There was a quite a bit easier solution than what you had to do, at least in my case. I had the exact same problem, where my main project said there was an error, so I couldn't debug or run, but there was no apparent error, other than the red X on my main folder.
In order to solve this, I simply closed the project by right-clicking on the main folder, and selected "Close Project". Then, I right-clicked on the closed project, and selected "Delete". Don't worry, this will not delete any files, it will only remove it from the workspace, and will make sure you really want to do that by asking you to confirm. Now, just click on File->Import and select "Existing Projects into Workspace". Choose your parent folder for your app that was erroring, and import it. The few times I've had the phantom error on my main app, this has fixed it each time.
Whether there is an underlying cause and this process simply refreshes something in the workspace, I'm not sure, but at this point this fix is fast enough for me to use it.
Hope this helps next time!
Project -> Clean
Closing project and opening it again fixed it for me.
formed a new workspace and formed a new project. Added each file individually. Now it shows no error.. but still can't figure out what was wrong with thr previous code..? :=(
I faced the same issue..
there was a problem in manifest xml..
the path was not set properly. there may be space in the path..
I just copied the activity tag from other project and pasted in my project and just edited the path in android:name. it worked fine..

aapt error on android

When I have an layout test.xml file open and click on Run Android creates an empty test.out.xml file and creates an "Unparsed appt error".
Even when I delete the newly created file the "Unparsed appt error" doesn't disappear.
What happens here?
How can I fix the error? Is there a way to prevent this from happen when I accidentally click on run while in a .xml file instead of being in a .java file?
If you run Project/Clean, the error will go away.
Regarding preventing this from happening, you have to change the build action for XML. I have not spent the time figuring out how to do that, but since this is such an annoying thing, I'd be glad if someone could post the steps.

Categories

Resources