Android values styles xml error

AAPT: error: resource not found, but it is present in styles.xml

However is present in app\src\res\values\styles.xml

The error points to the generated file

which has declarations that I don’t have in the main manifest, like

So another question is how can it be possible and how to get rid of them?

I’ve just spent about a week trying to launch this project (given to me by previous developer who is refusing to explain anything) and eliminating errors like links to non-existent resources, but these ones are present and visible by eye.
So how can I make the resources visible for build and what makes the generated manifest look as it looks?
upd
After fixing some more errors it came up with several errors like:

So again, resources get duplicated in a generated file.
upd 2
After commenting those out it gives:

I tried invalidating caches in Android Studio but with no effect. Any ideas?

3 Answers 3

you need to remove default_web_client_id from res/values/strings.xml

and let the Goggle Services Plugin add that string resource instead.

then it most likely can generate R and the style might be found then.

I faced the same problem this week after updating Android Studio to the latest version, only difference being aapt2 created problems with all my resources, starting from colors.xml and when I pasted the content from a different project, the problem moved to the drawables, etc. It seemed to be happening only in new projects though, so I was sure it had nothing to do with previously written code. You should try seeing if you can build new projects, maybe the problem is the same for you.

I tried a lot of things to fix this, but the only thing that seemed to do the trick for me was a clean reinstallation of Android Studio. I made sure to erase everything related to the application besides my projects and reinstalled from scratch. After that the project built without a glitch.

Читайте также:  Как убрать блокировку при запуске андроид

Hope this helps!

PS. Make sure to check under all your drives to avoid any slip ups as in my case Android Studio was installed in E:// while android data like .gradle was «hidden» under C:// which gave me the option to reinstall with previous settings a couple of times leading to no change.

Источник

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

Comments

bharanidharan1707 commented Oct 18, 2019 •

The text was updated successfully, but these errors were encountered:

jonpryor commented Oct 21, 2019

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 commented Nov 13, 2019

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.

thisdarktao commented Nov 26, 2019

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 commented Dec 26, 2019

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 commented Dec 26, 2019

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.

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

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

Читайте также:  Как выделить android studio больше озу

thisdarktao commented Feb 6, 2020

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 commented Feb 7, 2020

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

xphacter commented Feb 12, 2020

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

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 commented Oct 13, 2020

@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

aroraarjita commented Oct 13, 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.

Источник

Fixing Error in styles.xml to generate R.java : No resource found name ‘Theme.AppCompat.Light’

I am new to Android and am trying to run my first program. However, based on my searches across the internet, I think that I can’t import mypackage.R because r.java has not been generated because of errors in my style.xml files. I have searched around trying to figure out how to fix these but I can’t find a fix that works. The error in styles.xml is

Читайте также:  Shadow fight 3 для андроид дата выхода

Does anyone know how to fix this?

![Errors in style.txt][1]

Here is the code I am using:

UPDATE: Here is styles.xml:

UPDATE 2: Here is AndroidManifest.xml

4 Answers 4

You are trying to use Theme.AppCompat.Light theme which is a library project. You have to reference this library project to your project.

Now, at first, check that you have installed this library project as follows.

Go Window—>Android SDK Manager then a window named Android SDK Manager will appear as below.

If the Android Support Library is not installed then install it. You can see more information about Android Support Library setup from the below Android Developer site.

After Android Support Library setup completion, reference the library to your project from this path.

To reference, follow these steps:

  1. File->Import (android-sdk\extras\android\support\v7). Choose «appcompat«
  2. Project->properties->Android. In the section library «Add» and choose «appCompat«

Now, clean and build your project and run it. I think after all of these, your problem will be solved.

Источник

Android gradle error when sync style attribute not found

I am getting a few errors when I try to sync gradle. I am extremely new to android coding.

Gradle Console

Build.gradle

styles.xml

styles_parent.xml

first bit of values.xml (limited on characters, but don’t worry it hasn’t been touched)

Also, I am getting 2 error on values.xml:

URI is not registered

Resource registered by this URI is not recognized

Any help will be greatly appreciated!

3 Answers 3

From Your Error Log seems Like you are getting this error because of

error: style attribute ‘attr/roundSelector (aka com.example.adend.timetable:attr/roundSelector)’ not found.

So Please check this

you have this round_selector_dark in your drawable or not .

there are multiple errors and all are regarding your style.xml

So double check your style.xml elements.

Then I figured, since I was not using the PreferenceFragmentCompat, I had removed a seemingly unnecessary dependency from by build.gradle: ‘com.android.support:preference-v4:27.1.1‘ I have put that dependency back and am feeling lonely as ever again.

If you have two or more libraries in a project, this isssue could be raised by depended library.

For me, Project A contains library B and C, and each of which library has Logger library L.

The error raised in library B while doing mergeReleaseResources task, but the root cause was laid on library L. In detail, the library L had meaningless style definitions. I removed style items and the issue resolved.

Источник

Оцените статью