Clean build before running Android application - android

During my development under Android I saw that if I don't clean before building and running the application, it will keep some old files giving me no-sense errors since they were fixed one or two runs before.
Have you ever experienced this problem? Any idea of how to prevent it / how to clean always before running the application on Eclipse?

This is not happen always. Most of the time if you not clear the project before build won't harm the application. I clear it form time to time, mostly when I change something in xml files, but for regular app checking I don't think you have to do it and I doubt that there is any method to clear before each build.

Related

Flutter Caching Very Old Errors

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.

Android Studio freezes when changing a source file

I really need some help with this.
I had to migrate from Eclipse to Android Studio.
I exported my project (at first time - using "export" tool, at the second time manually - same result) and everything worked great (I worked for 2 days successfully) before I tried to make an apk-file. While making an apk-file, AStudio was complaining about some things like "change your customNS to res-auto" and when I did so, it started to freeze. If it freezes it's over, I have to kill the process of AS. When I reload AS, it makes a rebuild and then deadly freezes again. I figured, the build itself doesn't hang the AS, it freezes when I try to interact with source files. Try to print just a single letter - and it's over.
I ran this project on my friend's laptop (it's more powerful than mine) and it doesn't freeze there. But I'm not sure it's really connected with the power of PC.
Please give me some advice. Thanks.
So, problem solved. I had in my file some if-else-if structure with about 50 conditions. Refactoring it solved the freezing problem.
That's probably AStudio's way of punishing those who write bad code :)

Android Studio shuts down forcefully

I am having a good problem with Android Studio. Initially I was using eclipse to develop android App, but eclipse display funny stuffs like deleting all my codes and most times crashes so I decided to try Android Studio.
Now am using android studio, but whenever I open an activity to start typing code, the IDE forcefully shuts down. Initially i tougth this happens when there is an error in your code, because I had an instance where the IDE shut down, was fixed by correcting the errors. But now the codes are all correct and when I install on emulator it installs properly.
But whenever I open an Activity and start to type Android Studio shuts down. I have tried to check for similar question, but could not find anything suitable. Please I need your help because I have a lot of project with deadlines and this AS behaviour is making me run nuts.. Thanks
There might be memory issue with Android Studio. I recommend you to shutdown all the heavy-weight memory consuming application like Chrome etc. to be shutdown.
I hope it will help.
Thanks all I finally got the solution to the shutdown. I had to create all the Activity used from AS and copy the codes into each file created. Initially i copied all the Activities, resources and Manifest I created in eclipse and paste them into AS. I guess AS doesn't perform auto update and this cause it not have have reference of the pasted files in memory making it to crash.
Sometimes some plugins keep running if studio crashes and they consume so much memory that studio is not able to launch again.
Or see if other applications are running and consuming much memory.
Or you can restart the system.

Android Debugging wont work XSLT error

I ran my program just fine a few minutes ago, and when I added more functionality now it is telling me "The JRE Instance Default XSLT processor does not support debugging_ Would you like to debug using the default Xalan 2.7.1 processor instead?"
I did restart Eclipse maybe that has something to do with it? :/
It's my first times writing an app so if I have to set something in eclipse each time maybe that's why? and what is it if that is the case.
Thanks!
You were in an XML file when you hit debug, I would bet. Happens to me all the time. For some annoying reason it does something entirely different that I don't understand when you do that. Delete the .out.xml that should probably have been created, open a .java file, and try to debug again. Another way is to just right-click your project and do Run As > Android Application.

How do I get the Android R.file to update automatically quicker?

Sometimes the R.file updates immediately for me, other times it takes a long time to update when I add #+id in my xml files, is there a way to speed this automatic process up especially for times when it takes 15-20min
We need more details.
I'm assuming you are referring to your IDE not refreshing quickly enough.
What IDE are you using? If you are using eclipse for instance, you can select Project->Clean and do a clean build of your project. That will generate the R file again.

Categories

Resources