android: Build fails in Debug and Release with error APT2000: no element found.

Steps to Reproduce

Just build. delete bin, obj, clean solution, rebuilt, restart Vs2019, none of them helps

Expected Behavior

Build fine

Actual Behavior

Returns Error as

obj\Release\110\lp\181\jl\res\drawable-watch-v20\common_google_signin_btn_text_dark_normal.xml(2): error APT2000: no element found. obj\Release\110\lp\181\jl\res\drawable-watch-v20\common_google_signin_btn_text_dark_normal.xml : error APT2261: file failed to compile. obj\Release\110\lp\181\jl\res\drawable-watch-v20\common_google_signin_btn_text_disabled.xml(2): error APT2000: no element found. obj\Release\110\lp\181\jl\res\drawable-watch-v20\common_google_signin_btn_text_disabled.xml : error APT2261: file failed to compile. obj\Release\110\lp\181\jl\res\drawable-watch-v20\common_google_signin_btn_text_dark_normal.xml(2): error APT2000: no element found. obj\Release\110\lp\181\jl\res\drawable-watch-v20\common_google_signin_btn_text_dark_normal.xml : error APT2261: file failed to compile. obj\Release\110\lp\181\jl\res\drawable-watch-v20\common_google_signin_btn_text_disabled.xml(2): error APT2000: no element found. obj\Release\110\lp\181\jl\res\drawable-watch-v20\common_google_signin_btn_text_disabled.xml : error APT2261: file failed to compile.

Version Information

Vs2019 16.10.0 XF latest 5 version X.Android latest all nugets up to date

There are similar issues but they have no real solution and I dont really understand what is this all about. I suddenly updated 2 things recently VS2019 16.10.0 and Xamarin.AndroidX packages. Those errors are appearing when i try to build Debug or Release regardless. What is even all about drawable-watch. I dont even need this? Funny thing is I try all delete bin, obj, restart VS, clean, rebuild, nothing really helps. I turn off my PC, coming back day later, it works fine in Debug, then I try to build in Release it doesn’t work. After release build fails. I try debug build again, it fails. Sorry I am not able to provide more information because I have no idea how to track this down.

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 3
  • Comments: 31 (11 by maintainers)

Most upvoted comments

Seems like changing your project path might help. As it was said earlier, changing the targetSdkVersion from 30 to 29 helps, but if you want to keep targeting 30, switching the project path from C://MyPersonalProjects/[MY_PROJECT__NAME] to C://P/[MY_PROJECT__NAME] fixed the issue for me. This is obviously a workaround.

@aeonblaire I would recommend migrating everything in your app to AndroidX – and make sure nothing is using Android.Support.* anymore.