java.lang.UnsupportedOperationException:不支持的服务:可访问性android studio [英] java.lang.UnsupportedOperationException: Unsupported Service: accessibility android studio

查看:26
本文介绍了java.lang.UnsupportedOperationException:不支持的服务:可访问性android studio的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到了这个 UnsupportedOperationException 的问题.我最近切换到 android studio,所以这对我来说很新.我想将 recyclerview 添加到我的项目中,并用它做一些事情,但布局设计师给我抛出了这个错误:

I have ran into a problem with this UnsupportedOperationException. I have recently switched to android studio, so it is quite new for me. I wanted to add the recyclerview into my project, and do stuff with it, but the layout designer throws me this error:

java.lang.UnsupportedOperationException: Unsupported Service: accessibility
at com.android.layoutlib.bridge.android.BridgeContext.getSystemService(BridgeContext.java:465)
at android.support.v7.widget.RecyclerView.<init>(RecyclerView.java:290)
at android.support.v7.widget.RecyclerView.<init>(RecyclerView.java:266)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at org.jetbrains.android.uipreview.ViewLoader.createNewInstance(ViewLoader.java:379)
at org.jetbrains.android.uipreview.ViewLoader.loadView(ViewLoader.java:99)
at com.android.tools.idea.rendering.LayoutlibCallback.loadView(LayoutlibCallback.java:172)
at android.view.BridgeInflater.loadCustomView(BridgeInflater.java:207)
at android.view.BridgeInflater.createViewFromTag(BridgeInflater.java:132)
at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:806)
at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:64)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:782)
at android.view.LayoutInflater.inflate(LayoutInflater.java:504)
at android.view.LayoutInflater.inflate(LayoutInflater.java:385)
at com.android.layoutlib.bridge.impl.RenderSessionImpl.inflate(RenderSessionImpl.java:401)
at com.android.layoutlib.bridge.Bridge.createSession(Bridge.java:329)
at com.android.ide.common.rendering.LayoutLibrary.createSession(LayoutLibrary.java:333)
at com.android.tools.idea.rendering.RenderService$5.compute(RenderService.java:674)
at com.android.tools.idea.rendering.RenderService$5.compute(RenderService.java:663)
at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:932)
at com.android.tools.idea.rendering.RenderService.createRenderSession(RenderService.java:663)
at com.android.tools.idea.rendering.RenderService.render(RenderService.java:790)
at com.intellij.android.designer.designSurface.AndroidDesignerEditorPanel$6.run(AndroidDesignerEditorPanel.java:480)
at com.intellij.util.ui.update.MergingUpdateQueue.execute(MergingUpdateQueue.java:320)
at com.intellij.util.ui.update.MergingUpdateQueue.execute(MergingUpdateQueue.java:310)
at com.intellij.util.ui.update.MergingUpdateQueue$2.run(MergingUpdateQueue.java:254)
at com.intellij.util.ui.update.MergingUpdateQueue.flush(MergingUpdateQueue.java:269)
at com.intellij.util.ui.update.MergingUpdateQueue.flush(MergingUpdateQueue.java:227)
at com.intellij.util.ui.update.MergingUpdateQueue.run(MergingUpdateQueue.java:217)
at com.intellij.util.concurrency.QueueProcessor.runSafely(QueueProcessor.java:238)
at com.intellij.util.Alarm$Request$1.run(Alarm.java:327)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:439)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
at java.lang.Thread.run(Thread.java:662)

应该是什么问题,老实说我不知道​​.我看过在项目中实现 RecyclerView 的教程,但这是我使用 Google 官方代码后 Android Studio 给我的.

What should be the problem, I don't honestly know. I've watched tutorials for implementing RecyclerView into the project, but this is what Android Studio gives me back after I use the official Google code.

似乎已解决,因为我接受的答案是正确的,但我没有自己尝试过.

It seems it is resolved as the answer I accepted is correct, but I did not tried it on my own.

当我接受当前的答案时,它与我的问题有些相关,但这不是一个完整的解决方案.如果有人可以或可以为此提供一些修复或解决方法,只要提供此类信息,或者问题是否已由 IntelliJ 或开发人员解决,我就会更新已接受的答案.也感谢 Dave 指出它失败的地方,至少我们可以给开发者写一张票:)

As I accepted the current answer, it is somewhat relevant to my issue, but it's not a full solution. If anyone can or could provide some fix or workaround to this, I'll update the accepted answer as long as its providing such an information, or if the issue was solved by IntelliJ or whoever is the developer. Also thank you Dave for pointing out where it fails, at least we can write a ticket to devs :)

推荐答案

这个问题最终在 API Level 22 SDK Manager 和 RecyclerView 支持库中得到修复.在相关的 Android 问题中引用此评论已于 2015 年 3 月 11 日关闭),您需要:

This issue was finally fixed in the API Level 22 SDK Manager and RecyclerView support library. To quote this comment in the relevant Android issue (which was closed on March 11, 2015), you need to:

... 通过 SDK Manager 更新到最新的 API 22 SDK 平台,并通过更新支持更新到最新的回收者视图通过 SDK Manager 存储库,并在您的 build.gradle 文件中使用最新版本(22.0.0)

... update to the latest SDK platform for API 22 via the SDK Manager, and update to the latest recycler view by updating the Support repository via the SDK Manager, and in your build.gradle file to use the latest version (22.0.0)

此外,在设计器工具的顶部,您需要选择 API Android 版本 22.如果您选择较早的版本,即使您拥有最新的支持库,您也会继续看到错误.

In addition, at the top of the designer tool, you need to select API Android version 22. If you pick an earlier version, you will continue to see the error, even though you have the latest support library.

这篇关于java.lang.UnsupportedOperationException:不支持的服务:可访问性android studio的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆