Answered by:
"No resource identifier found for attribute 'touchscreenBlocksFocus'" with Google Play Services

Question
-
User4136 posted
Hi
I'm simply trying to create a new Android project using the Google Play Services. I created my project with the Xamarin Studio on my Mac. I have checked the "Optional Packages: Google Play Services" in the wizard. When I compile my Android project, the following error message is coming:
/Users/cadrz/Projects/ObservoCross/Source/Test/obj/Debug/resourcecache/8469AD97A2F47023064105DFA05BA7E8/res/layout/abcscreentoolbar.xml(0,0): Error APT0000: No resource identifier found for attribute 'touchscreenBlocksFocus' in package 'android' (APT0000) (Test)
After updating the packages and installing almost all items from Android SDK Manager, I still have the same error. I'm targeting Android 4.4 (API level 19). I'm using the last version of Xamarin Studio 5.9.1 (build 3). If I create a project without the Google Play Services, no problem my sample app is working.
I'm facing the same problem with VS2013.
What am I doing wrong? I'm completely stuck :-(
Wednesday, May 13, 2015 9:25 AM
Answers
-
User121680 posted
Fixed: Set API target to level 21
- Marked as answer by Anonymous Thursday, June 3, 2021 12:00 AM
Thursday, May 14, 2015 10:00 AM
All replies
-
User121680 posted
Exactly same problem here.
Thursday, May 14, 2015 8:17 AM -
User121680 posted
Fixed: Set API target to level 21
- Marked as answer by Anonymous Thursday, June 3, 2021 12:00 AM
Thursday, May 14, 2015 10:00 AM -
User1870 posted
Changing the target api level to 21 did it here as well.
Sunday, May 17, 2015 5:24 AM -
User4136 posted
Thanks for your answers.
In my case, I have completely deleted and recreated my project. After a "out of memory" compiler failure (solved with this: http://stackoverflow.com/questions/13523257/how-to-fix-outofmemoryerror-java-heap-space-while-compiling-monodroid-app-in), everything is working as expected and I'm still targeting the API level 19!
Monday, May 18, 2015 8:21 AM -
User131074 posted
I seem to be having the exact same problem as described by Happyfr34k. I figured out that it has neither to do with the API level nor a Java heap space issue. I can consistently replicate the issue as follows:
1) Start a new Android project with Google Play Services enabled. 2) Run the project, it should work fine. 3) In the project, behind Packages it says (5 updates). Update the Packages. 4) Run the project, it fails with the error described by Happyfr34k.
It seems to be a bug in the Packages update. Not sure what it could be, just using Xamarin for the first time today.
Hope this helps...
Thursday, May 28, 2015 6:40 AM -
User449 posted
Me too :( Look at the error: Error 11 No resource identifier found for attribute 'textAlignment' in package 'android' .....\resourcecache...\res\layout\abcalertdialog_material.xml Seems the constants for some (in my case 6) attributes are not found:
Error 14 No resource identifier found for attribute 'touchscreenBlocksFocus' in package 'android' abcscreentoolbar.xml Error 11 No resource identifier found for attribute 'textAlignment' in package 'android' abcalertdialogmaterial.xml Error 13 No resource identifier found for attribute 'textAlignment' in package 'android' abcdialogtitlematerial.xml Error 12 No resource identifier found for attribute 'layoutDirection' in package 'android' abcalertdialogmaterial.xml Error 15 No resource identifier found for attribute 'layoutDirection' in package 'android' abcsearchview.xml Error 10 No resource identifier found for attribute 'layoutmarginEnd' in package 'android' abcalertdialog_material.xml
Thursday, May 28, 2015 11:14 AM -
User1107 posted
Fixed: Set API target to level 21
So what do you do if you don't want to target API 21? I want it to work on 18.
Wednesday, July 22, 2015 10:14 PM -
User106639 posted
bounce same here too. I want api level 19
Thursday, July 23, 2015 4:21 PM -
User1107 posted
I created a bug for this https://bugzilla.xamarin.com/show_bug.cgi?id=32522
You might want to add yourself to the CC list.
Tuesday, July 28, 2015 4:05 PM -
User68480 posted
For anyone else with this problem, there is the comment on the bugzilla page @StuartJohnson gives:
Also you could specify different minSdkVersion (whatever you need) from targetSdkVersion (specify 21 or higher).
This worked for me, targeting 21 but minimum of 16.
Tuesday, August 4, 2015 4:09 PM -
User16680 posted
had the same issue. I added google play services, then removed it since i realized i didn't need all the google maps api functionalities. I had to manually remove some components (i don't remember which, sorry, just make a backup =) ) and then the issue was solved. Setting the target SDK to 21 is just a workaround, you CAN fix it while staying on a lesser version!
Tuesday, August 25, 2015 9:17 AM -
User133768 posted
After updating Android.Support.v4 23.0.1.3 and Forms 1.5.1.6471 on Xamarin Studio 5.9.7 I get the error:
res\layout\abc_screen_toolbar.xml(0,0): Error APT0000: No resource identifier found for attribute 'touchscreenBlocksFocus' in package 'android' (APT0000) (Robotics.Mobile.Core.Droid)
The error point to:
<android.support.v7.internal.widget.ActionBarContainer android:id="@+id/action_bar_container" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_alignParentTop="true" style="?attr/actionBarStyle" android:touchscreenBlocksFocus="true" android:gravity="top">
I tried setting the Target version from 21 to 23 but this did not resolve the problem. My minimum version is set to 15 for Bluetooth BLE support. The App compiled immediately before updating both packages. Earlier today a Java update removed JDK 7 but I have JDK 8 installed. I also ran the Android SDK manager and all was updated. It looks like teh SDk platform is installed for everything from 10 to 23.I really need a work around or a way to go back to the older packet versions.
Thanks
Wednesday, October 21, 2015 2:01 PM -
User55951 posted
Just updated to latest packages and studio and facing exactly the same issue as David. Changing the target version is not helping.
Friday, October 23, 2015 4:40 PM -
User64778 posted
I have seen this error a couple of times and on each occasion, I had to change my Target Android Version and at the relevant time, I set it to 19. I am presently developing a new android application when this error came up again. So, I have set it to 21. It sounds to me like a workaround and not a real solution. This is what worked for me:
Set 'Target Android Version' to 'API level 21' and 'Minimum Android Version' to 'API level 16'
Tuesday, October 27, 2015 4:29 PM -
User65168 posted
I'm having the same issue, by changing the target framework and minimum android version did not work.
Any suggestions?
Tuesday, November 24, 2015 5:34 PM -
User9505 posted
I am also having this issue now. If I remove AppCompat v7 I do not get the error but I am trying to upgrade my app to use it.
Friday, December 4, 2015 5:33 AM -
User80464 posted
All projects are broken (java.exe ) exited with code 1 after upgrading to Xamarin Studio 5.10. Yes, I set Java heap max to 1G
Saturday, December 12, 2015 1:33 AM -
User109396 posted
I kept getting "error APT0000: No resource identifier found for attribute 'touchscreenBlocksFocus' in package ‘android'". I discovered that somehow I had changed the Target Framework option in my project.
To fix it, I changed Options | Build | General | Target framework from "Android 4.4 (Kit Kat)" back to "Use latest installed platform (4.4.87)".
Now my project builds without the error.
Friday, December 18, 2015 6:04 PM -
User154 posted
While it is the same solution, be careful to check any Xamarin.Android library projects you have referenced by your Xamarin.Forms Android app. Since they don't have an
AndroidManifest.xml
file, you have to edit the it directly in the csproj file instead.In Xamarin Studio, simply right-click your X.F Android project and go to Tools > Edit File. From there, look for and change either
AndroidUseLatestPlatformSdk
toTrue
orTargetFrameworkVersion
to6.0
(technically5.0
+ would work to line up with API level 21).<?xml version="1.0" encoding="utf-8"?> <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <PropertyGroup> … [one option] <AndroidUseLatestPlatformSdk>True</AndroidUseLatestPlatformSdk> … [another option] <TargetFrameworkVersion>v6.0</TargetFrameworkVersion> </PropertyGroup>
Tuesday, January 12, 2016 11:05 PM -
User135226 posted
For those of us having to target Android 4.4, what is the suggested resolution to this error? In my case, it's thrown after I've changed my targeted framework from 23 to 19.
Wednesday, February 17, 2016 12:09 AM -
User194953 posted
Changed API to 21. Problem solved.
Tuesday, March 1, 2016 9:25 PM -
User52517 posted
@SidChilders Normally, you should have your Android Target Framework and Android Target version both set to the latest supported Android versions. This used to be API 21, (and it sounds like API 21 still works in some cases); but technically it should be set to API 23 / Android 6.0 now; if you're on the latest version of Forms.
This is true no matter which API level you want to deploy to. Instead of changing the Target Framework / Version; you can change the Minimum Android version to API 15 or higher to reflect the API levels you want to support.
These settings are documented here: https://developer.xamarin.com/guides/xamarin-forms/getting-started/installation/#Android
Tuesday, March 8, 2016 11:56 PM -
User207894 posted
If you are working in Visual Studio then go to SDK manager and download Google Play Service it will solve your problem.
Friday, April 1, 2016 7:36 AM -
User135984 posted
the following configuration works with me: by Set Compile using Android Version *' : Use Latest Platform(Android 6.0 Marshmallow) *Target Android Version' to 'API Level 21' and *'Minimum Android Version to *' API Level 16'
Thursday, April 28, 2016 11:29 AM -
User275839 posted
Yes it certainly did the job!
Tuesday, November 29, 2016 2:10 AM -
User286862 posted
Resources\layout\Tabbar.axml(2): error APT0000: No resource identifier found for attribute 'tabIndicatorColor' in package 'App1.Droid' Resources\layout\Tabbar.axml(2): error APT0000: No resource identifier found for attribute 'tabGravity' in package 'App1.Droid' Resources\layout\Tabbar.axml(2): error APT0000: No resource identifier found for attribute 'tabMode' in package 'App1.Droid' iam getting this problem..
Thursday, December 29, 2016 4:39 AM -
User302629 posted
After the last update of Xamarin Android 8.0.0.33 same here :(
Friday, October 20, 2017 2:55 PM -
User43729 posted
Same issue for me. Currently in update hell.
Target set to 8.1 Oreo in project and manifest. GooglePlayServices installed (Base, Basement and Tasks). No joy!
Any help much appreciated.
Tuesday, July 3, 2018 10:07 AM -
User43729 posted
Finally got it by comparing my project to a new one.
Needed to install Xamarin.Android.Support.Design - somehow that got lost in the myriad of updates.
Tuesday, July 3, 2018 10:17 AM