giovedì 14 marzo 2013

 HABEMUS MBC!


 HOW TO SOLVE THE HORRIBLE ANDROID BUG CREATED FROM LAUNCHING AN .XML FILE (OBTAINING AN .OUT.XML FILE AND A THOUSAND ERRORS)
-
COME RISOLVERE L'ORRIBILE BUG ANDROID CREATO DAL LANCIARE UN FILE .XML (OTTENENDO UN FILE .OUT.XML E UN MIGLIAIO DI ERRORI)

Ok Guys. Hi Everyone.
Today I will tell you how to solve that horrible, horrorful, fearing, creepy, damned error that happens when you, keeping in mind 20-30 variables at the same time (human's standard is 4-8), decide to launch your app project and... You're XML VIEW IS OPEN!

1.1 The horrible, horrorful, fearing, creepy, damned error!!!
Keep calm.
Don't destroy your pc like I've done in "those 3 days"...
First of all you must know that you can avoid this bug downloading the last updates of Android sdk. With these, Eclipse don't launch the XML as an application, so you will not have this problem.
But you're obviously unlucky, even lazy, and you love you're working version of Eclipse... Android SDK... Why, why upgrading?

So this's for you. pc-Republicans.
You must simply delete the new generated .out.xml file  -->   <your_file_name>.out.xml.

So easy?
Yes, BUT you can encounter other errors...
First of all, eclipse can decide not to delete the damned file. In this case you must close Eclipse, go in your project directory, and clean you're file manually.
BUT now is time for java pending process... Yes, cause you've closed Eclipse BUT you haven't kill javaw.exe process. SO follow the image steps after saving all you're java-based programs, and after closing Eclipse & Netbeans
1.2 Kill javaw.exe

  1. Right click on application bar;
  2. Select Task Manager;
  3. Search for javaw.exe process in the process tab, then right click on it (ATTENTION! IT COULD BE CLOSED YET, SO YOU CAN'T APPLY THIS METHOD);
  4. Select Kill process;
Now your file is free. And you can finally delete him. You can even use ninja sword, if you have lost one eye.

And now? I've opened Eclipse, and is full of errors!!!
Yes, you're really unlucky. But you can solve it modifing one file and saving the project.  The billion's of error are caused from your R.java file. His task is to save all references of project resources, and when you have launched the xml file (nooooob) you drive Eclipse crazy. So Eclipse delete R.java and try to rebuild it (cause is an auto-generated file), but because of the errors could not.
But now the error is no more, so Eclipse is again able to rebuild R.java! AH-AAH!

...

NOOOOOO! IT CAN'T BE...
Yes... It can... You've established a Guinness World Record. 
By the way, the final step could be one of this two:
  1. Pasting another R.java. If you're lucky, Eclipse will update it, and you've saved you work;
  2. Creating another project, pasting ONLY you're activity classes, you're graphics/colors/array/strings resources and your jars. It's annoying, but it could save your sleep...
  3. Praying all known Gods, existed and not. Or challenge them. For sure you'd be lucky
That's all, folks!
Bye!

_________________________________________________________________________________

 HABEMUS MBC!

Ok gente. Ciao a tutti.
Oggi vi racconterò come risolvere quell'orribile, orrorifico, spaventoso, raccapricciante, dannato errore che accade quando, tenendo a mente 20-30 variabili contemporaneamente (lo standard umano è di 4-8), decidete di lanciare il vostro progetto e... LA VOSTRA VISTA XML E' ANCORA APERTA E SELEZIONATA!
Today I will tell you how to solve that horrible, horrorful, fearing, creepy, damned error that happens when you, keeping in mind 20-30 variables at the same time (human's standard is 4-8), decide to launch your app project and... You're XML VIEW IS OPEN AND SELECTED!

1.1 L'orribile, orrorifico, spaventoso, raccapricciante, dannato errore
State calmi.
Non distruggete il vostro pc come ho fatto in "quei 3 giorni"...
Prima di tutto dovete sapere che potete evitare questo bug scaricando gli ultimi aggiornamenti dell'Android SDK. Con questi, Eclipse non lancerà l'XML come un'applicazione, quindi non avrete questo problema.
Ma ovviamente siete sfortunati, anche pigri, e amate la vostra versione funzionante di Eclipse... L'Android SDK... Perché, perché aggiornare?

Quindi questo è per voi, pc-Repubblicani.
Dovete semplicemente cancellare il nuovo file .out.xml generato  -->   <tuo_nome_file>.out.xml.

E' così facile?
Si, MA potreste imbattervi in altri errori...
Prima di tutto, Eclipse può decidere di non cancellare il dannato file. In questo caso dovete chiudere Eclipse, andare nella cartella del progetto, e cancellare il file manualmente.
MA ora è il turno del processo java ancora attivo... Si, perché avete chiuso Eclipse MA non avete terminato il processo javaw.exe. Quindi seguite gli step nell'immagine DOPO aver salvato tutti i vostri programmi basati su java, e dopo aver chiuso Eclipse e Netbeans.

1.2 Kill javaw.exe

  1. Click destro sulla barra delle applicazioni;
  2. Selezionate "Avvia Gestione attività";
  3. Cercate il processo javaw.exe nel tab dei processi, quindi cliccateci sopra col tasto destro (ATTENZIONE: POTREBBE GIA' ESSERE CHIUSO, E QUINDI QUESTA PROCEDURA NON E' APPLICABILE);
  4. Selezionate "Termina processo";
Ora il vostro file è libero. E potete finalmente cancellarlo. Potete anche usare una spada ninja, se avete perso un occhio.

E adesso? Ho aperto Eclipse, ed è pieno di errori!!!
Si, sei davvero sfortunato. Ma puoi risolvere modificando un file a caso e salvando il progetto. I miliardi di errori sono causati dal tuo file R.java. Il suo compito è di salvare tutti i riferimenti delle risorse del progetto, e quando hai "lanciato" il file xml (nooooob) hai fatto impazzire Eclipse. Quindi Eclipse ha cancellato R.java e ha provato a ricostruirlo (perché è un file auto-generato), ma a causa degli errori non ha potuto.
Ma ora l'errore non c'è più, quindi Eclipse è di nuovo capace di ricostruire R.java! AH-AAH!

...

NOOOOOO! Non può essere...
Si... Può essere... Hai stabilito un Guinness World Record.
Comunque, il passo finale può essere uno di questi due:
  1. Incollare un altro R.java. Se sei fortunato, Eclipse lo aggiornerà, e avrete salvato il vostro lavoro;
  2. Creare un altro progetto, incollando SOLO le vostre classi Activity, le vostre risorse grafiche/colors/array/strings e i vostri jar. E' noioso, ma potrebbe salvarvi il sonno.
  3. Pregare tutti gli Dei noti, esistiti o meno. O sfidarli. Di sicuro sareste più fortunati!
That's all, folks!
Ciao!

Nessun commento:

Posta un commento