R file not found

Book says R file should be under app/build/generated/source/r/debug however, as of Android Studio version 3.3.1 the only folder under source is buildConfig. Where is the R file located now?

Did you ever figure this out? I’m stuck here now as well.

I found a possible fix, though it isn’t what the book says.

Do this:
Build -> Clean Project
Build -> Rebuild Project

The path to the R.java file then should be in the directory
app/build/generated/not_namespaced_r_class_sources/debug/processDebugResources/r/com/bignerdranch/android/geoquiz

I really don’t know if this is the fix to this, I found it here: No R.Java (purchased book)

But even on that post someone implies that this shouldn’t be how our app is and there is possibly an error.

If and when I found a solution, I will let you know!

1 Like

Have you tried a Clean and re-building the project? Android Studio used to do a preemptive build and it doesn’t seem to do that any longer. If you try this and still have an issue, let me know.

i have the same problem and i have spent like 4 hours and still nothing.
I also made a question in Stackoverflow

Did you find a solution?

  1. same issue - R.java file not found in app/build/generated/source/r/debug/

  2. in fact there is no directory named “app/build/generated/source/r”
    (there are directories (“app/build/generated/source/apt” and
    “app/build/generated/source/buildconfig”

3 I see from file search there are a bunch of “r.java” in various subdirectories of "app/build/generated/not_namespaced_r_class_sources. {CONTINUED}

4 one of those r.java files found under ‘…not_named…’ has 13000 lines in it.

5 i have built this from scratch twice and update android studio and it all keep happening. and I have done “build” and “clean”

I’m having same problem. my more detailed is 14 days old.

Quoting from my first note:

  1. same issue - R.java file not found in app/build/generated/source/r/debug/
  2. in fact there is no directory named “app/build/generated/source/r”
    (there are directories (“app/build/generated/source/apt” and
    “app/build/generated/source/buildconfig”

3 I see from file search there are a bunch of “r.java” in various subdirectories of "app/build/generated/not_namespaced_r_class_sources. {CONTINUED}