I know this question has been asked a lot of times but I have tried most of the solutions, and none worked for me. This is the first time that I'm working on android studio 3.1.3, and I was following a tutorial on how to create a simple app using the basic template option from the android studio. The problem that I'm facing is;
Render Problem Failed to find style 'coordinatorLayoutStyle' in current theme
I have tried adding this to the build.gradle file:
compile 'com.android.support:design:24.1.1'
Also this into the style.xml
<style name="AppTheme.NoActionBar">
<item name="coordinatorLayoutStyle">@style/Widget.Design.CoordinatorLayout</item>
</style>
styles.xml
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
</style>
<style name="AppTheme.NoActionBar">
<item name="windowActionBar">false</item>
<item name="windowNoTitle">true</item>
</style>
<style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" />
Couldn't resolve resource @style/Widget.Design.CoordinatorLayout<style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" />
</resources>
build.gradle
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.example.notes"
minSdkVersion 23
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:28.0.0-alpha3'
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
implementation 'com.android.support:design:28.0.0-alpha3'
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'
}
The CoordinatorLayout. DefaultBehavior annotation is deprecated.
By specifying Behaviors for child views of a CoordinatorLayout you can provide many different interactions within a single parent and those views can also interact with one another. View classes can specify a default behavior when used as a child of a CoordinatorLayout by implementing the AttachedBehavior interface.
Only preview and Design tab in Android Studio showing black screen. Please perform Invalidate/cache restart. try this :First you have to Sync your project. Next, go to Build menu, and clic on the Clean Project.
Android CoordinatorLayout is a super-powered FrameLayout. It has a lot more to offer than it seems. It has additional level of control over it's child views. It coordinates the animations and transitions of child views with one another.
I was having the same problem. I tried following steps from here, but still the problem persists. I think it is a common issue in android studio 3.0+, Hopefully they will fix it next update. In the Android Studio Preview 3.2 it works fine. Download Android Studio Preview and visit here to learn how to run it alongside with Android Studio stable version
Or you can try to lower your design library version to 27. (And the compile sdk version also to 27)
dependencies { implementation 'com.android.support:appcompat-v7:27.0.2' implementation 'com.android.support:design:27.0.2' }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With