无法加载具有未知错误的AppCompat ActionBar。 beta01 3.1.3 helpme,请

时间:2018-08-04 06:37:04

标签: android android-studio-3.0

当每个人都在谈论alpha3到alpha1并且我得到beta01时,有人遇到同样的问题吗?

    dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat-v7:28.0.0-beta01'
    implementation 'com.android.support.constraint:constraint-layout:1.1.2'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}

错误日志

java.lang.ClassNotFoundException:android.view.View $ OnUnhandledKeyEventListener     在org.jetbrains.android.uipreview.ModuleClassLoader.load(ModuleClassLoader.java:180)     在com.android.tools.idea.rendering.RenderClassLoader.findClass(RenderClassLoader.java:61)     在org.jetbrains.android.uipreview.ModuleClassLoader.findClass(ModuleClassLoader.java:118)     在java.lang.ClassLoader.loadClass(ClassLoader.java:424)     在java.lang.ClassLoader.loadClass(ClassLoader.java:357)     在org.jetbrains.android.uipreview.ModuleClassLoader.loadClass(ModuleClassLoader.java:213)     在android.support.v7.widget.ActionBarContainer。(ActionBarContainer.java:62)     在sun.reflect.NativeConstructorAccessorImpl.newInstance0(本机方法)处     在sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)     在sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)     在java.lang.reflect.Constructor.newInstance(Constructor.java:423)     在org.jetbrains.android.uipreview.ViewLoader.createNewInstance(ViewLoader.java:481)     在org.jetbrains.android.uipreview.ViewLoader.loadClass(ViewLoader.java:264)     在org.jetbrains.android.uipreview.ViewLoader.loadView(ViewLoader.java:222)     在com.android.tools.idea.rendering.LayoutlibCallbackImpl.loadView(LayoutlibCallbackImpl.java:209)     在android.view.BridgeInflater.loadCustomView(BridgeInflater.java:337)     在android.view.BridgeInflater.loadCustomView(BridgeInflater.java:348)     在android.view.BridgeInflater.createViewFromTag(BridgeInflater.java:248)     在android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:730)     在android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:863)     在android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:72)     在android.view.LayoutInflater.rInflate(LayoutInflater.java:837)     在android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:824)     在android.view.LayoutInflater.inflate(LayoutInflater.java:515)     在android.view.LayoutInflater.inflate(LayoutInflater.java:423)     在com.android.layoutlib.bridge.bars.BridgeActionBar。(BridgeActionBar.java:89)     在com.android.layoutlib.bridge.bars.AppCompatActionBar。(AppCompatActionBar.java:68)     在com.android.layoutlib.bridge.impl.Layout.createActionBar(Layout.java:277)     在com.android.layoutlib.bridge.impl.Layout。(Layout.java:161)     在com.android.layoutlib.bridge.impl.RenderSessionImpl.inflate(RenderSessionImpl.java:288)     在com.android.layoutlib.bridge.Bridge.createSession(Bridge.java:384)     在com.android.tools.idea.layoutlib.LayoutLibrary.createSession(LayoutLibrary.java:193)     在com.android.tools.idea.rendering.RenderTask.createRenderSession(RenderTask.java:544)     在com.android.tools.idea.rendering.RenderTask.lambda $ inflate $ 3(RenderTask.java:678)     在java.util.concurrent.FutureTask.run(FutureTask.java:266)     在java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)     在java.util.concurrent.ThreadPoolExecutor $ Worker.run(ThreadPoolExecutor.java:617)     在java.lang.Thread.run(Thread.java:745)

1 个答案:

答案 0 :(得分:0)

好吧,我刚刚通过覆盖现有的方法解决了这个问题。

implementation 'com.android.support:appcompat-v7:28.0.0-beta01'
implementation 'com.android.support:support-v4:28.0.0-beta01'  //overwritten