I tried to put my FAB on the Bottom right side of the screen. But every time I build the app, it always fail with AAPT error if I'm using the android:layout_gravity="bottom||end"
Here is the detailed error:
Android resource linking failed
AAPT: error: 'bottom||end' is incompatible with attribute layout_gravity (attr) flags [bottom=80, center=17, center_horizontal=1, center_vertical=16, clip_horizontal=8, clip_vertical=128, end=8388613, fill=119, fill_horizontal=7, fill_vertical=112, left=3, right=5, start=8388611, top=48].
And I've tried to use android:layout_gravity="bottom" and it works just fine.
can someone help me with this?
Use
android:layout_gravity="bottom|end"
instead of
android:layout_gravity="bottom||end"
Related
Trying to build the app but have got the error: The error Confugure image asset1
Confugure image asset2
Confugure image asset3
ERROR:C:\Users\Alex\AndroidStudioProjects\Lm2\app\src\main\res\mipmap-anydpi-v26\ic_launcher_round.xml:3: AAPT: error: resource mipmap/ic_launcher_background (aka com.example.lm2:mipmap/ic_launcher_background) not found.
How can I resolve this?
I hope you have
put your launcher icons into the mipmap folder where they should always go.
added your adaptive icon to the app’s manifest.xml for “android:icon” (android:roundIcon) attribute
.
Fist hand try: Clean your project and Rebuild
Probable Issue reason: Malformed XML:
Solution:
Check if you have anything duplicated by mistake in your XML
Try Analyze > Inspect Code it will redirect you to the exact error.
there is a ton of questions pertaining to this type of exception an i really dont get how it came about. I guess the exception is telling me that there are a bunch of date picker attributes that it expected to find in the styles file of my app that it could not find and I do not understand why as I swear exactly the same code was compiling flawlessly a few months back. What I dont inderstand is why its even looking for those in my project folder all those attrs are actually found and well defined on the values file where the exception stems from. all suggestions such as cleaning and rebuilding or upgrading to androidx have not worked. this is so vexing
AAPT: C:\Users\theo\Desktop\GymLog_App\GymLogMulti\app\build\intermediates\incremental\mergeGenericVersionDebugResources\merged.dir\values\values.xml:3535: error: style attribute 'attr/minDate (aka com.example.android.gymlogmulti.generic:attr/minDate)' not found.
C:\Users\theo\Desktop\GymLog_App\GymLogMulti\app\build\intermediates\incremental\mergeGenericVersionDebugResources\merged.dir\values\values.xml:3536: error: style attribute 'attr/maxDate (aka com.example.android.gymlogmulti.generic:attr/maxDate)' not found.
C:\Users\theo\Desktop\GymLog_App\GymLogMulti\app\build\intermediates\incremental\mergeGenericVersionDebugResources\merged.dir\values\values.xml:3544: error: style attribute 'attr/weekDayTextAppearance (aka com.example.android.gymlogmulti.generic:attr/weekDayTextAppearance)' not found.
C:\Users\theo\Desktop\GymLog_App\GymLogMulti\app\build\intermediates\incremental\mergeGenericVersionDebugResources\merged.dir\values\values.xml:3545: error: style attribute 'attr/dateTextAppearance (aka com.example.android.gymlogmulti.generic:attr/dateTextAppearance)' not found.
C:\Users\theo\Desktop\GymLog_App\GymLogMulti\app\build\intermediates\incremental\mergeGenericVersionDebugResources\merged.dir\values\values.xml:3551: error: style attribute 'attr/datePickerMode (aka com.example.android.gymlogmulti.generic:attr/datePickerMode)' not found.
C:\Users\theo\Desktop\GymLog_App\GymLogMulti\app\build\intermediates\incremental\mergeGenericVersionDebugResources\merged.dir\values\values.xml:3552: error: style attribute 'attr/dtp_legacyLayout (aka com.example.android.gymlogmulti.generic:attr/dtp_legacyLayout)' not found.
C:\Users\theo\Desktop\GymLog_App\GymLogMulti\app\build\intermediates\incremental\mergeGenericVersionDebugResources\merged.dir\values\values.xml:3553: error: style attribute 'attr/calendarViewShown (aka com.example.android.gymlogmulti.generic:attr/calendarViewShown)' not found.
C:\Users\theo\Desktop\GymLog_App\GymLogMulti\app\build\intermediates\incremental\mergeGenericVersionDebugResources\merged.dir\values\values.xml:3638: error: style attribute 'attr/weekDayTextAppearance (aka com.example.android.gymlogmulti.generic:attr/weekDayTextAppearance)' not found.
C:\Users\theo\Desktop\GymLog_App\GymLogMulti\app\build\intermediates\incremental\mergeGenericVersionDebugResources\merged.dir\values\values.xml:3639: error: style attribute 'attr/dateTextAppearance (aka com.example.android.gymlogmulti.generic:attr/dateTextAppearance)' not found.
C:\Users\theo\Desktop\GymLog_App\GymLogMulti\app\build\intermediates\incremental\mergeGenericVersionDebugResources\merged.dir\values\values.xml:3644: error: style attribute 'attr/datePickerMode (aka com.example.android.gymlogmulti.generic:attr/datePickerMode)' not found.
I just found the source of the issue by using CTRL+SHIFT+F and looking for the problematic attributes in the code (of the entire scope). Turns out the culprit was a third party dependency. Once i uninstalled it it was fixed. I guess the issue came from updating gradle and these outdated libraries somehow interfering with it.
I still dont understand the nature of the issue exactly but I hope this helps someone else dealing with the same issue. I just spent waaay to long looking at this.
I've written an instrumented test. When I run it I get an error:
/Users/ilamasin/StudioProjects/ecwid/general/build/intermediates/packaged_res/debug/drawable/horizontal_divider_with_padding.xml:6:
AAPT: error: resource dimen/horizontal_divider_thickness (aka
com.ecwid.android.reports.test:dimen/horizontal_divider_thickness) not
found.
It's my drawable in project and it exists. My project runs and works. But test doesn't. Did anyone has this error? I use Junit and Mockito (Sorry for my English)
just go to dimen file and add value to this-:
res->values->dimen and give value to dimen/horizontal_divider_thickness
or go to drawable file and pass value i.e 15dp or 20dp whatever you want to add.
When I want to try the application on the emulator or extract the .apk
I face this error
Android resource linking failed
error: resource android:style/TextAppearance.Material.Widget.Button.Borderless.Colored not found.
error: resource android:style/TextAppearance.Material.Widget.Button.Colored not found.
error: failed linking references.
I think your are applying that style wrong.
Try to set the style of your view in your layout (.xml file) this way:
style="#style/TextAppearance.Material.Widget.Button.Borderless.Colored"
Let me know if that helped!
I imported an Android project into my eclipse workspace, but I get getting the following errors. I have googled for a resolution but have not found one. Please can anyone point me in the right direction? Thank you in advance!
C:\Development\adt-bundle-windows-x86\sdk\extras\google\google_play_services\libproject\google-play-services_lib\res\values\maps_attrs.xml:5: error: Attribute "mapType" has already been defined
C:\Development\adt-bundle-windows-x86\sdk\extras\google\google_play_services\libproject\google-play-services_lib\res\values\maps_attrs.xml:12: error: Attribute "cameraBearing" has already been defined
C:\Development\adt-bundle-windows-x86\sdk\extras\google\google_play_services\libproject\google-play-services_lib\res\values\maps_attrs.xml:13: error: Attribute "cameraTargetLat" has already been defined
C:\Development\adt-bundle-windows-x86\sdk\extras\google\google_play_services\libproject\google-play-services_lib\res\values\maps_attrs.xml:14: error: Attribute "cameraTargetLng" has already been defined
C:\Development\adt-bundle-windows-x86\sdk\extras\google\google_play_services\libproject\google-play-services_lib\res\values\maps_attrs.xml:15: error: Attribute "cameraTilt" has already been defined
C:\Development\adt-bundle-windows-x86\sdk\extras\google\google_play_services\libproject\google-play-services_lib\res\values\maps_attrs.xml:16: error: Attribute "cameraZoom" has already been defined
C:\Development\adt-bundle-windows-x86\sdk\extras\google\google_play_services\libproject\google-play-services_lib\res\values\maps_attrs.xml:17: error: Attribute "uiCompass" has already been defined
C:\Development\adt-bundle-windows-x86\sdk\extras\google\google_play_services\libproject\google-play-services_lib\res\values\maps_attrs.xml:18: error: Attribute "uiRotateGestures" has already been defined
C:\Development\adt-bundle-windows-x86\sdk\extras\google\google_play_services\libproject\google-play-services_lib\res\values\maps_attrs.xml:19: error: Attribute "uiScrollGestures" has already been defined
C:\Development\adt-bundle-windows-x86\sdk\extras\google\google_play_services\libproject\google-play-services_lib\res\values\maps_attrs.xml:20: error: Attribute "uiTiltGestures" has already been defined
C:\Development\adt-bundle-windows-x86\sdk\extras\google\google_play_services\libproject\google-play-services_lib\res\values\maps_attrs.xml:21: error: Attribute "uiZoomControls" has already been defined
C:\Development\adt-bundle-windows-x86\sdk\extras\google\google_play_services\libproject\google-play-services_lib\res\values\maps_attrs.xml:22: error: Attribute "uiZoomGestures" has already been defined
C:\Development\adt-bundle-windows-x86\sdk\extras\google\google_play_services\libproject\google-play-services_lib\res\values\maps_attrs.xml:23: error: Attribute "useViewLifecycle" has already been defined
C:\Development\adt-bundle-windows-x86\sdk\extras\google\google_play_services\libproject\google-play-services_lib\res\values\maps_attrs.xml:24: error: Attribute "zOrderOnTop" has already been defined
EDIT
This is my Android project properties:
You are importing the google-playservices` library twice - and two different versions (one is labeled "froyo" on your screen shot).
Probably delete the old one and it will be fine. But the issue is that you cannot have resources defined twice and differently. Sometimes you can have the some one twice and defined the same and sometimes the build will not detect duplicates in Eclipse.
Get rid of one of the two editions of google-play-services that you have in your project libraries list.