Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed linking references in Android project (Xamarin - Visual Studio Community 2019) #3822

Closed
bharanidharan1707 opened this issue Oct 18, 2019 · 18 comments
Labels
Area: App+Library Build Issues when building Library projects or Application projects.

Comments

@bharanidharan1707
Copy link

bharanidharan1707 commented Oct 18, 2019

Error		resource style/Theme.AppCompat.Light.DarkActionBar (aka com.companyname.xamapp:style/Theme.AppCompat.Light.DarkActionBar) not found.	XAMApp.Android			
Error		failed linking references.	XAMApp.Android			
Error		resource style/Theme.AppCompat.Light.Dialog (aka com.companyname.xamapp:style/Theme.AppCompat.Light.Dialog) not found.	XAMApp.Android			
Error		style attribute 'attr/windowNoTitle (aka com.companyname.xamapp:attr/windowNoTitle)' not found.	XAMApp.Android	D:\VS2019Projects\XAMApp\XAMApp.Android\Resources\values\styles.xml	2	
Error		style attribute 'attr/colorPrimary (aka com.companyname.xamapp:attr/colorPrimary)' not found.	XAMApp.Android	D:\VS2019Projects\XAMApp\XAMApp.Android\Resources\values\styles.xml	2	
Error		style attribute 'attr/windowActionBar (aka com.companyname.xamapp:attr/windowActionBar)' not found.	XAMApp.Android	D:\VS2019Projects\XAMApp\XAMApp.Android\Resources\values\styles.xml	2	
Error		style attribute 'attr/colorPrimaryDark (aka com.companyname.xamapp:attr/colorPrimaryDark)' not found.	XAMApp.Android	D:\VS2019Projects\XAMApp\XAMApp.Android\Resources\values\styles.xml	2	
Error		style attribute 'attr/colorAccent (aka com.companyname.xamapp:attr/colorAccent)' not found.	XAMApp.Android	D:\VS2019Projects\XAMApp\XAMApp.Android\Resources\values\styles.xml	3	
Error		style attribute 'attr/windowActionModeOverlay (aka com.companyname.xamapp:attr/windowActionModeOverlay)' not found.	XAMApp.Android	D:\VS2019Projects\XAMApp\XAMApp.Android\Resources\values\styles.xml	4	
Error		style attribute 'attr/colorAccent (aka com.companyname.xamapp:attr/colorAccent)' not found.	XAMApp.Android	D:\VS2019Projects\XAMApp\XAMApp.Android\Resources\values\styles.xml	4	
@jonpryor jonpryor added the need-info Issues that need more information from the author. label Oct 21, 2019
@jonpryor jonpryor added this to the Under Consideration milestone Oct 21, 2019
@jonpryor jonpryor added the Area: App+Library Build Issues when building Library projects or Application projects. label Oct 21, 2019
@jonpryor
Copy link
Member

Please attach a reproducible test case and a build log.

This is likely a NuGet restore issue. Restoring packages in your project may fix the problem.

@NickyAsher
Copy link

Apologies if this problem has already been fixed, but I found that this happened to me immediately after updating my android SDK platform.
I found that (within visual studio) cutting everything within in styles.xml, letting it build, pasting it all back in, then rebuilding the project rather than the regular build process fixed it for me.

@adamhalesworth
Copy link

This same issue occurred for me after updating the Android SDK, however deleting bin and obj folders in the Android project solved the problem.

@thaihuydang
Copy link

This same issue occurred for me after updating the Android SDK, however deleting bin and obj folders in the Android project solved the problem.

Deleting 'bin' and 'obj' not work with me

@bharanidharan1707
Copy link
Author

This same issue occurred for me after updating the Android SDK, however deleting bin and obj folders in the Android project solved the problem.

Deleting 'bin' and 'obj' not work with me

For me also not working.

@gitknul
Copy link

gitknul commented Jan 16, 2020

This same issue occurred for me after updating the Android SDK, however deleting bin and obj folders in the Android project solved the problem.

Deleting 'bin' and 'obj' not work with me

For me also not working.

It is also not working for me. Cleaning and rebuilding the solution in VS also didn't work.

Update:

In my case the error was in one of my resources, the 'Styles.xml' was not properly formatted. After I fixed it it managed to build.

@HelenMamalaki
Copy link

HelenMamalaki commented Feb 6, 2020

deleting bin and obj did nothing for me too. I tried a NuGet restore and it failed with something about a downgrade detected in my Android Support packages. Upgrading them fixes the issue. [Updating to VS2019 from 2017 had me add an explicit reference to Xamarin.Essentials in Android.csproj which I think is what then caused Android Support package version issues.] However I can get the error to go away by upgrading then downgrading the Support packages so no idea what is happening. Prob not useful to anyone but wanted to share my experience just in case.

@adamhalesworth
Copy link

Sorry, I only offered the suggested fix because it worked for me. Perhaps there's multiple issues occurring here and deleting the intermediates solves it in a specific case?

@bondsy777
Copy link

Screenshot 2020-02-07 at 19 29 26

Hello. I managed to solve this problem by updating the nugget packages. Version of which you can see in the screenshot.

@xphacter
Copy link

I ran the following in Package Manager Console to fix my issue:
Install-Package Xamarin.Android.Support.v7.AppCompat

@grendello grendello removed the need-info Issues that need more information from the author. label Mar 19, 2020
@grendello
Copy link
Member

grendello commented Mar 19, 2020

It appears the issue is fixed by restoring nuget packages as suggested by @jonpryor, therefore I'm closing the issue. @bharanidharan1707 if you still experience this and restoring nugets doesn't help, please reopen.

@aroraarjita
Copy link

@grendello
Neither restoring the packages nor 'Install-Package Xamarin.Android.Support.v7.AppCompat' is working for me. Please find the attached screenshot of the errors. Any inputs will be highly appreciated
@xphacter @bondsy777 @thisdarktao @HelenMamalaki @olivierbouchomsfreshheads @bharanidharan1707 @thaihuydang @NickyAsher @jonpryor -

Severity Code Description Project File Line Suppression State
Error failed linking references. ScanbotBarcodeSDKFormsExample.Android
Error resource attr/flow_horizontalSeparator (aka io.scanbot.example.sdk.barcode.xamarin.forms:attr/flow_horizontalSeparator) not found. ScanbotBarcodeSDKFormsExample.Android C:\Users\user\Downloads\scanbot-barcode-scanner\scanbot-barcode-scanner-sdk-example-xamarin-master\Example.Forms\ScanbotBarcodeSDKFormsExample.Android\obj\Debug\90\lp\34\jl\res\values\values.xml 269
Error resource attr/flow_verticalSeparator (aka io.scanbot.example.sdk.barcode.xamarin.forms:attr/flow_verticalSeparator) not found. ScanbotBarcodeSDKFormsExample.Android C:\Users\user\Downloads\scanbot-barcode-scanner\scanbot-barcode-scanner-sdk-example-xamarin-master\Example.Forms\ScanbotBarcodeSDKFormsExample.Android\obj\Debug\90\lp\34\jl\res\values\values.xml 269
Error resource attr/flow_horizontalSeparator (aka io.scanbot.example.sdk.barcode.xamarin.forms:attr/flow_horizontalSeparator) not found. ScanbotBarcodeSDKFormsExample.Android C:\Users\user\Downloads\scanbot-barcode-scanner\scanbot-barcode-scanner-sdk-example-xamarin-master\Example.Forms\ScanbotBarcodeSDKFormsExample.Android\obj\Debug\90\lp\34\jl\res\values\values.xml 270
Error resource attr/flow_verticalSeparator (aka io.scanbot.example.sdk.barcode.xamarin.forms:attr/flow_verticalSeparator) not found. ScanbotBarcodeSDKFormsExample.Android C:\Users\user\Downloads\scanbot-barcode-scanner\scanbot-barcode-scanner-sdk-example-xamarin-master\Example.Forms\ScanbotBarcodeSDKFormsExample.Android\obj\Debug\90\lp\34\jl\res\values\values.xml 270
Error resource attr/motionProgress (aka io.scanbot.example.sdk.barcode.xamarin.forms:attr/motionProgress) not found. ScanbotBarcodeSDKFormsExample.Android C:\Users\user\Downloads\scanbot-barcode-scanner\scanbot-barcode-scanner-sdk-example-xamarin-master\Example.Forms\ScanbotBarcodeSDKFormsExample.Android\obj\Debug\90\lp\34\jl\res\values\values.xml 272
Error resource attr/flow_verticalSeparator (aka io.scanbot.example.sdk.barcode.xamarin.forms:attr/flow_verticalSeparator) not found. ScanbotBarcodeSDKFormsExample.Android C:\Users\user\Downloads\scanbot-barcode-scanner\scanbot-barcode-scanner-sdk-example-xamarin-master\Example.Forms\ScanbotBarcodeSDKFormsExample.Android\obj\Debug\90\lp\34\jl\res\values\values.xml 272
Error resource attr/flow_horizontalSeparator (aka io.scanbot.example.sdk.barcode.xamarin.forms:attr/flow_horizontalSeparator) not found. ScanbotBarcodeSDKFormsExample.Android C:\Users\user\Downloads\scanbot-barcode-scanner\scanbot-barcode-scanner-sdk-example-xamarin-master\Example.Forms\ScanbotBarcodeSDKFormsExample.Android\obj\Debug\90\lp\34\jl\res\values\values.xml 272
Error resource attr/motionProgress (aka io.scanbot.example.sdk.barcode.xamarin.forms:attr/motionProgress) not found. ScanbotBarcodeSDKFormsExample.Android C:\Users\user\Downloads\scanbot-barcode-scanner\scanbot-barcode-scanner-sdk-example-xamarin-master\Example.Forms\ScanbotBarcodeSDKFormsExample.Android\obj\Debug\90\lp\34\jl\res\values\values.xml 275
Error resource attr/motionProgress (aka io.scanbot.example.sdk.barcode.xamarin.forms:attr/motionProgress) not found. ScanbotBarcodeSDKFormsExample.Android C:\Users\user\Downloads\scanbot-barcode-scanner\scanbot-barcode-scanner-sdk-example-xamarin-master\Example.Forms\ScanbotBarcodeSDKFormsExample.Android\obj\Debug\90\lp\34\jl\res\values\values.xml 276
Error resource attr/waveDecay (aka io.scanbot.example.sdk.barcode.xamarin.forms:attr/waveDecay) not found. ScanbotBarcodeSDKFormsExample.Android C:\Users\user\Downloads\scanbot-barcode-scanner\scanbot-barcode-scanner-sdk-example-xamarin-master\Example.Forms\ScanbotBarcodeSDKFormsExample.Android\obj\Debug\90\lp\34\jl\res\values\values.xml 285
Error resource attr/motionProgress (aka io.scanbot.example.sdk.barcode.xamarin.forms:attr/motionProgress) not found. ScanbotBarcodeSDKFormsExample.Android C:\Users\user\Downloads\scanbot-barcode-scanner\scanbot-barcode-scanner-sdk-example-xamarin-master\Example.Forms\ScanbotBarcodeSDKFormsExample.Android\obj\Debug\90\lp\34\jl\res\values\values.xml 285
Error resource attr/motionPathRotate (aka io.scanbot.example.sdk.barcode.xamarin.forms:attr/motionPathRotate) not found. ScanbotBarcodeSDKFormsExample.Android C:\Users\user\Downloads\scanbot-barcode-scanner\scanbot-barcode-scanner-sdk-example-xamarin-master\Example.Forms\ScanbotBarcodeSDKFormsExample.Android\obj\Debug\90\lp\34\jl\res\values\values.xml 289
Error resource attr/motionProgress (aka io.scanbot.example.sdk.barcode.xamarin.forms:attr/motionProgress) not found. ScanbotBarcodeSDKFormsExample.Android C:\Users\user\Downloads\scanbot-barcode-scanner\scanbot-barcode-scanner-sdk-example-xamarin-master\Example.Forms\ScanbotBarcodeSDKFormsExample.Android\obj\Debug\90\lp\34\jl\res\values\values.xml 291
Error resource attr/motionProgress (aka io.scanbot.example.sdk.barcode.xamarin.forms:attr/motionProgress) not found. ScanbotBarcodeSDKFormsExample.Android C:\Users\user\Downloads\scanbot-barcode-scanner\scanbot-barcode-scanner-sdk-example-xamarin-master\Example.Forms\ScanbotBarcodeSDKFormsExample.Android\obj\Debug\90\lp\34\jl\res\values\values.xml 319
Error resource attr/duration (aka io.scanbot.example.sdk.barcode.xamarin.forms:attr/duration) not found. ScanbotBarcodeSDKFormsExample.Android C:\Users\user\Downloads\scanbot-barcode-scanner\scanbot-barcode-scanner-sdk-example-xamarin-master\Example.Forms\ScanbotBarcodeSDKFormsExample.Android\obj\Debug\90\lp\34\jl\res\values\values.xml 336

image

@aroraarjita
Copy link

This same issue occurred for me after updating the Android SDK, however deleting bin and obj folders in the Android project solved the problem.

Deleting 'bin' and 'obj' not work with me

For me also not working.

It is also not working for me. Cleaning and rebuilding the solution in VS also didn't work.

Update:

In my case the error was in one of my resources, the 'Styles.xml' was not properly formatted. After I fixed it it managed to build.

Could you please let me know what change you did in Styles.xml? Would appreciate any leads to this issue.

@mrhemalatha
Copy link

Upgrade XF version to resolve this problem

@ajramos27
Copy link

Consolidating the NuGet packages worked for me.

@OscarHMG
Copy link

OscarHMG commented Mar 1, 2021

This same issue occurred for me after updating the Android SDK, however deleting bin and obj folders in the Android project solved the problem.

It Work, thanks!! (Y)

@ssorey
Copy link

ssorey commented Sep 22, 2021

I am having the same issue failed linking references (Xamarin - Visual Studio Community 2019)

@pldeschamps
Copy link

pldeschamps commented Sep 27, 2021

be careful to write in styles.xml:

<?xml version="1.0" encoding="utf-8" ?>
<resources>
  <style name="AlmicantaratTheme" parent="Theme.AppCompat.NoActionBar">
      <item name="android:windowNoTitle">true</item>
      <item name="android:windowActionBar">false</item>
      <item name="android:colorPrimary">#15014E</item>
  </style>
</resources>

Do not write:
<style name="AlmicantaratTheme" parent="@android:Theme.AppCompat.NoActionBar">
see:
https://try2explore.com/questions/11211050

@xamarin xamarin locked as resolved and limited conversation to collaborators Jun 5, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Area: App+Library Build Issues when building Library projects or Application projects.
Projects
None yet
Development

No branches or pull requests