Android Studio Rendering Problems : The following classes could not be found
You have to do two things:
- be sure to have imported right appcompat-v7 library in your project structure -> dependencies
- change the theme in the preview window to not an AppCompat theme. Try with Holo.light or Holo.dark for example.
java.lang.NoClassDefFoundError: android/support/v7/internal/widget/ActionBarOverlayLayout$1
Sometimes Android Studio has some rendering problems, so you could do three things in this situation:
Firstly: be sure to have imported right appcompat-v7 library
in your project structure (in your dependencies)
Secondly: change the AppTheme
in the preview window to NOT an AppCompat
theme. You could try with some Holo themes, for example Holo.light or Holo.dark.
Thirdly: You could change the Android Version when rendering layouts - for example, you could get it back to API level 21
Rendering Problems - Following Classes Not Found
I wiped out my entire project and started all over again. That seemed to solve the problem. I'm guessing changing my configurations in between is what caused the mess. Thank goodness the project was just for recreation.
Rendering Problems with NoActionBar Theme. The following classes could not be found: android.support.v7.widget.AppCompatTextView
It is a minor bug in appcompat v26.
In your styles.xml
use Base.Theme.AppCompat
instead of Theme.AppCompat
as the parent theme.
Apparently there is no such theme for NoActionBar
in Base.
So use a theme as below:
<style name="AppTheme" parent="Base.Theme.AppCompat.Light">
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
</style>
The following classes could not be instantiated with android.support.v7.widget.AppCompatTextView
I was getting this error too and tried to fix it by cleaning, rebuilding and invalidating the cache many times.
What fixed it for me was changing the parent theme in res/values/styles.xml
to one with Base
e.g.
<style name="AppTheme" parent="Base.Theme.AppCompat.Light.DarkActionBar">
as per the answer here.
Android Studio Rendering Problems (No preview)
Changing AppTheme parent in res/values/styles.xml resolved this problem. Replace
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->
</style>
with
<style name="AppTheme" parent="Base.Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->
</style>
Downgrade API level from 22 to 21 in Preview Pane
Related Topics
Android Sdk 22 - Searchview Rendering Problems
Refresh Fragment UI from Fragmentactivity
Quaternion Rotation Does Not Work as Excepted
How to Determine Which Dependency Causes Google Play Openssl Warning
Why Do Most Fields (Class Members) in Android Tutorial Start with 'M'
How to Have a Transparent Imagebutton: Android
How to Show an Empty View with a Recyclerview
Switching to Landscape Mode in Android Emulator
Android:Inapp Purchase Receipt Validation Google Play
How to Get Color-Int from Color Resource
How to Share a Sharedpreferences File Across Two Different Android Apps
Google Maps API V2 Draw Part of Circle on Mapfragment
Remove Line Break in Tablayout
Android Mediaplayer Throwing "Prepare Failed.: Status=0X1" on 2.1, Works on 2.2
Gradle Dsl Method Not Found: 'Compile()'
Add Button to a Layout Programmatically
How to Perform an SQLite Query Within an Android Application