My Android app recently started throwing Lint errors when compiling. I'm getting <key> is not translated in <language>. It tells me If an application has more than one locale, then all the strings declared in one language should also be translated in all other languages.
Unlike some of the other similar questions on this subject, I'm currently only supporting one locale. Eclipse somehow has started thinking that I want to support multiple, and now throws errors when compiling. Yes, I can turn off lint checking when I'm building, or I could set this to a warning instead of a fatal error, but that's just hiding the problem, which is that Eclipse thinks there are multiple locales. How do I fix this?
Edit: I tracked down the source - I added a library project that had a values-da folder. Any way to get the rest of my app to ignore that folder, or do I have to just remove it?
The only thing that seemed to work for this (thanks #323go for the suggestions) was to delete the folder. Renaming the file may work for you, but I got intermittent "Invalid resource directory name" errors.
Related
I am trying to upgrade an Android App to build under VS2022 and use the latest nuget packages. I am also trying to modify it so that it will work on phones, and not just tablets, so the display needs to scale properly. (This is an old project that started with VS2010, so there are many legacy problems.)
When I build it, I get the error message:
resource dimen/abc_action_bar_icon_vertical_padding_material not found.
The offending axml code is:
android:textSize="#dimen/abc_action_bar_icon_vertical_padding_material"
I know that this comes from the depreciation of R.dimen and that I should upgrade from the support library to AndroidX. I thought that I had done this.
My question is, How do I fix this? Should I add or delete packages? If I declare the value explicitly, what should I use? This happens in many files, so I want to make sure that it is fixed correctly.
I also get the message:
attribute menu not found
from the code:
app:menu="#menu/navigation_menu"
I assume this is a related problem.
Thanks,
Dan
So I had a bunch of resources in my app I swapped them out for new resources with different names, I now need to go through my project find all the missing resources references and change them to point to the new ones, android studio used to tell you where these were, you could simply try to build the project android studio would give a bunch of errors with links, and I could select each link to take me to the errors and fix them, but after updating studio it just gives me a failed linking resources error and i have to sift through myself, I'm sure there will be another way to do this perhaps through lint, does anyone have any information on how I could achieve this quickly
ok so I was right that lint checking can handle this for me analyze>inspect code> whole project and it gives me the errors with links
I recently read about the concept of reverse engineering and wanted to try it.
So I downloaded an apk and extracted it source code by using
apktool, dex2jar and jd-gui
Every thing went on smoothly and I extracted the resource as well as java files successfully. However the problem arose when I tried to import this project in android studio.
Initially it was showing a number resource files related errors which I corrected by changing the dependencies of the project but now I am getting all these weird errors in java files.
The errors include "not a statement', 'variable not initialized' etc.
Kindly Help. Thanks in Advance!
I have extracted code from apk before myself, and the results I got were similar to yours. I got most of the code, but not all of it and not with all of the formatting. Numerical constants were missing and the the "if, while, for" instructions were faulty. I don't know if this always happens, I did it only once, but I managed to figure out the rest of the code by what this processes gave me in the begging.
After I upgraded my android tools to latest version to work on API21, trying to compile my project resulted in the following error:
update_languages_button_preference_layout.xml:2: note: did you mean to use #+id instead of #+android:id?
update_languages_button_preference_layout.xml:2: error: creating resource for external package android: id/layout.
update_languages_button_preference_layout.xml:2: error: Error: No resource found that matches the given name (at 'id' with value '#+android:id/layout').
The problem seems to be the line android:id="#+android:id/layout": replacing #+android:id by #+id was enough to be able to compile and run the project normally.
However, a rapid search through the whole codebase revealed a few other locations in the project where the construction android:id="#+android:id/... is used. These apparently didn't prevent the project from passing all tests, even if I can't assure they are all still in use.
Is there any legitimate use of android:id="#+android:id that would justify leaving those references in our xml files, and not replacing them all by #+id?
Why didn't they raise the same error as the first file did?
No, you should never use #+android:id in your app. The android namespace is reserved for the framework. This has never been safe for an app to use and will now generate a compile error.
For a little background, generating new IDs within the android namespace will put them in the unused space after the existing android namespace IDs. This will work fine until new IDs are added in the framework, at which point your internal ID will overlap with an actual framework ID and cause weird issues.
As for the other instances, those should be generating errors as well. It's possible that there is a bug in AAPT. Regardless, you should remove all instances of #+android from your resources.
Though my comment is very late. I faced same issue today, when updated my eclipse and tools. Changed #+android:id to #+id and it solved my issue.
What are the possible causes of android failed to install. Invalid URI? What URI is this referring to and in what way is it invalid? It works fine in debug mode, but I cannot get it to install outside of debug mode.
Thanks
This error can point to so many different things, and there is many different fixes. To sum those I've gathered:
Problems with Eclipse: Clean project, rebuild project, restart eclipse.
Invalid characters: Remove any special characters in Eclipse project name. Use only [a-z] and [0-9] not even [ ] (whitespace)
Error in included jar: Try without jar and see if it runs, if does fix somehow.
Errors in manifest package setup: Right click in eclipse on project -> Android tools -> Rename application package (rename to something similar, you can always rename back).
Problems with device: Remove app from device and try re install.
ingyesid above basically means you need to refactor your project name to not include any non en/us characters. This will then change the apk filename which also cannot have accented letters eg; "ÖÄÅåäöééıßç....etc".. (and neither can any 'res' asset" have these). I had this problem recently when doing swedish, make sure project name and all filenames are in ENGLISH chars/nums only.
-You can however set your appname variable in "res/values/Strings" to the proper international chars.
This is either a bug or some shortsightedness on behalf of android devs. :/
not have accents or unusual characters. I had the accent and the name of the apk generated an error when going to install, remove the tick and it worked
/data/local directory has no permissions for writing, executing on "others".
You must use a superuser App and modify permissions for /data/local.
Setting them to rwxrwxrwx will work
This problem occurs if you have placed inavalid name of the project like MyAPP_$33, SO ONLY Letters [a---z] and digits [0,1,2...] are allowed .
No special characters are allowed during naming the project