https://kotlinlang.org logo
#compose
Title
# compose
j

Jan Skrasek

09/03/2020, 5:29 PM
by remember {  }
property delegate was removed? or any idea why it is not working?
Type 'TypeVariable(T)' has no method 'getValue(Nothing?, KProperty<*>)' and thus it cannot serve as a delegate
• AS 4.2.0-alpha09 • Compose 1.0.0-alpha02 Maybe the issue is AS cannot find the declaration of remember (though suggesting it in autocomplete) (import androidx.compose.runtime.rememberimport androidx.compose.runtime.remember)
j

jim

09/03/2020, 5:31 PM
but I do have a question as to why you are just running into this now? Do you have a project that was previously working that broke as a result of the upgrade? I was looking into this bug because a bunch of people have mentioned it over the last month or two but I don't see any changes in IDE behavior.
m

Marcin Środa

09/03/2020, 5:33 PM
Just import:
Copy code
import androidx.compose.runtime.setValue
import androidx.compose.runtime.getValue
edited: forget about runtime, thanks @Adam Powell
j

Jan Skrasek

09/03/2020, 5:33 PM
Oh, this is not much intuitive 😄 Actually, I wrote the code for the first time yesterday, since I've seen in the examples (mostly videos), but they do not mention getValue import so I had no idea it is needed. But the main question is now - how can I import it with AS? The autocomplete (alt+enter on the function) doesn't suggest anything like it.
a

Adam Powell

09/03/2020, 5:34 PM
they moved to
androidx.compose.runtime.*
but other than that, yes
j

Jan Skrasek

09/03/2020, 5:37 PM
Thanks guys, now it compiles. 👍 Still don't know why: • cannot find declaration to go to ^^^ • is there any other way than adding manually that imports
y

Yashovardhan

09/03/2020, 5:38 PM
I faced similar issues until AS finally promoted me to import these. I think studio is acting a bit random specifically with these 2 imports. Sometimes it will prompt you to import these, other times it just won't
a

Adam Powell

09/03/2020, 6:20 PM
we're treating it as an IDE bug at the moment. You should be able to alt+enter to apply the quick fix to import
👍 7
j

JD

09/03/2020, 9:28 PM
When i had tried even the alt enter import did not add it
a

Adam Powell

09/04/2020, 1:49 PM
Yes, that's the bug 🙂
c

chao

09/19/2020, 4:35 AM
Is there a tracking issue for Android Studio or IDEA? Just wondering if we can track progress. I even noticed this being called out in the codelab.
2 Views