https://kotlinlang.org logo
#android
Title
# android
a

azri

05/23/2018, 2:54 AM
Hi. Anyone here facing the problem where the kotlinx synthetic references frequently become unresolvable in Android Studio 3.1.2? I find myself having to click sync gradle every now & then. Also happens to my team members.
🙋‍♂️ 4
Using kotlin 1.2.41
I'd like to know if there's a temporary fix we can use & if a permanent fix is on the way.
a

alex2069

05/23/2018, 3:22 AM
I've had this - usually happens if I did a
clean
or a
Build > Rebuild
. Only option then is to do sync. I believe it's partially a limitation of Android Gradle (you're clearing the generated IDs and a sync rebuilds them)
😞 1
More specifically I think it's the task
generateDebugResValues
that generates them (which is run when you sync)
a

azri

05/23/2018, 3:46 AM
But.. this never happened before AS 3.1 😟
a

alex2069

05/23/2018, 3:47 AM
There were a lot of changes to Android Gradle at 3.1 (a lot of lazy initialization and resolution was added I believe)
For memory there is a bug on youtrack about it
🤓 1
a

azri

05/23/2018, 3:49 AM
I've been using kotlin since AS 2.3 & only now has it appeared & driving me nuts 🤪
a

alex2069

05/23/2018, 3:50 AM
Yea it's quite annoying lol I think it's also somewhat related to Gradle's configure on demand aspect or something (it's all about the "only run what needs to be run" kind of thing)
a

azri

05/23/2018, 3:54 AM
Apparently it will always happen if you run gradle tasks from cmd line..
a

alex2069

05/23/2018, 4:42 AM
Ah nice find