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

codeslubber

02/28/2020, 12:28 AM
Made a new project with
dev05
today and cannot get
MaterialTheme.typography().h3
(or any other style) to work. Reports a code generation error and says see the log? also, if you just type MaterialTheme.typ and choose the code completion suggestion, it drops in a crazy string that includes a package name?
l

Leland Richardson [G]

02/28/2020, 1:46 AM
not sure what this would be, but make sure you’re only calling
typography()
from a composable function as it itself is a composable function?
c

codeslubber

02/28/2020, 1:51 AM
yes of course I am, thanks @Leland Richardson [G], I could make a short video if you want, I did it twice because it was so strange.. I could swear it did enlarge the text, but then it would not even compile…
l

Leland Richardson [G]

02/28/2020, 1:52 AM
sure
a

Adam Powell

02/28/2020, 2:29 AM
I've had the crazy autocomplete thing happen too, it's not just you 🙂
4
c

codeslubber

02/28/2020, 4:25 AM
Tried to upload a gif, must have failed for being too big.
oh there it is!
i

Ian Warwick

02/28/2020, 9:31 AM
@codeslubber same thing happens to me, just a matter of manually typing it and not allowing code complete to finish your statement.
c

codeslubber

02/28/2020, 3:03 PM
@Ian Warwick of course I figured that out? but once it’s in there, the code no longer compiles…
i

Ian Warwick

02/28/2020, 3:05 PM
ah what happens? I have one usage and its working
c

codeslubber

02/28/2020, 3:06 PM
and guess what it was working for me before too! but as the video shows the minute it’s in there, the compiler fails trying to generate code…
i

Ian Warwick

02/28/2020, 3:07 PM
ah 😞
This seems to work here though not sure how its different
Copy code
Text(text = "Hello", style = MaterialTheme.typography().h3)
c

codeslubber

02/28/2020, 3:08 PM
that didn’t work for me either! I tried that
wait the movie is useless cause you cannot see the error
lemme just put the error on this thread
i

Ian Warwick

02/28/2020, 3:08 PM
cool
c

codeslubber

02/28/2020, 3:10 PM
how can it be in 2020 that I cannot copy and paste a compiler error????
@Ian Warwick do you know where the log is? it says see the log..
i

Ian Warwick

02/28/2020, 3:12 PM
aha is it on the
Build
pane in AS?
compile error would usually spit out the build log there
c

codeslubber

02/28/2020, 3:15 PM
Found it:
<http://java.io|java.io>.IOException: '/Users/robwilliams/Documents/workspaces/android/suntimerandroid/.idea/codeStyles' is not a directory in VFS
so for whatever reason I guess the directory it thought it setup for putting theme style info is not there
it gave me the option to report it to google which I did, so I guess something went wrong in the setup of the project
i

Ian Warwick

02/28/2020, 3:16 PM
yeh that is odd I am not sure its related since, its just AS failing to find a codeStyles inside the
.idea
folder 🤔
I wonder if just deleting all .idea files and reimporting your project into AS will fix it
c

codeslubber

02/28/2020, 3:17 PM
lemme pull the other error out
i

Ian Warwick

02/28/2020, 3:17 PM
specially with canary builds sometimes projects can get corrupted idea metadata
c

codeslubber

02/28/2020, 3:17 PM
the reason I was asking for the log file
is it says see the log, in addition to putting an error in the build window
the backend internal error is very long and that’s the one I was trying to figure out how to copy/paste
a

Adam Powell

02/28/2020, 3:24 PM
sometimes highlighting a higher node in that error tree display will format it so that it can be read more easily
c

codeslubber

02/28/2020, 3:27 PM
yeah nope
a

Adam Powell

02/28/2020, 3:28 PM
I might have missed it above, but can you post the code surrounding the call that's giving you problems?
If possible, the whole function and containing class, if there is one.
c

codeslubber

02/28/2020, 3:30 PM
Copy code
//            Text(text = timerState.value.currentStatus, style = TextStyle(fontSize = 36.sp))
            Text(text = timerState.value.currentStatus, style = MaterialTheme.typography().h3)
the first line works, the commented one, the second makes code generation fail
despite the fact that I did it in at least 4 or 5 other projects in prior releases
i

Ian Warwick

02/28/2020, 3:35 PM
I have no idea here though hit this one before, the compiler plugin got updated for dev05, might be worth checking over gradle config if not done so already
l

Louis Pullen-Freilich [G]

02/28/2020, 3:46 PM
@codeslubber would you mind filing a bug to Android Studio for the auto-completion issue?
c

codeslubber

02/28/2020, 3:51 PM
sure
l

Louis Pullen-Freilich [G]

02/28/2020, 3:51 PM
If you link the bug once filed here, I can reassign accordingly
c

codeslubber

02/28/2020, 3:53 PM
should I be running the new release? I am still running dev05 out of Canary 9
?
also where is the Submit a bug now?? I thought it was under Help…
l

Louis Pullen-Freilich [G]

02/28/2020, 4:02 PM
No, that's fine, just a report with the gif you uploaded with the version of Studio you are running would be helpful
c

codeslubber

02/28/2020, 4:06 PM
so I made this from the project template, so all the defaults there
however, the IDE suggested updating the gradle plugin then once I did that I got that error that the wrapper’s version was too old, so I updated that too
(that has happened before…)
150431765
holy crap I clicked on ‘Use the new UI’ !!! looks SO MUCH BETTER!! yay
l

Louis Pullen-Freilich [G]

02/28/2020, 4:13 PM
Thanks for filing! Would you mind attaching the gif there?
👍🏻 1
c

codeslubber

02/28/2020, 4:13 PM
ok just because I am an incurable complainer, jesus christ there must be a better way!! all IDEs should have ways to record sessions and then use an excerpt to report an issue
ok done
k

Kazemihabib1996

03/02/2020, 12:44 PM
I solved
code generation error
by adding
composeOptions {
kotlinCompilerVersion "1.3.61-dev-withExperimentalGoogleExtensions-20200129"
kotlinCompilerExtensionVersion "0.1.0-dev05"
}
in app build.gradle
c

codeslubber

03/02/2020, 3:55 PM
@Kazemihabib1996 yeah that’s what I said on the thread: adding the options?
k

Kazemihabib1996

03/02/2020, 5:07 PM
yeah, by adding those composeOptions.