I am using android studio 2.2.3. All of my layout xmls are complaining about "Missing styles". Following is the error that I am getting when I open the design view.
Rendering Problems Missing styles. Is the correct theme chosen for this layout? Use the Theme combo box above the layout to choose a different layout, or fix the theme style references. Failed to find style 'progressBarStyle' in current theme (1568 similar errors not shown) Failed to find '?attr/textAppearanceSmall' in current theme. (65 similar errors not shown)
I have also noticed that styles.xml is unable to find "Theme.AppCompat.Light.NoActionBar". I have checked the project structure and I am able to see the com.android.support.appcompat-v7:25.2.0 in the list of dependencies. I performed invalidate caches and restart, clean/build. But I am unable to get rid of the missing styles issue. I have also tried renaming my "AppTheme" to "AppBaseTheme" and referencing this in my android manifest file. Even that did not help. I have tried doing a refresh in the design view but still cannot get rid of the missing styles error.
For another xml layout, I am getting the following error
Rendering Problems Missing styles. Is the correct theme chosen for this layout? >Use the Theme combo box above the layout to choose a different layout, or fix the theme style references. The following classes could not be instantiated:
- android.support.design.widget.TabLayout (Open Class, Show Exception, Clear Cache)
Tip: Use View.isInEditMode() in your custom views to skip code or show sample data when shown in the IDE. If this is an unexpected error you can also try to build the project, then manually refresh the layout. Exception Details java.lang.IllegalArgumentException: You need to use a Theme.AppCompat theme (or descendant) with the design library. at android.support.design.widget.ThemeUtils.checkAppCompatTheme(ThemeUtils.java:36) at android.support.design.widget.TabLayout.(TabLayout.java:297) at android.support.design.widget.TabLayout.(TabLayout.java:291) at java.lang.reflect.Constructor.newInstance(Constructor.java:423) at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:727) at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:858) at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:70) at android.view.LayoutInflater.rInflate(LayoutInflater.java:834) at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:821) at android.view.LayoutInflater.inflate(LayoutInflater.java:518) at android.view.LayoutInflater.inflate(LayoutInflater.java:397)
Can some one please point me in the right direction? Thanks.
Following is my manifest.
<uses-permission android:name="android.permission.INTERNET"/>
<application
android:allowBackup="true"
android:name=".ExampleApplication"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<activity
android:name=".activity.SplashActivity"
android:screenOrientation="portrait"
android:theme="#style/SplashTheme">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<activity
android:name=".activity.MainActivity"
android:screenOrientation="portrait"
android:windowSoftInputMode="adjustResize"/>
</application>
Following is my build.gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.1"
defaultConfig {
applicationId "com.example.package"
minSdkVersion 18
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
jackOptions {
enabled true
}
dexOptions {
preDexLibraries true
javaMaxHeapSize "4g"
}
lintOptions {
abortOnError false
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
testOptions {
unitTests.returnDefaultValues = true
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile group: 'com.google.code.gson', name: 'gson', version: '2.8.0'
compile 'com.android.support:recyclerview-v7:25.2.0'
compile 'com.android.support:cardview-v7:25.2.0'
compile 'com.android.support:design:25.2.0'
compile 'com.android.support:appcompat-v7:25.2.0'
compile group: 'joda-time', name: 'joda-time', version: '2.9.6'
compile group: 'com.google.guava', name: 'guava', version: '20.0'
compile 'com.squareup.retrofit2:retrofit:2.1.0'
compile 'com.squareup.retrofit2:converter-gson:2.0.2'
compile 'com.github.zagum:Android-SwitchIcon:1.3.2'
compile 'com.futuremind.recyclerfastscroll:fastscroll:0.2.5'
compile 'com.prolificinteractive:material-calendarview:1.4.2'
compile 'com.jakewharton:butterknife:8.5.1'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.5.1'
compile 'com.google.dagger:dagger:2.7'
annotationProcessor 'com.google.dagger:dagger-compiler:2.7'
testCompile 'junit:junit:4.12'
testCompile "org.robolectric:robolectric:3.0"
testCompile "org.robolectric:shadows-support-v4:3.0"
testCompile 'org.mockito:mockito-core:1.10.19'
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
androidTestCompile 'com.android.support.test.uiautomator:uiautomator-v18:2.1.2'
compile 'com.android.support.constraint:constraint-layout:1.0.0'
}
Following is my styles.xml.
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<item name="drawerArrowStyle">#style/DrawerArrowStyle</item>
<item name="android:textViewStyle">#style/RobotoTextViewStyle</item>
<item name="android:editTextStyle">#style/RobotoEditTextStyle</item>
</style>
<style name="SplashTheme" parent="Theme.AppCompat.NoActionBar">
<item name="android:windowBackground">#drawable/splash</item>
</style>
<style name="RobotoTextViewStyle" parent="android:Widget.TextView">
<item name="android:fontFamily">sans-serif</item>
<item name="android:textSize">#dimen/body</item>
<item name="android:textColor">#color/colorBlack</item>
</style>
<style name="RobotoEditTextStyle" parent="android:Widget.EditText">
<item name="android:fontFamily">sans-serif</item>
<item name="android:textSize">#dimen/body</item>
<item name="android:padding">#dimen/edittext_padding</item>
</style>
<style name="DrawerArrowStyle" parent="Widget.AppCompat.DrawerArrowToggle">
<item name="spinBars">true</item>
<item name="color">#android:color/white</item>
</style>
<style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar"/>
<style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light"/>
<style name="TextInputLayoutStyle" parent="TextAppearance.AppCompat.Small">
<item name="android:textColor">#color/color_android_green</item>
<item name="android:textStyle">bold|italic</item>
</style>
<style name="TextInputLayoutStyleError" parent="TextAppearance.AppCompat.Small">
<item name="android:textColor">#color/colorRed</item>
<item name="android:textStyle">bold|italic</item>
</style>
<style name="CustomTextStyle" parent="#android:style/TextAppearance.Widget.TabWidget">
<item name="android:textSize">20sp</item>
</style>
<style name="CustomSwitch" parent="Theme.AppCompat.Light">
<!-- active thumb & track color (30% transparency) -->
<item name="colorControlActivated">#color/colorAccent</item>
<!-- inactive thumb color -->
<item name="colorSwitchThumbNormal">#color/colorGrayDarker</item>
<!-- inactive track color (30% transparency) -->
<item name="android:colorForeground">#color/colorGray</item>
</style>
<style name="CustomTabLayout" parent="Base.Widget.Design.TabLayout">
<item name="tabIndicatorColor">#color/colorGold</item>
<item name="tabSelectedTextColor">#color/colorGold</item>
</style>
<style name="StyledScrollerTextAppearance">
<item name="android:textColor">#color/colorWhite</item>
</style>
Tablayout xml snippet
<android.support.design.widget.TabLayout
android:id="#+id/callScheduleType"
style="#style/CustomTabLayout"
android:layout_width="0dp"
android:layout_height="40dp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toBottomOf="#+id/guidelineNavHeight">
<android.support.design.widget.TabItem
android:id="#+id/personal"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="personal"/>
<android.support.design.widget.TabItem
android:id="#+id/community"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="community"/>
</android.support.design.widget.TabLayout>
I was able to solve this issue by reverting back the android gradle plugin version from classpath 'com.android.tools.build:gradle:2.3.0-beta4' to classpath 'com.android.tools.build:gradle:2.2.3' in the projects top level build file.
Related
Every attribute prefaced by "android:" in my styles.xml below is giving me a "cannot resolve symbol" error. It's been like this for a while so I'm not sure where it began and what causes it. Removing "android:" gives me a "resource linking failed" error in the build log.
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">#color/colorPrimary</item>
<item name="colorPrimaryDark">#color/colorPrimaryDark</item>
<item name="colorAccent">#color/colorAccent</item>
<item name="windowNoTitle">true</item>
<item name="windowActionBar">false</item>
<item name="android:windowContentOverlay">#null</item>
</style>
<style name="TheoTheme" parent="AppTheme">
<item name="colorAccent">#color/Accent</item>
<item name="android:colorBackground">#color/lightBackground</item>
</style>
<style name="TheoTheme.ActionBarReverse" parent="TheoTheme">
<item name="android:textColorPrimary">#color/text_color_primary</item>
</style>
<style name="PurpleTheme" parent="TheoTheme">
<item name="colorAccent">#color/Accent2</item>
</style>
<style name="ChatRoomTheme" parent="TheoTheme">
<item name="colorAccent">#color/Accent</item>
</style>
<style name="LoginTheme" parent="TheoTheme" >
<item name="android:colorBackground">#color/colorPrimary</item>
</style>
<style name="RegisterTheme" parent="TheoTheme">
<item name="colorAccent">#color/colorAccent</item>
</style>
<style name="FirebaseUI.AuthMethodPicker.Logo">
<item name="android:layout_width">wrap_content</item>
<item name="android:layout_height">wrap_content</item>
<item name="gravity">center</item>
</style>
<style name="GenericProgressBackground" parent="android:Theme">
<item name="android:layout_width">fill_parent</item>
<item name="android:layout_height">fill_parent</item>
<item name="android:background">#color/colorPrimaryDark</item>
<item name="android:gravity">center</item>
</style>
<style name="GenericProgressIndicator" parent="#android:style/Widget.ProgressBar">
<item name="android:layout_width">wrap_content</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:indeterminate">true</item>
</style>
<style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" />
<style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light" />
<style name="DMTheme.AppTheme" parent="ChatRoomTheme" />
build.gradle file:
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
android {
signingConfigs {
ReleaseKey {
file('X:\\Documents\\All\\Creative\\Programming\\Projects\\KeyStore\\TheoKeyStore.jks')
}
}
compileSdkVersion 28
defaultConfig {
applicationId "app.meettheo.theo"
minSdkVersion 19
targetSdkVersion 28
versionCode 5
versionName "0.1"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.ReleaseKey
}
debug {
signingConfig signingConfigs.ReleaseKey
}
}
lintOptions {
checkReleaseBuilds false
}
}
dependencies {
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'
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:support-v13:28.0.0'
implementation 'com.android.support:cardview-v7:28.0.0'
implementation 'com.android.support:customtabs:28.0.0'
implementation 'com.android.support:design:28.0.0'
implementation 'com.android.support:support-media-compat:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.android.support:recyclerview-v7:28.0.0'
implementation 'com.android.support:multidex:1.0.3'
implementation 'android.arch.paging:runtime:1.0.1'
implementation 'com.google.code.gson:gson:2.8.5'
implementation 'org.jetbrains:annotations:16.0.2'
implementation 'com.google.android.gms:play-services-auth:16.0.1'
implementation 'com.google.android.gms:play-services-ads:17.0.0'
implementation 'com.google.android.gms:play-services-places:16.0.0'
implementation 'com.google.android.gms:play-services-maps:16.0.0'
implementation 'com.facebook.android:facebook-android-sdk:4.38.1'
implementation 'com.google.firebase:firebase-core:16.0.4'
implementation 'com.firebaseui:firebase-ui-auth:4.2.0'
implementation 'com.google.firebase:firebase-firestore:17.1.3'
implementation 'com.firebaseui:firebase-ui-firestore:4.1.0'
implementation 'com.google.firebase:firebase-auth:16.0.5'
implementation 'com.google.firebase:firebase-ads:17.0.0'
implementation 'com.google.firebase:firebase-messaging:17.3.4'
implementation('com.crashlytics.sdk.android:crashlytics:2.9.6#aar') {
transitive = true
}
}
apply plugin: 'com.google.gms.google-services'
Invalidating/cleaning/rebuilding does not work. What did I break to make this happen?
I think you could try the following solution:
Back up project
Delete the .idea folder and .iml files
Relaunch Android Studio and re-import the project.
For some people it will work to just remove all the libraries from .idea folder and re-sync Gradle.
If none of these are working you always could reinstall the complete studio which, depending on your network speed, wouldn't take that long.
go to your gradle, comment out the support libraries you're using, sync your project and you will get errors. Then uncomment the libraries and sync again. Now the project will be successfully built, and chances are your problem will be resolved. I'm not sure how this is caused in the first place, but the above solution has worked for me in the past when caches/clean/rebuilt would fail.
Edit: Also depending on the property you might want to add app: instead of android:
I've had that issue for some time and that also pissed me off.
Guess what's the solution? As simple as re-importing the project again via File -> Open:
Thereafter all of the resources were correctly resolved.
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'
}
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' }
Try adding "Base" before Theme in styles.xml as show : - "Base.Theme.AppCompat.Light.DarkActionBar"
Permanent solution for this problem: change your build gradle (module app) to implementation com.android.support:appcompat-v7:28.0.0-alpha1.
change your build gradle (module app)
from : com.android.support:appcompat-v7:28.1.1-alpha3
to : com.android.support:appcompat-v7:27.1.1
1.try this first : make changes in Gradle (module app) for appcompat:
implementation 'com.android.support:appcompat-v7:28.0.0-alpha1'
2. If it doesn't work clean your project and then again build it.
In my case, it worked.
I want to change colors in my application, by overriding theme. I have several themes which user can choose. I got this error in Android Studio when trying to override theme:
No resource found that matches the given name at android:colorForegroundInverse with value #color/foreground_material_light
values\styles.xml
<resources>
<style name="LigthTheme" parent="#style/Theme.AppCompat">
<!-- <item name="colorPrimary">#color/aztec_gold</item>
<item name="colorPrimaryDark">#color/licorice</item>
<item name="colorAccent">#color/accent_material_light</item>
<item name="android:itemBackground">#color/aztec_gold</item>
<item name="android:background">#color/aztec_gold</item>
-->
</style>
<style name="RetroTheme" parent="#style/Theme.AppCompat">
<!-- Customize your theme here. -->
<item name="colorPrimaryDark">#color/nickel</item>
<item name="colorPrimary">#color/spanish_gray</item>
<item name="colorAccent">#color/turtle_green</item>
<item name="android:windowBackground">#color/white_smoke</item>
<item name="android:colorBackground">#color/white_smoke</item>
<item name="android:textColorPrimary">#color/black</item>
<item name="android:textColorSecondary">#color/black_light</item>
<item name="android:textColorSecondaryInverse">#color/white</item>
<item name="android:textColorPrimaryInverse">#color/white_smoke</item>
<item name="android:colorForeground">#color/white_smoke</item>
<item name="colorButtonNormal">#color/june_bud</item>
<item name="android:colorForegroundInverse">#color/white_smoke</item>
</style>
<style name="DarkTheme" parent="#style/Theme.AppCompat">
<!-- <item name="colorPrimary">#color/aztec_gold</item>
<item name="colorPrimaryDark">#color/licorice</item>
<item name="colorAccent">#color/accent_material_light</item>
<item name="android:itemBackground">#color/aztec_gold</item>
<item name="android:background">#color/aztec_gold</item>
-->
</style>
values\colors.xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="spanish_gray">#9e9e9e</color>
<color name="pastel_gray">#cfcfcf</color>
<color name="nickel">#707070</color>
<color name="june_bud">#aed851</color>
<color name="pale_goldenrod">#e1ffb1</color>
<color name="turtle_green">#7da453</color>
<color name="white_smoke">#f5f5f5</color>
<color name="black">#d2000000</color>
<color name="black_light">#9c000000</color>
<color name="black_light1">#9c000000</color>
<color name="white">#ffffff</color>
</resources>
build.gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 24
buildToolsVersion "25.0.2"
defaultConfig {
applicationId "com.ivan.vts.mapper"
minSdkVersion 16
targetSdkVersion 24
versionCode 1
versionName "1.0"
multiDexEnabled true
jackOptions {
enabled true
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
compileOptions {
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility JavaVersion.VERSION_1_8
}
dexOptions {
javaMaxHeapSize "2048M"
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile group: 'com.google.code.gson', name: 'gson', version: '2.4'
compile group: 'commons-io', name: 'commons-io', version: '2.5'
compile 'com.android.volley:volley:1.0.0'
compile 'com.android.support:appcompat-v7:24.0.0'
compile 'com.google.android.gms:play-services-location:10.2.4'
compile 'com.google.android.gms:play-services-maps:10.2.4'
compile 'com.google.android.gms:play-services-places:10.2.4'
compile 'com.android.support:multidex:1.0.1'
compile 'cn.pedant.sweetalert:library:1.3'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.google.maps.android:android-maps-utils:0.4.+'
testCompile 'junit:junit:4.12'
}
Tried to put colorForegroundInverse and foreground_material_light in styles.xml, colors.xml, set parent to different themes bt always the same error.
Thanks in advance.
EDIT:
I can add in colors.xml something like:
<color name="foreground_material_light">#fff</color>
and there's warning, but no errors. It doesn't feel right to me.
You can try accessing the color as
#android:color/foreground_material_light
I am getting this error of no resource found and I don't know how to solve this issue can anyone help ?I am getting this error of no resource found and I don't know how to solve this issue can anyone help ?
<resources>
<!-- Base application theme. -->
<style name="CardViewLinkText">
<item name="android:layout_width">wrap_content</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:textColor">#color/dim_foreground_material_light</item>
<item name="android:textSize">#dimen/abc_text_size_medium_material</item>
<item name="android:layout_marginTop">8dp</item>
<item name="android:layout_marginBottom">8dp</item>
<item name="android:layout_marginRight">8dp</item>
</style>
<style name="PujaDesc_CardView_Title">
<item name="android:layout_width">wrap_content</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:layout_marginLeft">16dp</item>
<item name="android:layout_marginRight">16dp</item>
<item name="android:layout_marginTop">16dp</item>
<item name="android:textColor">#color/link_text_material_light</item>
<item name="android:textSize">#dimen/text_16_font</item>
</style>
<style name="PujaDesc_CardView_Desc">
<item name="android:layout_width">wrap_content</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:layout_marginBottom">10dp</item>
<item name="android:layout_marginLeft">16dp</item>
<item name="android:layout_marginRight">16dp</item>
<item name="android:layout_marginTop">16dp</item>
<item name="android:textColor">#color/background_material_dark</item>
<item name="android:textSize">#dimen/text_14_font</item>
</style>
<style name="book_puja_address_style">
<item name="android:layout_width">match_parent</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:layout_margin">5dp</item>
<item name="android:drawablePadding">5dp</item>
<item name="android:textColorHint">#android:color/darker_gray</item>
<item name="met_baseColor">#666</item>
<item name="met_errorColor">#EE3233</item>
<item name="met_floatingLabel">highlight</item>
<item name="met_primaryColor">#color/primaryDark_orange</item>
</style>
<style name="CardViewDetailsText2">
<item name="android:layout_width">wrap_content</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:textColor">#color/dim_foreground_material_light</item>
<item name="android:textSize">#dimen/abc_text_size_medium_material</item>
<item name="android:layout_marginBottom">16dp</item>
<item name="android:layout_marginRight">16dp</item>
</style>
<style name="PujaSuggHeadingText">
<item name="android:layout_width">wrap_content</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:textColor">#color/primaryDark_orange</item>
<item name="android:textSize">#dimen/text_16_font</item>
<item name="android:layout_marginBottom">8dp</item>
<item name="android:layout_marginRight">8dp</item>
</style>
<style name="PujaSuggDescText">
<item name="android:layout_width">wrap_content</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:textColor">#color/text_black_divider_60</item>
<item name="android:textSize">#dimen/text_14_font</item>
<item name="android:layout_marginBottom">8dp</item>
<item name="android:layout_marginRight">8dp</item>
</style>
<string name="companyFounderTitle">Astro Techno Startup</string>
<string name="ourCompanyTitle">Our Startup</string>
<string name="ourPurposeTitle">Our Purpose</string>
<string name="ourServicesTitle">Our Services</string>
<string name="visitUs">Visit Us</string>
<string name="web4">kundli.io</string>
<string name="web1">www.vedicrishi.in</string>
<string name="web2">www.bookapanditji.com</string>
<string name="web3">www.vedicrishiastro.com</string>
<string name="companyFounder"> Pandit Rishiraj Tiwari, the Director of Vedic Rishi Astro Pvt Ltd, hails from the holy and
ancient city of Varanasi, India - the land where rituals, religion and spiritualism all merge together for the benefit
and salvation of mankind. Pandit Rishiraj Tiwari has vast, rich knowledge of Vedic Astrology and has been practising
Astrology, Numerology and Vastu since past 25 years.</string>
<string name="ourCompany">Vedic Rishi is an Astro-Techno start-up which aims to reorient the way people perceive and understand Vedic Astrology. \n kundli.io is a product of Vedic Rishi Astro. </string>
<string name="ourPurpose">We strive to utilize the traditional and profound knowledge of Vedic Astrology and convert its principles and rules into a more precise language which will help in interpreting and analysing the complete range of human emotions, happenings and experiences, which will thereby facilitate in giving the most apt and relevant life trends and suggestions.</string>
<string name="ourServices">kundli.io is a perfect place for you to prepare, read and store your complete astrological profile along with those of your family and friends. \n At kundli.io, we have taken great efforts to blend the powerful knowledge of ancient Vedic Astrology with latest technology to help, prepare and guide you for the upcoming excellent and not so happy events in your life. We have harmonized technical expertise with celestial rules of Astrology to create highly interactive and precise tools to give you the deepest possible analysis of your kundli i.e. horoscope.</string>
</resources>
build.gradle
apply plugin: 'com.android.application'
apply plugin: 'android-apt'
def AAVersion = '3.3.1'
buildscript {
repositories {
maven { url "http://dl.bintray.com/populov/maven" }
mavenCentral()
}
dependencies {
// replace with the current version of the android-apt plugin
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.4'
classpath 'com.android.tools.build:gradle:1.3.0'
}
}
repositories {
mavenCentral()
mavenLocal()
}
dependencies {
apt "org.androidannotations:androidannotations:$AAVersion"
compile "org.androidannotations:androidannotations-api:$AAVersion"
compile 'com.squareup.okhttp:okhttp-android-support:2.5.0'
compile 'com.squareup.okio:okio:1.6.0'
compile files('libs/CleverTapSDKValidator-20151217.jar')
}
apt {
arguments {
androidManifestFile variant.outputs[0].processResources.manifestFile
// if you have multiple outputs (when using splits), you may want to have other index than 0
// You can set optional annotation processing options here, like these commented options:
// logLevel 'INFO'
// logFile '/var/log/aa.log'
}
}
android {
compileSdkVersion 23
buildToolsVersion '22.0.1'
defaultConfig {
applicationId "com.vedicrishiastro.kundli"
minSdkVersion 15
targetSdkVersion 23
versionCode 6
versionName "Beta 1.4"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
/*apt {
arguments {
//androidManifestFile variant.outputs[0].processResources.manifestFile
// if you have multiple outputs (when using splits), you may want to have other index than 0
// If you're using flavors you should use the following line instead of hard-coded packageName
resourcePackageName android.defaultConfig.applicationId
// You can set optional annotation processing options here, like these commented options:
// logLevel 'INFO'
// logFile '/var/log/aa.log'
}
}*/
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.clevertap.android:clevertap-android-sdk:2.0.5'
compile 'com.google.android.gms:play-services'
compile 'com.android.support:support-v4'
compile project(':multilevelexpindlistview')
compile 'com.android.support:appcompat-v7:22.2.0'
compile 'com.android.support:support-annotations:22.2.0'
compile 'com.android.support:support-v4:23.1.0'
apt "org.androidannotations:androidannotations:$AAVersion"
compile "org.androidannotations:androidannotations-api:$AAVersion"
compile 'com.android.support:cardview-v7:21.0.+'
compile 'com.github.traex.rippleeffect:library:1.3'
compile 'com.android.support:recyclerview-v7:21.0.+'
compile 'com.rengwuxian.materialedittext:library:2.1.4'
compile 'com.android.support:design:22.2.0'
compile 'com.squareup.okhttp:okhttp:2.4.0'
compile 'de.hdodenhof:circleimageview:1.3.0'
compile 'com.squareup.picasso:picasso:2.5.2'
compile project(':library')
compile 'com.github.medyo:fancybuttons:1.5#aar'
compile 'com.jpardogo.materialtabstrip:library:1.1.0'
compile 'com.melnykov:floatingactionbutton:1.3.0'
compile 'com.google.android.gms:play-services-analytics:8.3.0'
compile 'uk.co.chrisjenx:calligraphy:2.1.0'
compile 'com.github.lzyzsd:circleprogress:1.1.0#aar'
}
android {
lintOptions {
abortOnError false
checkReleaseBuilds false
}
}
apply plugin: 'android-apt'
apply plugin: 'com.google.gms.google-services'
Did you define link_text_material_light in "values.xml" or "colors.xml"?
Try creating a file with "colors.xml" under values directory and define those colors in that file.
I have been trying to get action bar icon and for some reason it is not coming at all.
Does the size matters when displaying any icon for action bar?
Mine is: 64*64 px.
My Application Manifest looks like this:
<application
android:allowBackup="true"
android:logo="#mipmap/icon_welcome_logo"
android:icon="#mipmap/icon_welcome_logo"
android:label="#string/app_name"
android:theme="#style/CustomActionBarTheme"
>
I have even tried to set the same through coding, as well as custom style.
Please advise if I am doing anything wrong??
public class MainActivity extends ActionBarActivity {
public static final String TITLE = "Account Details";
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
getSupportActionBar().setTitle(TITLE);
getSupportActionBar().setIcon(R.drawable.ic_launcher);
getSupportActionBar().setLogo(R.mipmap.ic_launcher);
getSupportActionBar().setDisplayUseLogoEnabled(true);
Style.xml
<resources>
<!-- the theme applied to the application or activity -->
<style name="CustomActionBarTheme" parent="#style/Theme.AppCompat.Light">
<item name="android:actionBarStyle">#style/MyActionBar</item>
<!-- Support library compatibility -->
<item name="actionBarStyle">#style/MyActionBar</item>
<item name="actionMenuTextColor">#color/actionbar_text</item>
</style>
<!-- general styles for the action bar -->
<style name="MyActionBar" parent="#style/Widget.AppCompat.ActionBar">
<item name="android:titleTextStyle">#style/TitleTextStyle</item>
<item name="android:background">#color/actionBarBackground</item>
<item name="android:icon">#mipmap/icon_welcome_logo</item>
<item name="android:logo">#mipmap/icon_welcome_logo</item>
<item name="android:displayOptions">useLogo</item>
<!-- Support library compatibility -->
<item name="titleTextStyle">#style/TitleTextStyle</item>
</style>
<!-- action bar title text -->
<style name="TitleTextStyle" parent="#style/TextAppearance.AppCompat.Widget.ActionBar.Title">
<item name="android:textColor">#color/actionBarTextColor</item>
<item name="android:textSize">#dimen/actionBarTextSize</item>
</style>
</resources>
build.gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 21
buildToolsVersion "21.1.2"
packagingOptions {
exclude 'META-INF/LICENSE'
exclude 'META-INF/NOTICE'
}
defaultConfig {
applicationId "au.com.app"
minSdkVersion 16
targetSdkVersion 21
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:21.0.3'
compile 'com.squareup.dagger:dagger:1.2.1'
compile 'com.jakewharton:butterknife:6.1.0'
compile 'com.google.android.gms:play-services:6.5.87'
compile 'com.fasterxml.jackson.core:jackson-databind:2.5.1'
compile 'com.fasterxml.jackson.core:jackson-core:2.5.1'
}
I believe your issue is similar to https://stackoverflow.com/a/26451433/950427.
Change:
getSupportActionBar().setTitle(TITLE);
getSupportActionBar().setIcon(R.drawable.ic_launcher);
getSupportActionBar().setLogo(R.mipmap.ic_launcher);
getSupportActionBar().setDisplayUseLogoEnabled(true);
To:
getSupportActionBar().setTitle(TITLE);
getSupportActionBar().setDisplayUseLogoEnabled(true);
getSupportActionBar().setDisplayShowHomeEnabled(true); // <-- added
getSupportActionBar().setIcon(R.drawable.ic_launcher);
Dependency Updates(Unrelated to question):
dependencies {
compile 'com.android.support:appcompat-v7:22.0.0' // <-- Updated
compile 'com.squareup.dagger:dagger:1.2.2' // <-- Updated
compile 'com.jakewharton:butterknife:6.1.0'
compile 'com.google.android.gms:play-services:6.5.87'
compile 'com.fasterxml.jackson.core:jackson-databind:2.5.1' // <-- brings in core
}