安卓預覽報錯 Failed to load AppCompat ActionBar with unknown error


報錯信息 :

Render Problem
Failed to load AppCompat ActionBar with unknown error.

Failed to instantiate one or more classes The following classes could not be instantiated: android.support.v7.widget.AppCompatImageView (Open Class, Show Exception, Clear Cache) - android.support.v7.widget.Toolbar (Open Class, Show Exception, Clear Cache) - android.support.v7.widget.AppCompatTextView (Open Class, Show Exception, Clear Cache) - android.support.v7.widget.ActionBarContextView (Open Class, Show Exception, Clear Cache) - android.support.v7.app.WindowDecorActionBar (Open Class, Show Exception, Clear Cache) - android.support.v7.widget.ActionBarOverlayLayout (Open Class, Show Exception, Clear Cache)

 

解決方案:

1: try going to the build.gradle(module:app) file in your project, over there, change the following things:

implementation 'com.android.support:appcompat-v7:28.0.0-alpha3' implementation 'com.android.support:design:28.0.0-alpha3'

to:

implementation 'com.android.support:appcompat-v7:28.0.0-alpha1' implementation 'com.android.support:design:28.0.0-alpha1

2:同步之后,Invalid Caches/Restart


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM