I have an Android App written using Xamarin for Visual Studio. When it runs I get the warning:
Failure getting entry for 0x01080acd (t=7 e=2765) (error -75)
I know there is something wrong with one of my resources, but I can't seem to figure out which resource has the ID of 0x01080acd. I tried looking at it while debugging in the activity OnCreate method, but it doesn't seem to work. Any suggestions on how I might track this down?
Jim
If that is truly a resource ID, open the file Resource.Designer.cs in the Resources folder of your project.
Search for 17304269 (decimal for 0x01080acd).
If there's a match, that'll be the ID.
Otherwise, it might be a global resource or some other value.
If there is a problem with a resource then check the naming, resources must not start with number and use only letters and _ and also not any capital latter.
Check also here for naming rules http://developer.android.com/guide/topics/resources/providing-resources.html#QualifierRules maybe you have made an icon for some resolutions and forget to make it for others,
like in this similar question android failure getting some entry
Related
I am spell checking my project which is developed with android studio. I have multiple files to check spelling. I mean multiple string resource files and a few layouts(I know its a bad practive to have strings directly in layout, but had a little usage and previously developed).
Is there a way to find the find only the misspelled words? (like we do
find a word in whole project). I searched a lot and didnt find any solution.
thanks in advance
Note : My project is developed only for English. I don't use any other languages
If I understood you correctly, then you want to find the words, that you misspelled (write incorrectly) in your project.
To do this you can:
In main menu of Android Studio: Analyze - Inspect code - select Whole project - click OK
In the analyse results find Spelling
Inside it there will typically be 1 sub-item - Typo
Inside it you will find all found possible typos (misspelling) over the project including method\variable names as well as typos in the string resources.
String resource typos can be found under the module name folders.
Android crashes are often caused by a resource containing %1$ s when %1$s was intended.
To my surprise, Android Studio does not show these syntax errors:
↑ The real syntax error above is the %1$ s (makes the app crash), not the ellipsis that Android Studio highlights.
How to check for resource variable typos in Android Studio?
I am looking for the equivalent of lint --check StringFormatInvalid.
Context: Many semi-automatic language translation tools break variables, making apps crash.
What I have tried, does not work:
in Intellij it is possible to create custom inspections. I am not sure if it is possible in Android Studio.
Follow the link:
https://www.jetbrains.com/idea/help/creating-custom-inspections.html
edit:
after follow the steps in the link you see in the next image my created inspection:
In the next image you see the basic configuration of the inspection:
In the next two images you see the setting of the variables.
Only the used regex is not the ready. You must write it for general variable using (between $ and . is a space):
Every thing in strings.xml between <string> and </string> is merely a string for Android studio and lint. It will not identify syntax typos. Syntax errors/typos means error with code and not strings. You'll need to make sure that these are written right by yourself or create your own script to do these checks on the string.xml file. There is no inbuilt mechanism to identify code in strings and then check for syntax errors in them.
The highlighted thing with ellipses is there because it is a grammatical (optimization) error. If you make a spelling/grammatical mistake in strings.xml it will be highlighted. Example below:
But, if you intend to put in formats/code as strings it needs to be handled on your own or using some custom script that you'll need to write by yourself. Or as mentioned by #Rüdiger in his comment on the question, you can write unit test cases to check the sanity and integrity of your strings in strings.xml.
Last night my code was working fine, today when I load it up, the raw resource I access in my code is trying to read from an id pointing to a string rather than an xml file in my raw folder.
I have used http://www.statman.info/conversions/hexadecimal.html to track the resource id's and match them to their R hex id's and I can SEE that it should be accessing 0x7f040002 but is accessing 7f060000 for some reason...
I have already looked at :
Accessing wrong raw resource in Android
I have done all of the following:
Clean, Rebuild, Run.
Delete R, Reboot Eclipse, Clean, Rebuild, Run
Delete R, Clean and Rebuild Immediately, Reboot
UmbySlipKnot's idea of deleting Gen Folder + all of the above.
Making sure Android.R is not being used anywhere.
Printed the actual resource id I am expecting to use by calling (returns expected id correctly!):
int resId=con.getResources().getIdentifier("raw_tsn_xml_amina_simple","raw",con.getPackageName());
Also rebuilt the project entirely from scratch. No matter what I do - it's always getting app name as the resource id it references for the Input Stream - source
None of these have worked for me... Does anyone have any ideas what else I can try?
I have also added images to show you what I noticed:
Debug Snippet:
Android R File Snippet:
I had this issue the other day with the wrong image resource ID being used. The only thing that worked for me was renaming the resource and renaming the references to said resource. So try renaming raw_tsn_xml_amina_simple.xml to something else.
Try removing Gen folder and let it regenerate. Then try again.
Apparently the eclipse debugger is not as dependable as I expected.
While I was working with the debugger, I noticed that resource ID is correctly being found, but when I really nitpick into the debugger, the inputStream seemed to be getting built from another source.
I thought that was the reason my code was crashing, but it wasn't.
I use a SIMPLE xml android library - if the xml you pass it is in an unexpected/invalid format, it can't build the data models you create (My XML was invalid - therefore the crash).
I did a roll back to notice that new XML I had added, crashed the run.
The debugger just cranked out... giving me nulls when things weren't null, showing different values even when my logs were printing correct values!
Once I saw this hapenning, I didn't trust the debugger as much as I ususally do.
My advice :
If the simpler solutions on this page have not worked for you - Take the following steps:
Suspect code additions first! If something you added suddenly breaks your working code, it's probably your own error.
If your debugger acts weird, print useful log information (It is much faster) to give you the right information in the right places.
These are the exact steps I took to find the root of the problem.
I have a standard app.
I need to change some text, settings and graphics per client.
This way every client gets the app, customized for their brand.
I want to do this, by making the standard app a library.
I can now overwrite text in the string.xml
but when I want to change (for example) the splashscreen.png i get this error:
Error: No resource found that matches the given name (at 'drawable' with value '#drawable/splashscreen.png')
What am I doing wrong? Or is there a better way to tackle this problem?
thanks in advance.
Ok I found the problem.
I had my default drawables in the directory "drawable".
When I changed the directory name to "drawable-ldpi" everything worked fine.
Did you link the standard app as a library in the white-labeled app? When that is done, just place the new image/drawable in the res/drawable folder of the white-label app. Make sure the image/drawable has the same names as the image/drawable in the standard app.
You might want to read this http://goo.gl/j9EMc
I can't add comment to Steven Straatemans' accepted answer but in this article http://developer.android.com/guide/topics/resources/localization.html it is said that all your default resources should be present. Thus, you should add splashscreen.png to default files too. In the article they speak about locale but the same pays true for all the resources.
Whenever the application runs in a locale for which you have not provided locale-specific text, Android will load the default strings from res/values/strings.xml. If this default file is absent, or if it is missing a string that your application needs, then your application will not run and will show an error.
My android application has several warnings of the following form when I run it in the emulator:
"Resources don't contain package for resource number <Hex Address>"
How can I fix these warnings? In particular, is there an easy way to find out what the hex address refers to?
These appear to be coming from the emulator, but it is now working fine, so these aren't errors. Still curious why they are occuring though
Just a guess, but isn't the hex address from R.java?
If so, you should be able to identify the resource pretty easily.