Xamarin.Android.Common.targets - Name cannot begin with the '$' character, hexadecimal value

/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets(3,3): Warning: Name cannot begin with the '$' character, hexadecimal value 0x24.

I am building a Xamarin Forms application and I have been trying to resolve the issue. I just can't find online resources to get me through this. Is there anyone who knows whats causing this. There is no name that starts with '$'.

Answers

  • AllisterAllister USMember ✭✭

    two months later and a few xamarin/VS updates and we're getting this too.

    "1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1727,3): warning : Name cannot begin with the '$' character, hexadecimal value 0x24."

    with a netstandard 1.4 xamarin forms project.

    related posts I've seen on stackoverflow (have unrelated/unhelpful comments), visual studio dev community and on here are yet to provide any potential answer or workaround...i'll see if bugzilla has this mentioned (it hasn't had any results in searches, but maybe if I go there directly)...

  • NuramonNuramon CHUniversity ✭✭
    edited November 2017

    Hello guys,

    I'm facing this issue as well with a demo app for the Visual Studio App Center. The error started to occur after adding the following NuGet-package to my android project:

    <package id="Microsoft.AppCenter.Push" version="1.0.1" targetFramework="monoandroid80" />

    This packages will also add the following dependencies:

    <package id="Xamarin.Firebase.Analytics" version="42.1021.1" targetFramework="monoandroid80" />
    <package id="Xamarin.Firebase.Analytics.Impl" version="42.1021.1" targetFramework="monoandroid80" />
    <package id="Xamarin.Firebase.Common" version="42.1021.1" targetFramework="monoandroid80" />
    <package id="Xamarin.Firebase.Core" version="42.1021.1" targetFramework="monoandroid80" />
    <package id="Xamarin.Firebase.Iid" version="42.1021.1" targetFramework="monoandroid80" />
    <package id="Xamarin.Firebase.Messaging" version="42.1021.1" targetFramework="monoandroid80" />

    After removing all those dependencies again, the Android-app is now compiling again.

    All my tools are updated:

    • Visual Studio 2017 / 15.4.4
    • Xamarin 4.7.10.38
    • Xamarin.Android 8.0.2.1

    Does anyone have an idea how to solve this?

    EDIT:

    I'm facing the exact same error also on our VSTS-based build system. So it should not be a problem with my local machine.

    2017-11-24T08:15:22.7804554Z _LinkAssembliesShrink:
    2017-11-24T08:15:22.7804554Z Creating "obj\Release\link.flag" because "AlwaysCreate" was specified.
    2017-11-24T08:15:23.7500102Z ##[warning]C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1726,3): Warning : Name cannot begin with the '$' character, hexadecimal value 0x24.
    2017-11-24T08:15:23.7500102Z C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(1726,3): warning : Name cannot begin with the '$' character, hexadecimal value 0x24. [d:\a\1\s\Taskinator.Droid\Taskinator.Droid.csproj]

  • I was also getting this error. Although, I cannot say what the EXACT issue/solution is because I started troubleshooting a different error, and then got this error, and then got another error, and then got this error again, and then another... bla bla bla. It ended up taking me a few days to finally sort everything out and at this point I have no idea what combination of components/packages/Code/SDK Versions/etc. was the culprit for this particular error.

    That said, check your environment. Here is how I've got mine building:

    Visual Studio --> Tools --> Options --> Android Settings
    NOTE: All 32-bit:

    • Java Development Kit Location: C:\Program Files (x86)\Java\jdk1.8.0_121
    • Android SDK Location: C:\Program Files (x86)\Android\android-sdk
    • Android NDK Location: C:\Program Files (x86)\Android\android-ndk-r11c

    I do not believe that the JDK version is quite as important as the NDK version. I know there are known issues with NDK versions other than r11c (I don't remember which ones off hand). In this case, I do recommend r11c unless you have a compelling need to use a different version.

    Visual Studio --> Tools --> Andriod --> Android SDK Manager
    Make sure you have the following installed:

    • Android SDK Tools 25.2.5
    • Android SDK Build-tools 25.0.3
    • Android 7.1.1 (API 25) - SDK Platform
    • Android 7.1.1 (API 25) - Sources for Android SDK

    In the Android Project Properties of your Xamarin Solution

    • Application - Compile Using Android Version: Android 7.1 (Nougat)
    • Android Manifest - Minimum Android Version: Android 4.3 (API Level 18 - Jelly Bean)
    • Android Manifest - Target Android Version: Use Compile Using SDK Version
    • Android Options - Advanced - Java Max Heap Size: 1G

    Give that a shot and pray to the binary gods.

    P.S. - here are some other settings that may or may not be important:

    For my Android Project Properties, my supported architectures are: "armeabi;armeabi-v7a;x86"

    Here are all my installed Android SDK Manager components (in case you care):

    • Tools --> Android SDK Tools 25.2.5
    • Tools --> Android SDK Build-tools 26.0.3
    • Tools --> Android SDK Build-tools 25.0.3
    • Tools --> Android SDK Build-tools 23.0.3
    • Android 8.0.0 (API 26) --> SDK Platform
    • Android 7.1.1 (API 25) --> SDK Platform
    • Android 7.1.1 (API 25) --> Sources for Android SDK
    • Android 6.0 (API 23) --> SDK Platform
    • Android 6.0 (API 23) --> Google APIs
    • Extras -- Google USB Driver
  • NuramonNuramon CHUniversity ✭✭
    edited December 2017

    @DevOps_PunchingBag
    Thanks for your inputs. Last friday, I could get rid of the error by updating visual studio and the NuGet-dependencies. It is now working with:

    • Visual Studio Enterprise 2017 / 15.5.2
    • Xamarin - 4.8.0.753
    • Xamarin.Android - 8.1.0.25
    • AppCenter.*-Packages: 1.1.0
    • Xamarin.Firebase.*-Packages: 60.1142.0

    I can still see the error in the build log, but it is now considered as a warning and no longer as an error. Everything seems to work so far, locally and on our VSTS-build agent.

    By the way: I did not change anything for my local Android SDK. Still using same packages as before.

  • nhwillynhwilly USMember ✭✭

    Still getting this and updated to the latest everything. Just a warning, but grrrrr.

  • DiomedesDominguezDiomedesDominguez DOMember ✭✭

    @nhwilly said:
    Still getting this and updated to the latest everything. Just a warning, but grrrrr.

    I had to uncheck the "Enable ProGuard" checkbox to resolve this problem.

  • DiomedesDominguezDiomedesDominguez DOMember ✭✭

    @nhwilly said:
    Still getting this and updated to the latest everything. Just a warning, but grrrrr.

    I had to uncheck the "Enable ProGuard" checkbox to resolve this problem.

  • NateCookPersonalNateCookPersonal USUniversity ✭✭

    The warning seems to come from the Xamarin.Firebase.Iid package. Logged Github issues here and here.

    When you find an issue like this, please don't just post in the forum. Log it as a bug! The developers with the power to fix such issues don't often browse the forums; they take action on bug reports though.

Sign In or Register to comment.