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 11

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

Sign In or Register to comment.