I'm developing an Android application on Eclipse Juno, and using a MAC OS Lion.
When I fix some error in a xml file the error mark doesn't disappear, and it doesn't let me compile the code even if I fix it. I tried deleting it through Window-> Show View -> Problems , but when i compile the code, the error came back. The only way i figured out to solve it is to crop all the content in the file, save the xml without errors and then paste the same code inside the xml file again, the error just go away as if there wasn't anything there.
Does anyone now why it happens?
Grahaminn is correct in that seeing the code would be helpful in case there is something that you are missing. However, since you say that it goes away once you cut, save, and paste, I believe you did take care of the error. While I've never found an answer to the same question other than the eclipse compiler obviously has bugs, I have had the same thing happen and have had to resolve the issue in the same way. The compiler, for whatever reason, still sees the error instead of the fix. It is very frustrating but we are stuck doing what you have done until the compiler is fixed.
Update your Android development tools. That bug (Android Lint issues remain even after correcting them) was fixed in ADT 20.0.2.
If you can't or don't want to upgrade, you have the options of
cleaning the project
manually running Android Lint again.
But similar errors will occur again from time to time then.
Thanks for all the answers. My Eclipse is working properly at least until now, the only thing with still giving me headaches is the R.java file which keep disappearing sometimes , but thats due to problems with ADT i guess. I uninstalled the ADT plugin and installed it again.
Related
I did not change anything in my code, nor in the grade file, but I clicked on the update gradle notification android studio gets from time to time. I am not sure what the problem is but suddenly the IDE does not recognize some functions anymore, like String methods
also this icon changed:
My old project runs, but when I create a new project it won't work it says:
Error running 'app': Default Activity not found.
Help would be much appreciated.
I had the same issue I tried closing android down and restarted it up again and it started working, couldn't tell you why it happened though.
Try cleaning your project and rebuilding it from the Build Option. I have experienced this a lot of time as well. This works for me. As to why it works, I am not sure it. Hopefully someone would soon pitch in.
Go to C:\Users\{user}\.AndroidStudio4.0\system
and delete the caches folder.
Tried a lot of things I found online, but only this worked.
Does anyone have this weird glitch that came with AS Canary 16 that when you build the app all the references via Kotlin Android Extensions light up red and show compilation error.
Even though the app builds I loose all autocomplete on Views and auto import always deletes imports for methods that are called on views because it thinks that they are not used.
Clean build helps sometimes but not always. Can anyone suggest how to fix this irritating issue?
Looks like this is an issue with Android Synthetics in Kotlin. There is an open issue with JetBrains for it. You can track it here:
https://youtrack.jetbrains.com/issue/KT-23908
The reporter states that he can simply re-sync Gradle and things go back to normal. This works for me some of the time, but often times I will have to close & re-open the entire project. Rare occasions require actually quitting the IDE. Even more rare, I have to clear IDE caches. After all that, if I still have problems, I'll delete .gradle/caches and let everything re-sync & re-download.
Definitely a huge headache.
https://code.google.com/p/android/issues/detail?id=74801
This is the issue I logged with google and have yet to hear back. But I am wondering if there would be anyone on here that has gotten similar issues with Android Studio and have resolved them?
Basically I added ArgoUML plugin to Studio and had to restart on when it restarted I got a nice big error saying it failed to start with a massive list of stuff ( attached pic on the google issue has this image of the error).
I am using studio for a college project and am still a noob when it comes to programming so most of what it says in the error message is gobbledygook!
I did several re-install of Studio but still got the same message but I can see even after a the re-installs that near the end ArgoUML is mentioned?! Any idea's why this is happening?
Cheers,
Owen
By the way, I think I found out why the plugin crashed.
The plugin tries to load a "sync.png" icon (code here) from the IDE, but there is no sync icon in recent releases. This causes an uncaught NullPointerException, which you can see on the very last line of the error message.
The answer to this question was posted by Bad Wolf above in the comments, was to delete the plugin from the .AndroidStudioBeta folder within the user folders (of windows), this resolved the issue.
Even after re-installing Android Studio the files remained in the user folders so just to be aware if anyone else is having an issue with faulty plugins.
These are the errors that i am getting when i attempt to run my project. It was working perfectly fine till yesterday. I have no idea what is causing the error. I cleaned the project and reran a number of times. I even restarted my laptop, but in vain. Please help me restore this, its a very huge project.
My friends copied the project on his laptop and was able to run it successfully. Which concludes that there has been a problem with my eclipse.
There are too many errors to sort out. I would very much recommend the easy way out which is to uninstall Eclipse (in case it really is the source of the problem) re-install it and start up a new project, then slowly add in the project files one by one. At least this way if the error comes back you know which file it is (if any). Best of luck.
Try to update eclipse if there is any update to apply.
java.lang.RuntimeException: Unable to start activity....java.lang.ClassCastException: android.widget.RelativeLayout
I got this exception out of nowhere; this happens when I was actually trying to activate a new activity which, a second ago, ran fine. I tried everything, force stop the app, uninstall the app, restart eclipse, restart computer, none of which works. Then it occurred it me that there was a time when I fixed a problem like this by just closing the layout XML file and reopening it. So I tried that, and it didn't work. So I tried the one last thing: I copied out the layout XML file's content, deleted the XML file, and created another XML layout file with the same name, copied the stuff back in, and it worked! How could this be? Is it a bug of the eclipse plugin? It cost me 3 hours just to find this nonsense; I'm pissed.
I've seen that exception when I was editing some smali files and repackaging the apk. In those cases, the problem was that resources.arsc was zipped with compression instead of stored. Sometimes that messes up all the xml structure and android is unable to read it correctly. It could be some weird Eclipse bug when repackaging the apk, and it would not be the only one. From time to time, I get and error exclamation mark in one of the android projects, usually one that I did not touch in a while. I don't really know what triggers that, though.
I ran into this problem using both IntelliJ and Ant to build a package. It didn't matter if it was a debug version or signed release version both failed on startup. However, after running ant clean everything began working again.