Buck and Android Material theme - android

I am setting up Buck to speed up the build of an Android app. The app uses the Material Theme through the appcompat-v7:21.0.+ library but Buck cannot find the required resources. Any hints?
Here is the error output:
$ buck build //app/src/main:main
Using buckd.
[-] PROCESSING BUCK FILES...FINISHED 0.4s
[+] BUILDING...2.0s (3/6 JOBS)
|=> IDLE
|=> IDLE
|=> IDLE
|=> //app/src/main:main#aapt_package... 1.5s (running aapt_package[1.5s])
Log:
No Android platform target specified. Using default: Google Inc.:Google APIs:21
app/src/main/res/values/styles.xml:4: error: Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light.DarkActionBar'.
app/src/main/res/values/styles.xml:14: error: Error: No resource found that matches the given name: attr 'actionBarSize'.
app/src/main/res/values-v21/styles.xml:4: error: Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light.DarkActionBar'.
app/src/main/res/values/styles.xml:23: error: Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light.DarkActionBar'.
app/src/main/res/values/styles.xml:33: error: Error: No resource found that matches the given name: attr 'actionBarSize'.
app/src/main/res/values/styles.xml:29: error: Error: No resource found that matches the given name: attr 'colorPrimary'.
app/src/main/res/values/styles.xml:38: error: Error: No resource found that matches the given name: attr 'editTextColor'.
app/src/main/res/values-v21/styles.xml:14: error: Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light.DarkActionBar'.
app/src/main/res/values-v21/styles.xml:32: error: Error: No resource found that matches the given name: attr 'colorPrimary'.
BUILD FAILED: //app/src/main:main#aapt_package failed with exit code 1:
aapt_package

Download appcompat-aar file and use as dependency in your anroid_resource rule
https://github.com/facebookarchive/AntennaPod/blob/buck/BUCK#L133
https://github.com/facebookarchive/AntennaPod/blob/buck/BUCK#L64

Related

Android appcompat-v7 themes_base.xml No resource found error

I have been trying to import appcompat-v7 into my app and have had no luck at all. I need this library in order to follow the steps listed here How do I use DrawerLayout to display over the ActionBar/Toolbar and under the status bar?. I have followed the steps documented https://developer.android.com/tools/support-library/setup.html, and when I add the library to my project, I'm getting a list of errors:
.../sdk/extras/android/support/v7/appcompat/res/values-v21/themes_base.xml:136: error: Error: No resource found that matches the given name: attr 'android:colorAccent'.
.../sdk/extras/android/support/v7/appcompat/res/values-v21/themes_base.xml:140: error: Error: No resource found that matches the given name: attr 'android:colorButtonNormal'.
.../sdk/extras/android/support/v7/appcompat/res/values-v21/themes_base.xml:138: error: Error: No resource found that matches the given name: attr 'android:colorControlActivated'.
.../sdk/extras/android/support/v7/appcompat/res/values-v21/themes_base.xml:139: error: Error: No resource found that matches the given name: attr 'android:colorControlHighlight'.
.../sdk/extras/android/support/v7/appcompat/res/values-v21/themes_base.xml:137: error: Error: No resource found that matches the given name: attr 'android:colorControlNormal'.
.../sdk/extras/android/support/v7/appcompat/res/values-v21/themes_base.xml:134: error: Error: No resource found that matches the given name: attr 'android:colorPrimary'.
.../sdk/extras/android/support/v7/appcompat/res/values-v21/themes_base.xml:135: error: Error: No resource found that matches the given name: attr 'android:colorPrimaryDark'.
.../sdk/extras/android/support/v7/appcompat/res/values-v21/themes_base.xml:144: error: Error: No resource found that matches the given name: attr 'android:windowElevation'.
.../sdk/extras/android/support/v7/appcompat/res/values-v21/themes_base.xml:148: error: Error: No resource found that matches the given name: attr 'android:windowElevation'.
I have the build target to API 21 for android-support-v7-appcompat. When I clean that project, I don't receive any errors. When I add appcompat-v7 as a library to my project, that is where the errors start appearing.
I have checked my SDK manager and everything is up to date. Can anyone help steer me in the right direction where I can resolve this issue?

gradle build with AAR failed with No resource found error

I have two modules in the project.
app - that's my app module
app-base - that's android library module my app uses.
When I build with build tool 21 and gradle android plugin 1.1.1
with following dependency, it will fail.
compile 'com.company.android:app-base:1.0.0#aar'
I deployed app-base aar to company sonatype Nexus by following command.
gradle uploadArchives
The error messages follows:
:app:processCustomAppDebugResources
Position 34:21-35 : No resource found that matches the given name: attr 'actionBarStyle'.
Position 34:21-35 : No resource found that matches the given name: attr 'actionBarStyle'.
Position 37:29-51 : No resource found that matches the given name: attr 'windowActionBarOverlay'.
Position 29:21-36 : No resource found that matches the given name: attr 'windowActionBar'.
Position 1 : Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light'.
Position 1 : Error retrieving parent for item: No resource found that matches the given name '#style/Widget.AppCompat.ActionBar.Solid'.
Position 19:21-44 : No resource found that matches the given name: attr 'actionBarItemBackground'.
Position 7:21-31 : No resource found that matches the given name: attr 'background'.
Position 17:21-45 : No resource found that matches the given name: attr 'selectableItemBackground'.
Position 14:32-46 : No resource found that matches the given name: attr 'titleTextStyle'.
Position 7:21-31 : No resource found that matches the given name: attr 'background'.
Position 1 : Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light'.
Position 1 : Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light'.
:app:processCustomAppDebugResources FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:processCustomAppDebugResources'.
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/service/android/default/sdk/build-tools/21.0.0/aapt'' finished with non-zero exit value 1
To build successfully this, I only need to remove #aar on same dependency.
compile 'com.company.android:app-base:1.0.0'
Could someone explain why this happens? What is difference using AAR dependency or not using it?
Those parameters are from Android Support Library. Have you already included the Android Support Library in your dependency list?
compile 'com.android.support:appcompat-v7:21.0.3'

Android Studio won't launch app

I switched from eclipse to android studio. I created a blank app for testing purpose and I was able to launch in properly. However, after having added some simple code I'm no longer to start. The error messages I get are:
Error:(50, 21) No resource found that matches the given name: attr 'android:actionModeShareDrawable'.
or
Error:Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material'.
Error:Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Body1'.
Error:Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Body2'.
Error:Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Button'.
Error:Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Caption'.
Error:Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Display1'.
Error:Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Display2'.
Error:Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Display3'.
Error:Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Display4'.
...
Error:Execution failed for task ':app:processDebugResources'.
> com.android.ide.common.internal.LoggedErrorException: Failed to run command:
/Users/Tom/Java/Android/android_sdk_4.2/build-tools/19.1.0/aapt package -f --no-crunch -I /Users/Tom/Java/Android/android_sdk_4.2/platforms/android-17/android.jar -M /Users/Tom/Programming/ToyApp/app/build/intermediates/manifests/full/debug/AndroidManifest.xml -S /Users/Tom/Programming/ToyApp/app/build/intermediates/res/debug -A /Users/Tom/Programming/ToyApp/app/build/intermediates/assets/debug -m -J /Users/Tom/Programming/ToyApp/app/build/generated/source/r/debug -F /Users/Tom/Programming/ToyApp/app/build/intermediates/res/resources-debug.ap_ --debug-mode --custom-package app.beziehungen -0 apk --output-text-symbols /Users/Tom/Programming/ToyApp/app/build/intermediates/symbols/debug
Error Code:
1
Output:
/Users/Tom/Programming/ToyApp/app/build/intermediates/res/debug/values-v21/values.xml:5: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material'.
/Users/Tom/Programming/ToyApp/app/build/intermediates/res/debug/values-v21/values.xml:6: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Body1'.
/Users/Tom/Programming/ToyApp/app/build/intermediates/res/debug/values-v21/values.xml:7: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Body2'.
/Users/Tom/Programming/ToyApp/app/build/intermediates/res/debug/values-v21/values.xml:8: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Button'.
....
So what is happening here. The code is defintely correct!
Make sure that you've downloaded the latest extras as well as the Android 5.0 SDK via the SDK-Manager.
And set your compileSdkVersion to 21 in your build.gradle file. You also probably want to change your targetSdkVersion to 21.
android {
//...
compileSdkVersion 21
defaultConfig {
targetSdkVersion 21
}
//...
}

R missing after import the Sherlock action bar android

I was creating my project using android 4.4, now I want to build it with android 2.3.3.
I got some errors in my style.xml that theme not supported.
To resolve this error I have imported the Sherlock Action Bar library. Now my style.xml error is resolved but I now get an error 'R' is missing from project
I have cleaned the project but it is not resolved.
Does anyone know how can I resolve this issue ?
My log cat is
[2014-07-21 06:59:00 - PingMyAndroid] C:\Users\Bilal Khalid\android_development\PingMyAndroid\res\values\styles.xml:10: error: Error: No resource found that matches the given name: attr 'android:backgroundStacked'.
[2014-07-21 06:59:00 - PingMyAndroid] C:\Users\Bilal Khalid\android_development\PingMyAndroid\res\values\styles.xml:17: error: Error retrieving parent for item: No resource found that matches the given name 'android:Theme.Holo.Light.DarkActionBar'.
[2014-07-21 06:59:00 - PingMyAndroid] C:\Users\Bilal Khalid\android_development\PingMyAndroid\res\values\styles.xml:18: error: Error: No resource found that matches the given name: attr 'android:actionBarStyle'.
[2014-07-21 06:59:00 - PingMyAndroid] C:\Users\Bilal Khalid\android_development\PingMyAndroid\res\values\styles.xml:20: error: Error: No resource found that matches the given name: attr 'android:alertDialogTheme'.
[2014-07-21 06:59:00 - PingMyAndroid] C:\Users\Bilal Khalid\android_development\PingMyAndroid\res\values\styles.xml:77: error: Error: No resource found that matches the given name: attr 'android:buttonBarButtonStyle'.
[2014-07-21 06:59:00 - PingMyAndroid] C:\Users\Bilal Khalid\android_development\PingMyAndroid\res\values\styles.xml:73: error: Error: No resource found that matches the given name: attr 'android:windowMinWidthMajor'.
[2014-07-21 06:59:00 - PingMyAndroid] C:\Users\Bilal Khalid\android_development\PingMyAndroid\res\values\styles.xml:74: error: Error: No resource found that matches the given name: attr 'android:windowMinWidthMinor'.
[2014-07-21 06:59:00 - PingMyAndroid] C:\Users\Bilal Khalid\android_development\PingMyAndroid\res\values-v11\styles.xml:7: error: Error retrieving parent for item: No resource found that matches the given name 'android:Theme.Holo.Light'.
[2014-07-21 06:59:00 - PingMyAndroid] C:\Users\Bilal Khalid\android_development\PingMyAndroid\res\values-v14\styles.xml:8: error: Error retrieving parent for item: No resource found that matches the given name 'android:Theme.Holo.Light.DarkActionBar'
.
Did you add ABS as a library to your project? The R file will not generate is there is an error in the xml from what i've experienced.
If you haven't added ABS as a library follow:
Right-click project in package explorer->Properties->Android->Under library click Add->Select ABS->Click ok-> should be good to go after that.

Error importing Holo everywhere theme

I have followed the the guides on few sites and I cannot get it to work. I made sure they I created the project from existing source, and include as libraries in my project, checked targets, etc. I'm not sure what I'm missing.
I get the following errors:
[2012-08-29 21:04:45 - IT Guru] C:\Workspace\HoloEverywhereLib\res\values\styles.xml:246: error: Error: No resource found that matches the given name: attr 'windowActionBar'.
[2012-08-29 21:04:45 - IT Guru] C:\Workspace\HoloEverywhereLib\res\values\styles.xml:247: error: Error: No resource found that matches the given name: attr 'windowNoTitle'.
[2012-08-29 21:04:45 - IT Guru] C:\Workspace\HoloEverywhereLib\res\values-v14\styles.xml:12: error: Error retrieving parent for item: No resource found that matches the given name 'Theme.Sherlock'.
[2012-08-29 21:04:45 - IT Guru] C:\Workspace\HoloEverywhereLib\res\values-v14\styles.xml:14: error: Error retrieving parent for item: No resource found that matches the given name 'Theme.Sherlock.Light'.
[2012-08-29 21:04:45 - IT Guru] C:\Workspace\HoloEverywhereLib\res\values-v14\styles.xml:16: error: Error retrieving parent for item: No resource found that matches the given name 'Theme.Sherlock.Light.DarkActionBar'.
[2012-08-29 21:04:45 - IT Guru] C:\Workspace\HoloEverywhereLib\res\values-v14\styles.xml:18: error: Error retrieving parent for item: No resource found that matches the given name 'Theme.Sherlock.ForceOverflow'.
[2012-08-29 21:04:45 - IT Guru] C:\Workspace\HoloEverywhereLib\res\values-v14\styles.xml:20: error: Error retrieving parent for item: No resource found that matches the given name 'Theme.Sherlock.Light.ForceOverflow'.
[2012-08-29 21:46:56 - IT Guru] C:\Workspace\HoloEverywhereLib\res\values\styles.xml:247: error: Error retrieving parent for item: No resource found that matches the given name '#style/Theme.HoloEverywhereDark.Sherlock'.
[2012-08-29 21:46:56 - IT Guru] C:\Workspace\HoloEverywhereLib\res\values\styles.xml:253: error: Error retrieving parent for item: No resource found that matches the given name '#style/Theme.HoloEverywhereLight.Sherlock'.
Guides Followed:
Error importing HoloEverywhere
https://github.com/ChristopheVersieux/HoloEverywhere
The HoloEverywhere guide you linked to is a small bit out-of-date, the two themes are now called Holo.Theme and Holo.Theme.Light.
So change these lines in your Android manifest:
android:theme="#style/Theme.HoloEverywhereDark.Sherlock"
or
android:theme="#style/Theme.HoloEverywhereLight.Sherlock"
to
android:theme="#style/Holo.Theme"
or
android:theme="#style/Holo.Theme.Light"
Then Project->Clean and see if the errors disappear.
As you are using Sherlock theme(Not integrated Android Theme) you need to import that additional package under ProjectName/ folder
+ProjectName
src
gen
Android2.1
Sherlock.jar(Import tht .jar file under root Folder)
bin
. . .
I solved the problem by setting the android target of all the projects to the newest android version (v.17 atm)

Categories

Resources