0

Yesterday, I was preparing to run an app that has worked perfectly for weeks when I accidentally pushed the debug button instead of the run button. While before I had 0 errors now I have over 20. All of them have to do with not resolving the R class anymore.

I have combed stackoverflow and tried many of the "fixes" but to no avail. I have tried cleaning, rebuilding, syncing, manually importing then rebuilding etc etc. Most of those fixes come from last year anyway. I am using version 0.5.2. I am new to Android development and Android studio (and stackoverflow for that matter) so I apologize if this question is trivial or has been answered before.

Solved:

There was an undisclosed error in a string resource.

Android XML Percent Symbol

...is roughly equivalent to my mistake.

Community
  • 1
  • 1
ACL
  • 1
  • 1
  • Does the run button still work? It sounds like you have an error in one of your XML files, and by sheer coincidence this error appeared before you hit the debug button. Also, why are you on such an old build of Android Studio? – Bryan Herbst Jul 03 '14 at 14:36
  • No the run button produces all the same errors now, but all my XML is perfect. I never changed any of it, and all of it had been tested dozens of times before. Nevertheless, I have looked over all of it half a dozen times now. This error only occurred after I hit the debug button. This app had run perfectly many times before that. – ACL Jul 03 '14 at 14:40
  • As for my version, is it really that old? Google says this version was released in May 2014. The only other more recent download I can find is the L one released a few days ago. – ACL Jul 03 '14 at 14:41
  • Do your Gradle Console or messages window show any errors? As for AS versioning- The latest preview version prior to the beta (0.8.0 and 0.8.1) was 0.6.1, but you might need to switch to the canary channel to get it. As for the beta- although the beta did introduce support for the L preview, it is also the latest stable version of AS, regardless of whether you are using the L-preview. – Bryan Herbst Jul 03 '14 at 14:44
  • Yes, dozens of them. They all go something like "cannot resolve symbol R", which leads to even more errors because then it can't find the resources. I will get the L preview then simply copy/paste the whole project over, as I saw someone else say that copy/pasting into a new project worked (although they had no idea why). – ACL Jul 03 '14 at 14:52
  • And those erros **all** only complain about the missing R? What about if you click the terminal button and run `gradlew assembleDebug`? – Bryan Herbst Jul 03 '14 at 14:54
  • 1
    Ahh thank you very much! There was in fact an xml error (my bad). Buried with all the R errors was a message talking about non-positional format. According to stackoverflow, this error comes from an unescaped % sign in a string. Deleting that string has fixed the issue. Thank you again, this was really bothering me. – ACL Jul 03 '14 at 15:02
  • Don't forget to post your solution as an answer, then accept it in case other users come along with a similar problem! – Bryan Herbst Jul 03 '14 at 15:03

0 Answers0