Made a new project with `dev05` today and cannot g...
# compose
c
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
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
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
sure
a
I've had the crazy autocomplete thing happen too, it's not just you 🙂
4
c
Tried to upload a gif, must have failed for being too big.
oh there it is!
i
@codeslubber same thing happens to me, just a matter of manually typing it and not allowing code complete to finish your statement.
c
@Ian Warwick of course I figured that out? but once it’s in there, the code no longer compiles…
i
ah what happens? I have one usage and its working
c
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
ah 😞
This seems to work here though not sure how its different
Copy code
Text(text = "Hello", style = MaterialTheme.typography().h3)
c
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
cool
c
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
aha is it on the
Build
pane in AS?
compile error would usually spit out the build log there
c
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
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
lemme pull the other error out
i
specially with canary builds sometimes projects can get corrupted idea metadata
c
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
sometimes highlighting a higher node in that error tree display will format it so that it can be read more easily
c
yeah nope
a
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
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
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
@codeslubber would you mind filing a bug to Android Studio for the auto-completion issue?
c
sure
l
If you link the bug once filed here, I can reassign accordingly
c
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
No, that's fine, just a report with the gif you uploaded with the version of Studio you are running would be helpful
c
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
Thanks for filing! Would you mind attaching the gif there?
👍🏻 1
c
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
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
@Kazemihabib1996 yeah that’s what I said on the thread: adding the options?
k
yeah, by adding those composeOptions.