Rendering error with known error

I downloaded the GitHub project and then imported it into Android Studio. Everything seems to be working fine, but I keep getting rendering errors in the design. Now projects are only gray screens, and nothing is displayed.

Error

Failed to render with known error. Try rebuilding.
The following classes cannot be created: - android.support.design.widget.CoordinatorLayout (Open Class, Show Exception, Clear Cache) - android.support.v7.widget.AppCompatTextView (Open Class, Show Exception, Clear Cache) Tip. Use View.isInEditMode () in custom views to skip code or show sample data if shown in the IDE. If this is an unexpected error that you can also try to create a project, then manually refresh the layout. Java.lang.NoSuchFieldError exception information: CoordinatorLayout at android.support.design.widget.CoordinatorLayout. (CoordinatorLayout.java:197) in android.support.design.widget.CoordinatorLayout. (CoordinatorLayout.java:189) in java.lang.reflect.Constructor.newInstance (Constructor.java:423) in android.view.LayoutInflater.createViewFromTag (LayoutInflater.java:727) on android.view.LayoutInflater.inflate (LayoutInflater. java: 495) on android.view.LayoutInflater.inflate (LayoutInflater.javahaps97) Copy stack to clipboard

I tried almost all of the options I offer: update, Gradle synchronization, project recovery, invalid cache, etc. But nothing works. If anyone could better understand the problem, then that would be very appreciated!

As I said, I know that people had this problem before, but none of their solutions work for me.

+5
source share
2 answers

Add a base in front of your base style. Cheers @filol for the thread.

<style name="AppTheme" parent="Theme.AppCompat.Light"> 

to

 <style name="AppTheme" parent="Base.Theme.AppCompat.Light"> 
+9
source

Source: https://habr.com/ru/post/1261714/


All Articles