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!
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?
-
same issue - R.java file not found in app/build/generated/source/r/debug/
-
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:
- same issue - R.java file not found in app/build/generated/source/r/debug/
- 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}
The path to the R.java file that I believe the book is talking about:
app\build\generated\not_namespaced_r_class_sources\debug\processDebugResources\r\com\bignerdranch\android\geoquiz
Here it is on a live system. My two variables from the book, true_button and false_button at listed in the file along with hundreds of other definitions from the system.
However, the Android Build doesnât find them. Everything on my system has been loaded off the Android site in the last 7 days. So, itâs all the latest.
C:\Users\JPL\AndroidStudioProjects\MyApplication5\app\build\generated\not_namespaced_r_class_sources\debug\r\com\example\myapplication5\R.java
In my environment (Android Studio 4.0; Gradle 4.0.0) the R.java source file has been deleted after being compiled and archived into:
app/build/intermediates/compile_and_runtime_not_namespaced_r_class_jar/debug/R.jar
$ jar -t -f ./app/build/intermediates/compile_and_runtime_not_namespaced_r_class_jar/debug/R.jar | grep geoquiz
com/bignerdranch/android/geoquiz/R$styleable.class
com/bignerdranch/android/geoquiz/R$color.class
com/bignerdranch/android/geoquiz/R$style.class
com/bignerdranch/android/geoquiz/R$dimen.class
com/bignerdranch/android/geoquiz/R$string.class
com/bignerdranch/android/geoquiz/R$attr.class
com/bignerdranch/android/geoquiz/R$mipmap.class
com/bignerdranch/android/geoquiz/R$id.class
com/bignerdranch/android/geoquiz/R$integer.class
com/bignerdranch/android/geoquiz/R$bool.class
com/bignerdranch/android/geoquiz/R$anim.class
com/bignerdranch/android/geoquiz/R$layout.class
com/bignerdranch/android/geoquiz/R$interpolator.class
com/bignerdranch/android/geoquiz/R$drawable.class
com/bignerdranch/android/geoquiz/R.class
Numerous other classes appear to exist in that same archive.