Sunday, September 8, 2019

When Android Gradle sync fails with "could not get unknown property 'com'"

Today I helped a student who couldn't build any Android Studio projects because sync always failed with "could not get unknown property 'com'", with the stack trace not referring to the user's Gradle buildscripts. The normal strategy of invalidating Android Studio caches didn't help, nor even did reinstalling Android Studio! After a lot of poking around, we fixed the problem by removing the .gradle folder from the user's home directory. Apparently something in the shared Gradle cache was corrupt.

No comments:

Post a Comment