Make androidx compatibile with AGP 4.1

- Adds workarounds for API source incompatibilities
- Removes no longer supported gradle property android.namespacedRClass

Test: ./gradlew tasks -> still works with 3.6.1 plugin
Bug: 150427408
Bug: 150800094
Change-Id: Iecfb1eb8bc09c808f78a62d17b3fba55c868f6a4
diff --git a/buildSrc/build_dependencies.gradle b/buildSrc/build_dependencies.gradle
index 959c49fb..aeafc41 100644
--- a/buildSrc/build_dependencies.gradle
+++ b/buildSrc/build_dependencies.gradle
@@ -29,9 +29,10 @@
     build_versions.lint = '26.6.1'
 }
 
-if (System.getenv("GRADLE_PLUGIN_VERSION") != null) {
-    logger.warn("Using custom version of AGP due to GRADLE_PLUGIN_VERSION being set.")
-    build_versions.agp = System.getenv("GRADLE_PLUGIN_VERSION")
+def agpOverride = System.getenv("GRADLE_PLUGIN_VERSION")
+if (agpOverride != null) {
+    logger.warn("Using custom version ${agpOverride} of AGP due to GRADLE_PLUGIN_VERSION being set.")
+    build_versions.agp = agpOverride
 }
 
 build_versions.dokka = '0.9.17-g007'