while trying to add a FloatingActionButton to my layout, I have been told by AndroidStudio, that I need to add the library design for that:
"This operation requires the library design.
Would you like to add this library now?"
I clicked "Ok", and now the build completely fails.
So far I have managed to find a line in the file "build.gradle", which I hoped was responsible for the issue:
compile 'com.android.support:design:25.0.0'
I tried to comment it out and rebuild, but the error remains.
The errors given are:
C:\AndroidProjects\ChartExample\app\src\main\res\layout\child_edit.xml
Error:(20, 39) No resource found that matches the given name (at 'layout_alignBaseline' with value '#id/etFirstName').
Error:(38, 39) No resource found that matches the given name (at 'layout_alignBaseline' with value '#id/etLastName').
Error:(54, 39) No resource found that matches the given name (at 'layout_alignBaseline' with value '#id/etBirthday').
Error:(73, 39) No resource found that matches the given name (at 'layout_alignBaseline' with value '#id/rbFemale').
C:\AndroidProjects\ChartExample\app\build\intermediates\res\merged\debug\layout\child_edit.xml
Error:(20, 39) No resource found that matches the given name (at 'layout_alignBaseline' with value '#id/etFirstName').
Error:(38, 39) No resource found that matches the given name (at 'layout_alignBaseline' with value '#id/etLastName').
Error:(54, 39) No resource found that matches the given name (at 'layout_alignBaseline' with value '#id/etBirthday').
Error:(73, 39) No resource found that matches the given name (at 'layout_alignBaseline' with value '#id/rbFemale').
Error:Execution failed for task ':app:processDebugResources'.
> com.android.ide.common.process.ProcessException: Failed to execute aapt
I guess these errors are mainly because the build didn't finish and some resource files haven't been generated, but I'm not sure.
Does someone have an idea how to undo what I have done to my project by hitting this fatal button?
Thanks for any help you can give.
Carsten
The reason was that all of the UI elements mentioned in the error messages had a cycle reference in the layout xml. The error had nothing to do with the libraries added.
Related
I'm trying to translate this open source project and make it my own but I'm running into errors when trying to clean or rebuild. I need help figuring out what I need to do.
Here's my error list:
/Users/Technologx/Desktop/Android Projects/New/SysVac/app/build/intermediates/res/merged/debug/values/values.xml
Error:(413) Multiple substitutions specified in non-positional format; did you mean to add the formatted="false" attribute?
Error:(413) Unexpected end tag string
Error:(413) Multiple substitutions specified in non-positional format; did you mean to add the formatted="false" attribute?
Error:(413) Unexpected end tag string
/Users/Technologx/Desktop/Android Projects/New/SysVac/app/build/intermediates/res/merged/debug/values-large-v4/values-large-v4.xml
Error:(12) Error retrieving parent for item: No resource found that matches the given name 'Base.Theme.AppCompat.Dialog.FixedSize'.
Error:(13) Error retrieving parent for item: No resource found that matches the given name 'Base.Theme.AppCompat.Light.Dialog.FixedSize'.
Error:(12) Error retrieving parent for item: No resource found that matches the given name 'Base.Theme.AppCompat.Dialog.FixedSize'.
Error:(13) Error retrieving parent for item: No resource found that matches the given name 'Base.Theme.AppCompat.Light.Dialog.FixedSize'.
/Users/Technologx/Desktop/Android Projects/New/SysVac/app/build/intermediates/res/merged/debug/values-v11/values-v11.xml
Error:(66) Error retrieving parent for item: No resource found that matches the given name 'Base.V7.Theme.AppCompat'.
Error:(67) Error retrieving parent for item: No resource found that matches the given name 'Base.V7.Theme.AppCompat.Dialog'.
Error:(68) Error retrieving parent for item: No resource found that matches the given name 'Base.V7.Theme.AppCompat.Light'.
Error:(66) Error retrieving parent for item: No resource found that matches the given name 'Base.V7.Theme.AppCompat'.
Error:(67) Error retrieving parent for item: No resource found that matches the given name 'Base.V7.Theme.AppCompat.Dialog'.
Error:(68) Error retrieving parent for item: No resource found that matches the given name 'Base.V7.Theme.AppCompat.Light'.
/Users/Technologx/Desktop/Android Projects/New/SysVac/app/build/intermediates/res/merged/debug/values-v21/values-v21.xml
Error:(66) Error retrieving parent for item: No resource found that matches the given name 'Base.V7.Theme.AppCompat'.
Error:(140) Error retrieving parent for item: No resource found that matches the given name 'Base.V7.Theme.AppCompat.Light'.
Error:(66) Error retrieving parent for item: No resource found that matches the given name 'Base.V7.Theme.AppCompat'.
Error:(140) Error retrieving parent for item: No resource found that matches the given name 'Base.V7.Theme.AppCompat.Light'.
Error:Execution failed for task ':app:processDebugResources'.
> com.android.ide.common.process.ProcessException: Failed to execute aapt
I'm not sure what I'm needing to do to fix these errors. I'm new to Android coding and was going to use this to help me learn.
Here's the file that it's wanting me to fix.
1: replace %s with %1$s all in your string.xml
2: I suggest You use AndroidStudio rather than eclipse when are you developing Android app. This needs android support library.see here
Hi,I download your source ,and I found some problem:
1、your library source ,gradle file ,applicationID not modified
2、my systemOS is win10,jdk is oracle jdk8。
library's compiledversion and buildToolsVersion maybe needn't modify,but jdk maybe needed.I think so.modified application id and run app successfully
I already looked at Android xml error: "No resource found that matches the given name" with RelativeLayout (#id/LinearLayout_acc, #id/ProgressBar_statusScreen)
My code has been working without problems. But now I am trying to create a release APK and I am getting these gradle errors:
Error:(47, 35) No resource found that matches the given name (at 'resource' with value '#xml/searchable').
Error:(81, 35) No resource found that matches the given name (at 'resource' with value '#xml/syncadapter').
Error:(90, 35) No resource found that matches the given name (at 'resource' with value '#xml/authenticator').
Again I don't get these errors unless I am trying to create a release APK.
I solve my own problem. For reasons I do not understand, the files were being created under .../app/src/debug/res/xml. I simply moved them to /app/src/main/res/xml and now it works.
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'
I'm following this tutorial to make and app with action bar for 2.3.x devices. But i cannot import appcompat-v7 to my projecto... It gives me lots of errors like these:
[2014-11-06 14:19:23 - AcordeNoPonto] C:\Workspace\appcompat_v7\res\values-v21\themes_base.xml:194: error: Error: No resource found that matches the given name: attr 'android:colorControlActivated'.
[2014-11-06 14:19:23 - AcordeNoPonto] C:\Workspace\appcompat_v7\res\values-v21\themes_base.xml:195: error: Error: No resource found that matches the given name: attr 'android:colorControlHighlight'.
[2014-11-06 14:19:23 - AcordeNoPonto] C:\Workspace\appcompat_v7\res\values-v21\themes_base.xml:193: error: Error: No resource found that matches the given name: attr 'android:colorControlNormal'.
[2014-11-06 14:19:23 - AcordeNoPonto] C:\Workspace\appcompat_v7\res\values-v21\themes_base.xml:190: error: Error: No resource found that matches the given name: attr 'android:colorPrimary'.
[2014-11-06 14:19:23 - AcordeNoPonto] C:\Workspace\appcompat_v7\res\values-v21\themes_base.xml:191: error: Error: No resource found that matches the given name: attr 'android:colorPrimaryDark'.
[2014-11-06 14:19:23 - AcordeNoPonto] C:\Workspace\appcompat_v7\res\values-large-v14\themes_base.xml:19: error: Error retrieving parent for item: No resource found that matches the given name 'Theme.Base.AppCompat.DialogWhenLarge.Base'.
[2014-11-06 14:19:23 - AcordeNoPonto] C:\Workspace\appcompat_v7\res\values-large-v14\themes_base.xml:22: error: Error retrieving parent for item: No resource found that matches the given name 'Theme.Base.AppCompat.Light.DialogWhenLarge.Base'.
So i cannot import my app theme and my action bar is not shown...
In project.properties for Your project android-support-v7-appcompat Make sure target value as follow.
Project target.
target=android-21
android.library=true
once you done Clean your Project. I hope this works.
In project.properties of both your project and android-support-v7-appcompat (under res), comment out the target api if not target=android-21 and place the new target code there.
If this doesn't work, or you can't use 21+ api, make sure in your app's project.properties that android.library=false.
Next check your project's Referenced Libraries does not contain v4 in the buildpath. I believe I'm saying this correctly, that v7-appcompat required it (the previous version), but that it is included within the android-support-v7-appcompat file and thus the duplicate entries cause a problem.
I got this problem too. I found many solutions that you must update to Android 5.0 API leveL 21..you can see one of the solutions for updating all IDE. HERE
..
(Note : Following method is my second way solution for me.)
If you don't want to update, you can try existing API level..I found solution in my way is that when you create the new android application project, choose as follow
minSdkVersion= API 14 ,
targetSdkVersion=API 17 ,
compiled with=API 17
Hope, this will help!
Im trying to add a Library Project (https://github.com/inmite/android-styled-dialogs) to my Android Studio project.
However I get the following build errors because my build is not able to reference the values in the Android-styled-dialog LibraryProject
android-apt-compiler: [NavigationDrawer] /Users/Jase/Downloads/NavigationDrawer/res/values-v11/themes_apptheme.xml:23: error: Error retrieving parent for item: No resource found that matches the given name 'DialogStyleLight'.
android-apt-compiler: [NavigationDrawer] /Users/Jase/Downloads/NavigationDrawer/res/values-v11/themes_apptheme.xml:30: error: Error: No resource found that matches the given name: attr 'buttonBackgroundColorNormal'.
android-apt-compiler: [NavigationDrawer] /Users/Jase/Downloads/NavigationDrawer/res/values-v11/themes_apptheme.xml:29: error: Error: No resource found that matches the given name: attr 'buttonSeparatorColor'.
....
I don't really know anything about Gradle but I feel that I possibly need to tell the build to reference Android-styled-dialog. I don't know I'm completely lost...
PS: When I created a new android studio project with the demo project for Android-Styled-Dialogs it created the following mavin file... which I don't have in my other project - https://gist.github.com/anonymous/8207108
I don't really know anything about Java build systems, please help