21
votes

I have this warning that never goes away and I don't know how to get it fixed:

Warning Name cannot begin with the '$' character, hexadecimal value 0x24.

.Android C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Xamarin\Android

C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets 1668 Build

After enabling detailed verbosity, it points to this section of the Xamarin.Android.Common.targets file:

<Target Name="_GenerateJavaStubs" DependsOnTargets="_SetLatestTargetFrameworkVersion;_PrepareAssemblies;$(_AfterPrepareAssemblies)" Inputs="$(MSBuildAllProjects);@(_ResolvedAssemblies);$(_AndroidManifestAbs);$(_AndroidBuildPropertiesCache)" Outputs="$(IntermediateOutputPath)android\AndroidManifest.xml;$(_AcwMapFile);$(_AndroidTypeMappingJavaToManaged);$(_AndroidTypeMappingManagedToJava)">
  <GenerateJavaStubs ResolvedAssemblies="@(_ResolvedAssemblies)" ResolvedUserAssemblies="@(_ResolvedUserAssemblies)" ManifestTemplate="$(_AndroidManifestAbs)" MergedManifestDocuments="@(ExtractedManifestDocuments)" Debug="$(AndroidIncludeDebugSymbols)"
    NeedsInternet="$(AndroidNeedsInternetPermission)" AndroidSdkPlatform="$(_AndroidApiLevel)" AndroidSdkDir="$(_AndroidSdkDirectory)" PackageName="$(_AndroidPackage)" ManifestPlaceholders="$(AndroidManifestPlaceholders)" OutputDirectory="$(IntermediateOutputPath)android"
    MergedAndroidManifestOutput="$(IntermediateOutputPath)android\AndroidManifest.xml" UseSharedRuntime="$(AndroidUseSharedRuntime)" EmbedAssemblies="$(EmbedAssembliesIntoApk)" ResourceDirectory="$(MonoAndroidResDirIntermediate)" BundledWearApplicationName="$(BundledWearApplicationPackageName)"
    PackageNamingPolicy="$(AndroidPackageNamingPolicy)" ApplicationJavaClass="$(AndroidApplicationJavaClass)" AcwMapFile="$(_AcwMapFile)">
  </GenerateJavaStubs>
  <ConvertResourcesCases ResourceDirectories="$(MonoAndroidResDirIntermediate)" AcwMapFile="$(_AcwMapFile)" />
</Target>

I have no idea if I need to modify this or if one of my files is causing the issue. I double checked, none of my files actually start with a $.

Any ideas?

Thank you.

5
It seems that your .xml or .axml is malformed or wrong, please check it.Eren Shen
York Shen, thnaks for your answer but that .xml file is made my Xamarin. I don't know wjhat to look for. It seems fine.E. Bourque
You could press Ctrl and F at same time, search "$" in your Current project.Eren Shen
I have the same problem. Any solution?Kim HJ
Is there any solution? Im getting frustrated because it cant build my projectnewbieguy

5 Answers

1
votes

Seems to be a Xamarin bug, at least in some circumstances. Logged Github issues here and here with repro steps and a sample project.

0
votes

Try this:

  1. Open Windows Task Manager -> Go to the Details Tab
  2. End all MSBuild.exe tasks you may find

End MSBuild.exe


  1. Go to your project folder, delete Bin & Obj folders (SHIFT+DEL)
  2. Close Visual Studio completely
  3. Open Visual Studio again, open your solution, rebuild.

OR this:

  1. Open Project settings
  2. Go to Android Manifest
  3. Make sure your Version number doesn't have dots or commas

enter image description here

0
votes

Looking through the diagnostic output of Visual Studio, I could see a lot of '\$' occurrences, most of them related to Google Play.

For me, the solution was that I had forgotten to install Google Play in the SDK Manager (under Extras).

0
votes

For me, a Visual Studio 2017 update did the trick. Now it is only a warning anymore.

Name cannot begin with the '$' character, hexadecimal value 0x24.

VS 17 update from 15.4.4 to 15.7.4 was done.

0
votes

I have experienced this error on Android, and what I have done to make it works is: "Version Number" should be a number and it should not contain the dot.