Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AndroidStdio无法预览,无法实例化 #23

Open
zxc19990331 opened this issue Jan 26, 2019 · 1 comment
Open

AndroidStdio无法预览,无法实例化 #23

zxc19990331 opened this issue Jan 26, 2019 · 1 comment

Comments

@zxc19990331
Copy link

java.lang.ClassNotFoundException: android.view.View$OnUnhandledKeyEventListener at org.jetbrains.android.uipreview.ModuleClassLoader.load(ModuleClassLoader.java:180) at com.android.tools.idea.rendering.RenderClassLoader.findClass(RenderClassLoader.java:61) at org.jetbrains.android.uipreview.ModuleClassLoader.findClass(ModuleClassLoader.java:118) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) at org.jetbrains.android.uipreview.ModuleClassLoader.loadClass(ModuleClassLoader.java:213) at android.support.v7.widget.SwitchCompat.setChecked(SwitchCompat.java:1066) at android.widget.CompoundButton.<init>(CompoundButton.java:117) at android.widget.CompoundButton.<init>(CompoundButton.java:90) at android.support.v7.widget.SwitchCompat.<init>(SwitchCompat.java:218) at android.support.v7.widget.SwitchCompat.<init>(SwitchCompat.java:204) 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:481) at org.jetbrains.android.uipreview.ViewLoader.loadClass(ViewLoader.java:264) at org.jetbrains.android.uipreview.ViewLoader.loadView(ViewLoader.java:222) at com.android.tools.idea.rendering.LayoutlibCallbackImpl.loadView(LayoutlibCallbackImpl.java:209) at android.view.BridgeInflater.loadCustomView(BridgeInflater.java:337) at android.view.BridgeInflater.loadCustomView(BridgeInflater.java:348) at android.view.BridgeInflater.createViewFromTag(BridgeInflater.java:248) at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:730) at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:863) at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:72) at android.view.LayoutInflater.rInflate(LayoutInflater.java:837) at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:824) at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:866) at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:72) at android.view.LayoutInflater.rInflate(LayoutInflater.java:837) at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:824) at android.view.LayoutInflater.inflate(LayoutInflater.java:515) at android.view.LayoutInflater.inflate(LayoutInflater.java:394) at android.view.BridgeInflater.inflate(BridgeInflater.java:302) at android.view.View.inflate(View.java:23239) at com.leon.lib.settingview.LSettingItem.initView(LSettingItem.java:199) at com.leon.lib.settingview.LSettingItem.<init>(LSettingItem.java:77) at com.leon.lib.settingview.LSettingItem.<init>(LSettingItem.java:72) 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:481) at org.jetbrains.android.uipreview.ViewLoader.loadClass(ViewLoader.java:264) at org.jetbrains.android.uipreview.ViewLoader.loadView(ViewLoader.java:222) at com.android.tools.idea.rendering.LayoutlibCallbackImpl.loadView(LayoutlibCallbackImpl.java:209) at android.view.BridgeInflater.loadCustomView(BridgeInflater.java:337) at android.view.BridgeInflater.loadCustomView(BridgeInflater.java:348) at android.view.BridgeInflater.createViewFromTag(BridgeInflater.java:248) at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:730) at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:863) at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:72) at android.view.LayoutInflater.rInflate(LayoutInflater.java:837) at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:824) at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:866) at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:72) at android.view.LayoutInflater.rInflate(LayoutInflater.java:837) at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:824) at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:866) at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:72) at android.view.LayoutInflater.rInflate(LayoutInflater.java:837) at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:824) at android.view.LayoutInflater.inflate(LayoutInflater.java:515) at android.view.LayoutInflater.inflate(LayoutInflater.java:394) at com.android.layoutlib.bridge.impl.RenderSessionImpl.inflate(RenderSessionImpl.java:325) at com.android.layoutlib.bridge.Bridge.createSession(Bridge.java:384) at com.android.tools.idea.layoutlib.LayoutLibrary.createSession(LayoutLibrary.java:193) at com.android.tools.idea.rendering.RenderTask.createRenderSession(RenderTask.java:544) at com.android.tools.idea.rendering.RenderTask.lambda$inflate$3(RenderTask.java:678) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745)

@zxc19990331
Copy link
Author

The following classes could not be instantiated: - android.support.v7.widget.SwitchCompat (Open Class, Show Exception, Clear Cache) - com.leon.lib.settingview.LSettingItem (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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant