As the title says, I m having problems with eclipse every now and then. To list few,
Missing R (the most frequent issue)
Conversion to Dalvik format failed with error 1
Cannot find resource
etc..
I tried many solutions already on SO, this and this and this as well. However the issue still persisted.
I checked and ensure that there was no issue with the xml. I must have cleaned my projects more than n number of times. But the only thing that helped (and is now what I have started doing frequently when any of these errors pop up) is restarting Eclipse. Sometime the error goes in one restart, sometimes two.
Even though this restarting has helped me most of the time (almost all), it is at times very frustrating as I loose good amount of time because of it. So I want help to find some solution here.
Note: My Eclipse says version (Android DDMS - 22.6.2.v201403212031-1085508). Also this has occurred for different projects so I do not think that this should be code specific (I may b dumb for this point). (Also the log cat doesn't point to any specific part of the Projects apart from a red highligt error)
Related
1. The Problem
Usually, either flutter clean or deleting /build folder works for me. But, recently, some errors have been cached for a long time and I just can't seem to be able to delete them. The cleaning process is also supposedly taking way longer than expected (+3s in my reasonably good computer).
The reason why I say it is caching error logs is that essentially all of it refers to silly typo mistakes I have fixed long ago or other types of easy-to-fix mistakes. For example, 2 days ago (my computer rebooted 2 times since then), I've used an .email getter on an object that doesn't have it and the log is still there; or the fact that it is saying that I've used an invalid object on oneline, but now there is bascially nothing in that file anymore.
The app also builds and runs perfectly after these long error messages, and, if I hot reload or hot restart it, no errors reappear.
I would like to share my complete error log here, but a good part of it has a lot of personal data. It is also not very relevant I think, because it mostly refers to silly mistakes and typos.
2. What I've tried so far
Here is what I've tried so far:
flutter clean
Manually delete the /build folder
Restart my IDE
These error messages appear both on VS Code (my current IDE) and Android Studio.
Use Ctrl + Shift + P + Clear Editor History to reset VS Code.
Is there some hidden folder within a Flutter project that could be caching these data?
Apparently, there is some linkage between the Flutter project and the emulator itself, because wiping out the emulator's data seems to have solved the problem.
Was that supposed to happen? I think this should be treated as a Flutter issue — more specifically: flutter/flutter #45478 Github Issue.
Here is the error I'm getting when trying to archive my app for deployment.
This error doesn't show up at any other time. The project builds and runs on emulators and devices without issue. This error has zero context or direction as to where to look to fix it. It also just randomly showed up out of nowhere, last time I built/archived (with zero functional changes) this error did not happen.
Main difference between this archival and the previous one is a newer version of VS 2017. Don't remember exactly the version from before, but am currently on 15.9.4 (stable).
Looking around on the interwebs, I've found that this error seems to have something to do with ObservableCollection's, which there are probably 10-ish in my app. Not really sure what to do here, because this has never been an issue previously, and I'm coming up on a deadline and with the structure of the app, am not in a good position to start making functional changes.
EDIT
I have also cleaned and rebuilt my solution, as well as deleting all bin/obj folders in my xamarin projects. Even tried deleting the .vs folder which can sometimes help. But still no go.
Going to try updating VS to 15.9.5 and see if maybe it was fixed in a release.
EDIT 2
Updating VS 2017 to 15.9.5 made no difference.
EDIT 3
I had my coworker try archiving the exact same project on his machine (running VS 2017: 5.9.3, and it archived fine for him. So far that's the only difference we've been able to find between our environments.
I saw the same problem using VS2017 15.9.9. Even the same code that could be archived a week ago threw the above mentioned error. It seems related to local data in the solution. A "clear" build was not sufficient. However manual deletion of the local obj and bin folders followed by archiving (build is done implicitly) solved the problem for me.
For my part closing Visual studio and deleting the .vs hidden folder did it.
It's actually a fix for many issues using Xamarin.
I had this other issue where I couldn't archive because the build process would just hang and never end. Deleting the .vs folder did it too.
https://github.com/xamarin/xamarin-android/issues/1760
Just go to project property then go to Android options-> Select Advanced then increase the Java Max heap size to 2G/3G -> it's working for me.
Leon Lu's suggestion worked. I don't particularly like it, as it took forever and repairing basically restores you to a base install (no extensions or personalizations). Took about 1.2 hours to complete, but once done I was able to again archive my android application. I guess something went wrong in vs at some point, perhaps during an update. There's no way to tell.
I tried ALL of the ideas above, but had no consistent reliable luck with any of them.
I found that Microsoft has had the problem reported to them (see link below). After a ton of time burn on this, I posted at the link below one way that I've been able to get around this archive-build issue.
Like the other fixes, it's not exactly logical, and nothing that you would think would work, but I've found the process to be repeatable, which is golden for me with tight timelines and having no time for this.
MS Visual Studio Developer Community Problem 507708
Posted on a Saturday morning, a sign of really needing to get around this urgently. I hope it helps you too.
Here's an odd issue I can't seem to find any information on.
I'm working on an Android app with a friend who uses Eclipse -- I use Ant and the Android command-line tools. Sometimes when I checkout code that was written by him and the project.properties file gets pulled into my local workspace, I'll have to change the path to the libraries back to where they're at on my machine, as it gets automatically set for him via Eclipse. This may be of use to know in light of what just started happening when I try to launch 'monitor' as I've always done; I get this error dialog box that pops up and says: An error has occurred, please see the logfile: /home/user/.android/monitor-workspace/.metadata/.log
So I did. It was, after I'd tried to launch monitor several times to no avail, a really long logcat-like file of Java traces. I cleared them out, thinking that perhaps it had run over its own max size for internal monitor data, but that didn't stop it crashing. A new set of errors just gets appended.
This is the first time this has ever happened, and unlike essentially every other Android problem I've had, I can't seem to find any existing information on it. The device monitor now seems to want to be integrated into Eclipse. I don't use Eclipse so I'm not sure how the monitor runs within it, or whether I'm correct in assuming that some configuration file somewhere needs to have a line changed (or whatever).
Here's the content of the logfile:
http://pastebin.com/JitCWrGg
Could anyone lend a word of advice?
Many thanks!
After making a series of edits to a previously working android project in eclipse, I attempted to run the app and got a message "Your project contains errors, please fix them before running your application." Normally under these circumstances there are either some red marks next to the offending file(s), and/or text descriptions of errors listed in eclipse's "Problems" tab. But this time there are no red marks to be seen anywhere, and the errors I see described in the "problems" tab refer to files that (as far as I can tell) have nothing to do with my project.
I noticed that at the top of my list of problems it says "Errors (100 of 192 items)... I am wondering if perhaps I am being shown 100 problems from other projects (I have many on the go at the same time) and my critical error is one of the 92 remaining which I'm not being shown... I'm stuck as to how to proceed.
Close the projects you don't care about and do a clean build.
I am a little bit new to developing for Android using Eclipse (Coming from a .NET/Visual Studio background).
My biggest problem in developing Android app is "debugging" them. Every time the emulator throws an error, there is no message, no explanation of what caused the error. I basically have to keep doing trial/error until something works.
My question is: Is there a better way to analyze the error messages that emulator shows (basically some stack trace about Dalvik)!
Also, is it possible in Eclipse [when debugging] to move the debugging cursor backwards to re-evaluate a variable or "skip" some lines of code?
Use LogCat view to see error/debugging messages. Regular console is of very limited help. Window->Show View->Other->Android->LogCat There on the top you will see some round buttons that basically can filter log from V (verbose) to E (error). You can't copy/paste from theLogCat window but you can save selected output to text file
Regarding the error messages (I'm assuming these are the messages that show up in LogCat): I've found that analysing the error messages and working your way up the list until you reach code that is yours is the most effective way to work. Frequently (for me at least) the emulator will crash and break somewhere in the OS code (which you probably don't have the source for) but you can follow the LogCat messages back to your code and start to see where the problem is. The crash may appear to happen in the OS code, but the original cause is typically you passing something wrong to the OS.
Regarding going backwards in code: nope, at least not with the my Eclipse Ganymede install
Regarding skipping code: When your in debug mode under the Run menu you can select "Step Over" (skips going into a method) , "Step Return" to exit a method and "Run to Line" in addition to setting Breakpoints by right clicking. This causes the code to run, but you aren't single stepping through it. Otherwise the only way to "skip" lines of code is to comment it out. I believe you can also change the value of variables in the debugger, but I've never tried personally. This may give you the desired effect.
Try closing all unrelated project, switch off eclipse and then do a clean and build for the project in picture.