My Android Studio Kotlin plugin updated however no...
# compose
b
My Android Studio Kotlin plugin updated however now I’m getting errors for all my Compose code saying it was compiled using a pre-released version of Kotlin. Perhaps related to https://kotlinlang.slack.com/archives/CJLTWPH7S/p1595908172474900 🤔
z
Yes, i think dev16 should support the RC, and those errors will go away then.
f
just changing the kotlin version in the buildscript seems to have fixed it
b
I tried changing it haha, what version did you use @Fudge?
f
ext.kotlin_version = "1.4.0-rc"
b
Oh 🤦🏻 I tried that but with capital RC 😕
@Fudge did doing that make your previews not work?
f
it seems they don't work in dev 15
s
So preview doesnt workin with dev15, right? Or am I missing something?
v
@Sinan Kozak, you are right. Preview doesn’t work ( 1.4.0-rc & dev15)
b
I just got a Android Studio 4.2 Canary 6 update, they seem to be working again
🙌 3
s
I can verify the same thing. Thank you for the tip
p
Having trouble with preview on 1.4.0-rc, dev15, AGP 4.2.0-canary7, AS 4.2 Canary 7. Anyone seen this in the preview tab’s errors section (pops up when clicking the red exclamation point icon)?
Copy code
The following classes could not be instantiated:
- androidx.ui.tooling.preview.ComposeViewAdapter (Open Class, Show Exception, Clear Cache)
Tip: Use View.isInEditMode() in your custom views to skip code or show sample data when shown in the IDE.  If this is an unexpected error you can also try to build the project, then manually refresh the layout.  Exception Details:


java.lang.NoClassDefFoundError: Could not initialize class androidx.compose.FrameManager
	at androidx.ui.core.WrapperKt.setContent(Wrapper.kt:180)
	at androidx.ui.core.WrapperKt.setContent$default(Wrapper.kt:175)
	at androidx.ui.tooling.preview.ComposeViewAdapter.init$ui_tooling_release(ComposeViewAdapter.kt:297)
	at androidx.ui.tooling.preview.ComposeViewAdapter.init(ComposeViewAdapter.kt:366)
	at androidx.ui.tooling.preview.ComposeViewAdapter.<init>(ComposeViewAdapter.kt:149)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
	at org.jetbrains.android.uipreview.ViewLoader.createNewInstance(ViewLoader.java:399)
	at org.jetbrains.android.uipreview.ViewLoader.loadClass(ViewLoader.java:189)
	at org.jetbrains.android.uipreview.ViewLoader.loadView(ViewLoader.java:147)
	at com.android.tools.idea.rendering.LayoutlibCallbackImpl.loadView(LayoutlibCallbackImpl.java:303)
	at android.view.BridgeInflater.loadCustomView(BridgeInflater.java:417)
	at android.view.BridgeInflater.loadCustomView(BridgeInflater.java:428)
	at android.view.BridgeInflater.createViewFromTag(BridgeInflater.java:332)
	at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:959)
	at android.view.LayoutInflater.inflate(LayoutInflater.java:657)
	at android.view.LayoutInflater.inflate(LayoutInflater.java:499)
	at com.android.layoutlib.bridge.impl.RenderSessionImpl.inflate(RenderSessionImpl.java:347)
	at com.android.layoutlib.bridge.Bridge.createSession(Bridge.java:435)
	at com.android.tools.idea.layoutlib.LayoutLibrary.createSession(LayoutLibrary.java:141)
	at com.android.tools.idea.rendering.RenderTask.createRenderSession(RenderTask.java:705)
	at com.android.tools.idea.rendering.RenderTask.lambda$inflate$6(RenderTask.java:860)
	at com.android.tools.idea.rendering.RenderExecutor$runAsyncActionWithTimeout$2.run(RenderExecutor.kt:170)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)
b
@Pete Doyle what version of kotlin is in your build.gradle files?
p
Best I can tell, it’s 1.4.0-rc