Reputation: 195
I am facing a rendering problem when I am trying to build an Android app which have a "Basic Activity" screen. I tried all the available solutions but nothing helps so far.
In case of "Blank Activity", when I am changing "Theme.AppCompat.Light.DarkActionBar" to "Basic.Theme.AppCompat.Light.DarkActionBar" in styles.xml, rendering is working properly. But this trick is not working when I am using "Basic Activity". Following is the configuration of my system:
Following are the error messages:
Following is my styles.xml file:
<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" />
<style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" />
</resources>
Following is my build.gradle(Module:app) file:
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.example.root.myfirstapplication"
minSdkVersion 15
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-rc02'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.android.support:design:28.0.0-rc01'
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'
}
Please help!
Thanks, Sanjay Singh
Upvotes: 0
Views: 665
Reputation: 195
After some struggle, I found that issue is with API 28 (which is still not stable). I changed API 28 to 26 in my build.gradle(Module:app) file which finally looks like this:
apply plugin: 'com.android.application'
android {
**compileSdkVersion 26**
defaultConfig {
applicationId "com.example.root.jiocollect"
minSdkVersion 21
**targetSdkVersion 26**
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:26.1.0'**
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
**implementation 'com.android.support:design:26.1.0'**
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'
}
After this everything was working.
Upvotes: 1