Fixing Unresolved reference: synthetic for import kotlinx.android.synthetic.main.activity_add_widget?

Viewed 882

I am trying to build https://github.com/zacharee/LockscreenWidgets on Ubuntu 18.04 ; so I got the code from git (and removed references as noted in settings.gradle and app/build.gradle), and tried to build it from via ./gradlew assemble from the command line, and it failed with:

e: /path/to/LockscreenWidgets_git/app/src/main/java/tk/zwander/lockscreenwidgets/activities/AddWidgetActivity.kt: (15, 24): Unresolved reference: synthetic
...

This fails on the line:

import kotlinx.android.synthetic.main.activity_add_widget.*

Then I downloaded Android Studio 4.0.1, installed SDK 29 there (it got installed to its own subdirectory; did this via Android Studio/File/Settings/Appearance and Behavior/System Settings/Android SDK), replaced the android.jar there as in instructions, and tried again:

screenshot-android-studio

The funny thing is, if I start typing out the same line, autocomplete finds everything, no problem:

enter image description here

Does anyone have any idea, what do I have to do in Android Studio, so that this project finds kotlinx.android.synthetic (and hopefully builds without error)?

0 Answers
Related