Forum Xamarin.Android

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

Thibault_VellicusThibault_Vellicus CHUniversity ✭✭
edited May 2015 in Xamarin.Android

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/abc_screen_toolbar.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 :-(

Best Answer

Answers

  • NIDHEESHDASTHAVORATHNIDHEESHDASTHAVORATH INMember ✭✭

    Exactly same problem here.

  • DerekForemanDerekForeman USBeta, University

    Changing the target api level to 21 did it here as well.

  • Thibault_VellicusThibault_Vellicus CHUniversity ✭✭

    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!

  • RookieRookie AUMember

    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...

  • MartindeJongMartindeJong NLMember
    edited May 2015

    Me too :( Look at the error:
    Error 11 No resource identifier found for attribute 'textAlignment' in package 'android' .....\resourcecache...\res\layout\abc_alert_dialog_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' abc_screen_toolbar.xml
    Error 11 No resource identifier found for attribute 'textAlignment' in package 'android' abc_alert_dialog_material.xml
    Error 13 No resource identifier found for attribute 'textAlignment' in package 'android' abc_dialog_title_material.xml
    Error 12 No resource identifier found for attribute 'layoutDirection' in package 'android' abc_alert_dialog_material.xml
    Error 15 No resource identifier found for attribute 'layoutDirection' in package 'android' abc_search_view.xml
    Error 10 No resource identifier found for attribute 'layout_marginEnd' in package 'android' abc_alert_dialog_material.xml

  • StuartJohnsonStuartJohnson GBMember ✭✭

    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.

  • GeorgeCookGeorgeCook PEUniversity ✭✭✭

    bounce same here too. I want api level 19

  • StuartJohnsonStuartJohnson GBMember ✭✭
    edited July 2015

    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.

  • aa1984aa1984 USMember

    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!

  • ksachdevaksachdeva USMember ✭✭

    Just updated to latest packages and studio and facing exactly the same issue as David. Changing the target version is not helping.

  • NkechiNnajiNkechiNnaji USUniversity ✭✭

    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'

  • VictorHGarciaVictorHGarcia USUniversity ✭✭

    I'm having the same issue, by changing the target framework and minimum android version did not work.

    Any suggestions?

  • Ross_BRoss_B USMember ✭✭

    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.

  • elenaorelelenaorel USMember

    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

  • 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.

  • Adam.PatridgeAdam.Patridge USInsider, University

    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 to True or TargetFrameworkVersion to 6.0 (technically 5.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>
    
  • SidChildersSidChilders USMember ✭✭

    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.

  • Changed API to 21. Problem solved.

  • Kent.GreenKent.Green USXamarin Team Xamurai

    @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

  • parth7676parth7676 USMember ✭✭

    If you are working in Visual Studio then go to SDK manager and download Google Play Service it will solve your problem.

  • MostafaEdrisMostafaEdris USMember

    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'

  • iAlexeyiAlexey USMember

    Yes it certainly did the job!

  • ShomShom NPMember ✭✭

    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..

  • mtimmermmtimmerm USMember ✭✭

    After the last update of Xamarin Android 8.0.0.33 same here :(

  • JamesClossJamesCloss GBMember ✭✭

    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.

  • JamesClossJamesCloss GBMember ✭✭

    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.

Sign In or Register to comment.