instead of preview, Android Studio showing only black screen with 'android...ActionBarOverlayLayout' written on it
Solution 1
Got this error-message:
Error:Execution failed for task ':app:processDebugManifest'.
Suggestion: use a compatible library with a minSdk of at most 9,
or increase this project's minSdk version to at least 14.
The solution is (as everyone said before) to match up the versions:
compileSdkVersion 26
buildToolsVersion '26.0.2'
targetSdkVersion 26
compile "com.android.support:support-v4:26.0.2"
compile "com.android.support:design:26.0.2"
But also change the compatible library minSDK
minSdkVersion 14
And the play-services
compile 'com.google.android.gms:play-services:11.8.0'
Solution 2
If problem still not solved after doing things that @Roar RAP mentioned.
Goto: src -> main -> res -> style.xml
and add Base.
to the style tag parent attribute. It should look like below,
<style name="AppTheme" parent="Base.Theme.AppCompat.Light.DarkActionBar">
...
</style>
This option is also worked for me.
Solution 3
Had the same error as you.
I updated the build.grade file, so that the "compileSdkVersion" matched the version I was running in my emulator. I also updated my "targetSdkVersion" to likewise fit the SDK I was running in my emulator.
Lastly, Android Studio asked me to update the dependencies (underlined with red in the program, so that it matches the targetsdkversion.. the last three lines...)
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
buildToolsVersion '26.0.2'
defaultConfig {
applicationId "com.example.android.miwok"
minSdkVersion 15
targetSdkVersion 27
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:27.0.1'
compile 'com.android.support:support-v4:27.0.1'
compile 'com.android.support:design:27.0.1'
}`
Solution 4
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 withHolo.light or Holo.dark
for example.
Solution 5
Make sure your your app->bulid.gradle
file have same verison with compileSdkVersion, buildToolsVersion, targetSdkVersion and support libraries notice the support libraries verison which in this example 23
. If I have 26.0.2
buildToolsVersion I will change my support libraries version 26
too.
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "com.example.android.miwok"
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.3.0'
compile 'com.android.support:support-v4:23.3.0'
compile 'com.android.support:design:23.3.0'
}
![Shirish Herwade](https://i.stack.imgur.com/SM3Dq.jpg?s=256&g=1)
Comments
-
Shirish Herwade about 2 years
From few days, I'm not able to see preview/design of screens/layouts. Only a black screen is shown with android...ActionBarOverlayLayout written on it.
There is no error or exception in logcat. Also after running the project no issue on device. Only preview and Design tab in Android Studio showing black screen.
This is happening for every layouts after some Android Studio and build tools updates(which happened automatically)
Note: If I change Theme in preview (Theme in Editor), then sometimes the preview is shown, but it's very weird preview which can't be used for development
-
Shirish Herwade over 6 yearschanging theme i tried already, it didn't solve the issue completely, though it's passable for now :). About appcompat-v7 I'm not sure how to check it's right or not; Can you plz explain a bit more?
-
sanoop sandy over 6 yearsTo use the class ActionBarOverlayLayout you need to include this in the dependencies section of build.gradle file:
compile 'com.android.support:design:24.1.1'
Please match the version accordingly -
Shirish Herwade over 6 yearsThanks. Simple solution- make everything same version in build.gradle. Or just update everything to latest.
-
dcx86 about 6 yearsI have tried all the solution here, and none worked except this one here! Excellent and easy fix, but I do not understand what or why this happens.
-
Kwnstantinos Nikoloutsos about 6 yearsThat worked for me! I don't know why the solutions above didn't work. Is this because of the version that I am running in my emulator(API 27)?