Xamarin.Android Buid Error : Expected reference but got (raw string) #000000

Hello,
I got an unpredictable error when i build the android project in xamarin forms.
error is looks like,

Posts

  • LeonLuLeonLu Member, Xamarin Team Xamurai

    @DiptejThakkar you can add the color in the colors.xml like following code.

    <!-- Base application theme. -->
    <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
        <!-- Customize your theme here. -->
        <item name="colorPrimary">@color/colorPrimary</item>
        <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
        <item name="colorAccent">@color/colorAccent</item>
    
      <item name="statusBarBackground">@color/statusbarcolor</item>
    </style>
    

    Then, use it in the item of style.

     <item name="statusBarBackground">@color/statusbarcolor</item>
    
  • DiptejThakkarDiptejThakkar Member ✭✭

    @LeonLu Thanks for your reply,
    I found the solutions related to monoversion conflict. i replace the monoversion81 to monoversion90. then its work perfectly.
    Thanks once again.

  • LeonLuLeonLu Member, Xamarin Team Xamurai
    edited October 2019

    @DipakPatil You are welcome, please mark your reply as answer, it will help others who have similar issue. But i recommand you to set the color in the colors.xml file, it more compliance with specifications

  • dmcspaddendmcspadden Member ✭✭

    We are experiencing the same issue but setting the target framework doesn't appear to be helping:

    error APT0000: expected reference but got (raw string) #000000.
    error APT0000: failed linking references.

    We've set the target framework to monandroid90 for everything in the packages.config , but no luck.

  • dmcspaddendmcspadden Member ✭✭

    Make sure you replace all references in BOTH the packages.config and the .csproj then delete Bin, Obj, .VS folders, clean and rebuild.

  • Dmitry_ZuevDmitry_Zuev USMember
    edited December 2019

    In your res/values/styles.xml you can add
    <style name="Widget.Support.CoordinatorLayout" parent="android:Widget"> <item name="statusBarBackground">@null</item> </style>

  • rmonfortrmonfort Member

    When installing xamarin.forms 4.4 that error happened in my solution

    My solution was:

    • Migrate packages.config to PackageReference...
    • Restart VS2019
    • Clean solution and rebuild
  • DrewBrasherDrewBrasher Member

    I got this after updating from Xamarin.Forms 4.3 to 4.4 and @rmonfort solution worked for me also.

Sign In or Register to comment.