classNotFoundException:android.view.onbackinvokedCallback,构成1.2.0-alpha07

发布于 2025-01-24 06:52:41 字数 2126 浏览 0 评论 0原文

由于更新到androidx.com pose 1.2.0-alpha06我看不到任何预览。我在任何地方都没有发现类似的问题。预览渲染器与以下消息

java.lang.ClassNotFoundException: android.view.OnBackInvokedCallback
    at com.android.tools.idea.rendering.classloading.loaders.DelegatingClassLoader.findClass(DelegatingClassLoader.kt:81)
    at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:589)
    at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
    at com.android.tools.idea.rendering.classloading.loaders.DelegatingClassLoader.loadClass(DelegatingClassLoader.kt:65)
    at androidx.compose.ui.tooling.ComposeViewAdapter$FakeOnBackPressedDispatcherOwner$1.<init>(ComposeViewAdapter.kt:744)
    at androidx.compose.ui.tooling.ComposeViewAdapter.<init>(ComposeViewAdapter.kt:743)
    at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
    at org.jetbrains.android.uipreview.ViewLoader.createNewInstance(ViewLoader.java:352)
    at org.jetbrains.android.uipreview.ViewLoader.loadClass(ViewLoader.java:189)
    at org.jetbrains.android.uipreview.ViewLoader.loadView(ViewLoader.java:149)
    at com.android.tools.idea.rendering.LayoutlibCallbackImpl.loadView(LayoutlibCallbackImpl.java:301)
    ...

相似问题没有任何人回答。 应用指定的解决方法在这里 尽管情况似乎与我的情况相似,但错误与我的不同,我想这就是原因。 我看到了一个设置与撰写版本相同的作曲版本所需的问题,这无济于事。我的Activity-KTX版本是1.6.0-Alpha01。

我正在使用 Android Studio Bumblebee | 2021.1.1补丁3

Since updating to androidx.compose 1.2.0-alpha06 I'm unable to see any previews. I haven't found similar issues anywhere. Preview renderer crashes with the following message

java.lang.ClassNotFoundException: android.view.OnBackInvokedCallback
    at com.android.tools.idea.rendering.classloading.loaders.DelegatingClassLoader.findClass(DelegatingClassLoader.kt:81)
    at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:589)
    at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
    at com.android.tools.idea.rendering.classloading.loaders.DelegatingClassLoader.loadClass(DelegatingClassLoader.kt:65)
    at androidx.compose.ui.tooling.ComposeViewAdapter$FakeOnBackPressedDispatcherOwner$1.<init>(ComposeViewAdapter.kt:744)
    at androidx.compose.ui.tooling.ComposeViewAdapter.<init>(ComposeViewAdapter.kt:743)
    at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
    at org.jetbrains.android.uipreview.ViewLoader.createNewInstance(ViewLoader.java:352)
    at org.jetbrains.android.uipreview.ViewLoader.loadClass(ViewLoader.java:189)
    at org.jetbrains.android.uipreview.ViewLoader.loadView(ViewLoader.java:149)
    at com.android.tools.idea.rendering.LayoutlibCallbackImpl.loadView(LayoutlibCallbackImpl.java:301)
    ...

Similar issue has not been answered by anyone.
Applying the workaround specified here did not work, although the case seems similar to mine, the error differs from mine, I guess that's the reason.
I saw an issue that required to set the same compose-activity version as compose version, it did not help. My activity-ktx version is 1.6.0-alpha01.

I'm using
Android Studio Bumblebee | 2021.1.1 Patch 3

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

甜心 2025-01-31 06:52:41

尝试使用活动1.5.0-beta01作为1.6.0-alpha01仅与Android 13开发人员预览2 SDK兼容,如下所示: https://developer.android.com/jetpack/androidx/releases/activitivity#1.6.0-alpha01

Try using Activity 1.5.0-beta01 as 1.6.0-alpha01 is only compatible with Android 13 Developer Preview 2 SDK as indicated here: https://developer.android.com/jetpack/androidx/releases/activity#1.6.0-alpha01

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文