When adding Android support libraries as Gradle references, I get hundreds of build errors. The debug build log and project zip are below. FWIW, in the project linked below, I referenced the libraries via the old com.android.support namespace, but the newer androidx namespace had the same results.
N: Previous declaration was here [C:\…\EBuild\Obj\tests.annotations-DCF22A56CCE609933E210FD1F96CD59BA5A017C4\Debug\Cooper-Android\r\androidx\transition\R.java (12169)]
Btw, “annotations” in the project title is a misnomer I originally created the project to test something else. The project doesn’t use annotations/attributes/aspects anywhere.
it looks like there’s two packages (android-support-graphics-drawable and animated-vector-drawable) with an R.txt file, and both packages specify the same namespace (package name) in their Manifest.xml. (android.support.graphics.drawable). I;'m tempted to say animated-vector-drawable-28.0.0 is simply broken or these two are incompatible and not supposed to be used together — but I’ll investigate more, tomorrow.
I doubt this would affect it, but Google did move all of their support libraries to a new namespace, androidx, because Google. This was probably two years ago? Maybe one. I forget when exactly. Details on the mapping between the two can be found here.
That’s the official recommendation. Google is still maintaining the old namespace, but all updates will be in the androidx namespace:
You can continue to use the support library. Historical artifacts (those versioned 27 and earlier, and packaged as android.support.* ) will remain available on Google Maven. However, all new library development will occur in the AndroidX library.
We recommend using the AndroidX libraries in all new projects. You should also consider migrating existing projects to AndroidX as well.
Hmm, this one builds compiles clean for mew, Incremental. attaching my exact project, no other changes made on my side. But it fails with different DEX errors I’ll investigate:
PreDex still has the 500+ errors, im assuming thats an unrelatedly issue to the wring namespace we discussed yesterday, and I’ll start investigating that one, as well.
Curious. for PreDex, apt generates R.java source files, so we end up with dupe copies. for non-przdex it doesn’t, so we end up just with the ones EBuild generates. If I drop mine, PreDex too compiles clean. Now to find out why this is inconsistent…
Looks like you’re right. I added it to the test project assuming that Google had split the old appcompat-v7 into 2 parts, but the migration mapping only lists appcompat and not appcompat-resources.