When i go to clean project I am left with 3 errors and I am not sure what to do, code below. Please could someone help?
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- From:
file:/usr/local/google/buildbot/repo_clients/https___googleplex-
android.googlesource.com_a_platform_manifest.git/mnc-
release/frameworks/support/v7/appcompat/res/values-
v23/styles_base_text.xml -->
<eat-comment/>
<style name="Base.TextAppearance.AppCompat.Widget.Button.Inverse" parent="android:TextAppearance.Material.Widget.Button.Inverse"/>
<!-- From: file:/usr/local/google/buildbot/repo_clients/https___googleplex-android.googlesource.com_a_platform_manifest.git/mnc-release/frameworks/support/v7/appcompat/res/values-v23/themes_base.xml -->
<eat-comment/>
<style name="Base.Theme.AppCompat" parent="Base.V23.Theme.AppCompat"/>
<style name="Base.Theme.AppCompat.Light" parent="Base.V23.Theme.AppCompat.Light"/>
<style name="Base.V23.Theme.AppCompat" parent="Base.V22.Theme.AppCompat">
<!-- We can use the platform drawable on v23+ -->
<item name="actionBarItemBackground">?android:attr/actionBarItemBackground</item>
<item name="controlBackground">#drawable/abc_control_background_material</item>
</style>
<style name="Base.V23.Theme.AppCompat.Light" parent="Base.V22.Theme.AppCompat.Light">
<!-- We can use the platform drawable on v23+ -->
<item name="actionBarItemBackground">?android:attr/actionBarItemBackground</item>
<item name="controlBackground">#drawable/abc_control_background_material</item>
</style>
<!-- From: file:/usr/local/google/buildbot/repo_clients/https___googleplex-android.googlesource.com_a_platform_manifest.git/mnc-release/frameworks/support/v7/appcompat/res/values-v23/styles_base.xml -->
<eat-comment/>
<style name="Base.Widget.AppCompat.Button.Colored" parent="android:Widget.Material.Button.Colored"/>
Check out your build.gradle file and make the changes as below,
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.0"
defaultConfig {
applicationId "com.example.inzi.app"
minSdkVersion 9
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'])
compile 'com.android.support:appcompat-v7:23.0.0'
}
Check for the compileSdkVersion (should be 23), buildTiilVersion (should be 23) and also the dependencies ('com.android.support:appcompat-v7:23.0.0')...
Let me know if it works...
And mark it as an answer so that it would be useful to others...
Related
i am using Android Studio and despite all the projects in the old projects folder are working fine, when i try to
create a new project, AS could not recognise AppCompatActivity class
please have a look at the build.gradle and the style folders
please let em know how solve it
build.gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "com.example.com.myapplication"
minSdkVersion 19
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.0.1'
}
style:
<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>
</resources>
update: after : com.android.support:appcompat-v7:23.1.1
Error:A problem occurred configuring project ':app'.
> Could not resolve all dependencies for configuration ':app:_debugCompile'.
> Could not resolve com.android.support:appcompat-v7:23.1.1.
Required by:
MyApplication4:app:unspecified
> Could not resolve com.android.support:appcompat-v7:23.1.1.
> Could not get resource
'https://jcenter.bintray.com/com/android/support/appcompat-
v7/23.1.1/appcompat-v7-23.1.1.pom'.
> Could not GET
'https://jcenter.bintray.com/com/android/support/appcompat-
v7/23.1.1/appcompat-v7-23.1.1.pom'.
> Connection to https://jcenter.bintray.com refused
I have been created project in android studio,but the following error were occured.
Error:
C:\Learning\Android\Design\app\build\intermediates\exploded-aar\com.android.support\appcompat-v7\23.1.1\res\values-v23\values-v23.xml
Error:(1) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Inverse'.
Error:(1) Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Button.Colored'.
Error:Execution failed for task ':app:processDebugResources'.
> com.android.ide.common.process.ProcessException:
org.gradle.process.internal.ExecException: Process 'command 'E:\Android\build-tools\22.0.0\aapt.exe'' finished with non-zero exit value 1
Code
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- From: file:/usr/local/google/buildbot/src/googleplex-android/mnc-supportlib-release/frameworks/support/v7/appcompat/res/values-v23/styles_base_text.xml -->
<eat-comment/>
<style name="Base.TextAppearance.AppCompat.Widget.Button.Inverse" parent="android:TextAppearance.Material.Widget.Button.Inverse"/>
<!-- From: file:/usr/local/google/buildbot/src/googleplex-android/mnc-supportlib-release/frameworks/support/v7/appcompat/res/values-v23/themes_base.xml -->
<eat-comment/>
<style name="Base.Theme.AppCompat" parent="Base.V23.Theme.AppCompat"/>
<style name="Base.Theme.AppCompat.Light" parent="Base.V23.Theme.AppCompat.Light"/>
<style name="Base.V23.Theme.AppCompat" parent="Base.V22.Theme.AppCompat">
<!-- We can use the platform drawable on v23+ -->
<item name="actionBarItemBackground">?android:attr/actionBarItemBackground</item>
<!-- We can use the platform styles on v23+ -->
<item name="actionMenuTextColor">?android:attr/actionMenuTextColor</item>
<item name="actionMenuTextAppearance">?android:attr/actionMenuTextAppearance</item>
<item name="controlBackground">#drawable/abc_control_background_material</item>
</style>
<style name="Base.V23.Theme.AppCompat.Light" parent="Base.V22.Theme.AppCompat.Light">
<!-- We can use the platform drawable on v23+ -->
<item name="actionBarItemBackground">?android:attr/actionBarItemBackground</item>
<!-- We can use the platform styles on v23+ -->
<item name="actionMenuTextColor">?android:attr/actionMenuTextColor</item>
<item name="actionMenuTextAppearance">?android:attr/actionMenuTextAppearance</item>
<item name="controlBackground">#drawable/abc_control_background_material</item>
</style>
<!-- From: file:/usr/local/google/buildbot/src/googleplex-android/mnc-supportlib-release/frameworks/support/v7/appcompat/res/values-v23/styles_base.xml -->
<eat-comment/>
<style name="Base.Widget.AppCompat.Button.Colored" parent="android:Widget.Material.Button.Colored"/>
Set your compileSdkVersion and buildToolsVersion to match the major version of the support library you are using:
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "com.your.app"
minSdkVersion 14
targetSdkVersion 23
versionCode YOUR CODE
versionName "Your.Version.Number"
}
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:23.1.1'
compile 'com.android.support:percent:23.1.1'
compile 'com.android.support:design:23.1.1'
compile 'com.android.support:cardview-v7:23.1.1'
compile 'com.android.support:recyclerview-v7:23.1.1'
}
Im trying to customize my ActionBar, I´m following this tutorial by Android Developers --> Link, but it doesn´t channge, I specified the theme in the Android Manifest:
android:theme="#android:style/Theme.Holo" and, in my styles.xml:
And also I changed my styles.xml:
<style name="AppTheme" parent="Theme.AppCompat">
</style>
Also, I have the last version of the library:
And it is referenced in my App Grandle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 22
buildToolsVersion "21.1.2"
defaultConfig {
applicationId "com.cheescake.juno"
minSdkVersion 14
targetSdkVersion 22
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:22.0.0'
}
I followed all the steps and I dont know why my ActionBar is in theme light yet. Maybe can be a stupid error and I didn´t understand something, but I have 2 days with this problem =(
Thanks !
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<item name="colorPrimary">#color/colorPrimary</item>
<item name="colorPrimaryDark">#color/colorPrimaryDark</item>
<item name="colorAccent">#android:color/white</item>
</style>
And in Manifest file
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme"
After specifying the colour of your theme e.g:
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
....
</style>
Add the following line to the AndroidManifest.xml file
<application
...
android:theme="#style/AppTheme" >
....
I'm new to Android programming. I want to use Android Studio (I have the newest one, version 0.8.2), and style my Action Bar.
The Gradle throws the following error during the build process:
Error:Error retrieving parent for item: No resource found that matches the given name '#android:style/Theme.AppCompat.Light.DarkActionBar'.
Here's my style.xml file:
<resources>
<!-- Base application theme. -->
<style
name="AppTheme"
parent="#android:style/Theme.AppCompat.Light.DarkActionBar">
<item name="android:actionBarStyle">#style/SocialExitActionBar</item>
</style>
<style
name="SocialExitActionBar"
parent="#android:style/Widget.Holo.Light.ActionBar">
<item name="android:background">#drawable/tranparent</item>
</style>
</resources>
It's the same as the Google's documentation. In every question, I found, the answer was to add the appcompat Library. But I have the appcompat library added in my build.gradle file:
apply plugin: 'com.android.application'
android {
compileSdkVersion 20
buildToolsVersion "20.0.0"
defaultConfig {
applicationId "com.procode.socialexit"
minSdkVersion 11
targetSdkVersion 19
versionCode 1
versionName "1.0"
}
buildTypes {
release {
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:19.+'
}
Here's on pic:
link
Thanks for your help!
I had to remove the #android:style/ before each parent value.
I've viewed a ton of posts regarding this issue, but everything here checks out.
Code:
Actionbar:
<style name="CustomActionBarTheme"
parent="#android:style/Theme.AppCompat">
<item name="android:actionBarStyle">#style/MyActionBar</item>
</style>
Gradle:
compileSdkVersion 'android-L'
buildToolsVersion '19.1.0'
defaultConfig {
minSdkVersion 8
targetSdkVersion 'android-L'
versionCode 1
versionName '1.0'
}
buildTypes {
release {
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}
dependencies {
compile 'com.android.support:appcompat-v7:21+'
compile 'com.android.support:support-v4:20+'
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.google.http-client:google-http-client-jackson2:1.18.0-rc'
compile 'com.google.apis:google-api-services-calendar:v3-rev75-1.17.0-rc'
compile 'com.google.api-client:google-api-client-android:1.17.0-rc'
compile 'com.google.http-client:google-http-client-gson:1.17.0-rc'
compile 'com.google.apis:google-api-services-oauth2:v2-rev63-1.17.0-rc'
compile 'com.google.android.gms:play-services:3.1.+'
compile files('libs/app-AppEngine-endpoints-android.jar')
}
Using Android Studio
YES I have support library installed
YES I have tried moving SDK versions all the way up to sdk-18
EDIT
Ctrl-Clicking on the ".../Theme.AppCompat" takes me to the correct lines in values.xml, see below:
<style name="Theme.AppCompat" parent="Theme.Base.AppCompat">
<item name="isLightTheme">false</item>
<!-- Required for use of support_simple_spinner_dropdown_item.xml -->
<item name="spinnerDropDownItemStyle"> #style/Widget.AppCompat.DropDownItem.Spinner</item>
<item name="dropdownListPreferredItemHeight">?attr/listPreferredItemHeightSmall</item>
<item name="searchResultListItemHeight">58dip</item>
Changing this to parent="#style/Theme.AppCompat" causes an error, but by defining that theme in "styles" I managed to fix it at it worked as intended.
I think it's your use of the #android prefix that's causing the problem. I struggled with it for ages until I found this answer:
https://stackoverflow.com/a/19507892/1123654