When exporting a signed android package I get the following error:
app_name to translated in es,he,iw
No where in my app I have defined these three languages. I am not able to understand how lint is coming up with these languages. Is there any configuration that I might have updated my mistake?
I know that I can turn off this lint error by going to Window > Preferences > Android > Lint Error Checking > MissingTranslation. But that is not what I want to do. I have no plans to translate my app to these languages, then from where are these errors showing up.
Is there any file where I can define that my application uses only one locale?
I found the answer to my question. I am using FacebookSDK as a library function which has the folders values-es, values-he, values-iw which the android-lint is also expecting in my project.
To fix my issues I have removed these folders from FacebookSDK and recompiled my application.
However I do not think android lint should be flagging these as errors as they are not being used in my project, but that would be a different discussion.
To generalize the answer for the benefit of other developers stumbling here:
Check if you have created any values- folders, eg values-es, values-he, values-iw. If yes and you do not plan to use them remove the folders.
If you have not created the values- folders check if you these folders are present in any library project that you have referenced. If not needed in the library project remove them and recompile.
Note: If you remove folders from library project make sure to back them up as you may require them later.
you missed to mention the app_name in the all string.xml files , you may mention in only on one values file , but not in other two lang values . please check it.
values-en
values-he
values-iw
you have to mention in above three folders also..
Check your project, whether you have these folders in res/: values-es, values-he, values-iw.
If you donot want to support these languages, delete them.
If you want to support some languages, each strings.xml need have app_name item.
Related
I have a simple flashlight app in which while debugging, I noticed that there are several RTL (Right to left) layout folders in the res folder of my apk. So I googled it and set supportsRtl attribute to false in my manifest file which was previously true. But even after this change the folders are still present. I have tried rebuilding the project or clean the project but of no use. The folders are named like drawable-ldrtl-hdpi-v17 and others like drawable-ldrtl-mdpi-v17 , xhdpi, xxhdpi etc. I am surprised at v-17 suffix because my min sdk version is 21. Also they contain files like abc_ic_menu_copy_mtrl_am_alpha.png which seems weird to me. Can someone please help me to prevent these files from being generated as they unnecessary increase my apk size. Any help would be great.
Delete them if you don't want them. Android Studio doesn't go in and delete already generated files, because it doesn't know if you plan on using them later.
I'm using gradle system to build an Android app.
I got some libraries that refer resources like #strings/app_name in their manifests. When trying to build gradle cant find that resources. Thats somehow understanable because I think the main resource file is generated at the end and dosent exist yet. But I can be sure that #strings/app_name will be there.
How to tell gradle that? Dont I basically just need to ignore that error?
Do you have the string in your resources?
Check at: res -> values -> strings.xml
Even if you are not using it, It should be there!
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.
All,
I am attempting to use an existing open-source project (we'll call it A) within my app as a library. Project A also comes with its own library project (B). Project A compiles and runs just fine; however, when I try to use A within my app (I checked the 'Is Library' within A and added A to my app) I get several errors that "No resource identifier found for attribute 'X'in package..." These particular attributes exist within B. I even checked that they were added to R within A, and in fact, they were.
My question: why doesn't my app see that these resources exist?
I've searched all over and found only one situation like mine:
Android library not pulling its resources through to other projects
but I do not see that any of my resources are named the same.
I'm using Eclipse with ADT v20.0
I appreciate any help!
EDIT: If it's helpful, the open-source app I'm trying use is AnySoftKeyboard (ASK). I've also tried creating a new project and adding ASK as a library -- no dice.
EDIT2: Part of making ASK a library required converting several switch statements to if-else statements because R Ids are not declared as final for libraries.
The errors are apparently due to the usage of custom attributes in the AnySoftKeyboard project that you converted to a library. I found that a solution is recently added into ADT (on Rev 17), mentioned in this answer.
As instructed, I tried replacing all instances of
"http://schemas.android.com/apk/res/com.menny.android.anysoftkeyboard"
with
"http://schemas.android.com/apk/res-auto"
in the newly converted library project and was able to build and run an app which includes the project (didn't really test any functionality though).
Hope this helps.
Basically, I need help importing downloaded source or creating a project from sample source programs. I'm looking for step by step instructions for both if anyone can point me there or post the steps.
I'm very new to Android/Eclipse. I have the environments installed and have successfully written a very minor app that works on the emulator and my real Droid X. I cannot, however, get any of the Android samples into a project without errors. I've tried importing, creating from existing source, and etcetera and it's all a mess with errors everywhere.
I have, however, successfully created a new empty project, then brought the components into the project one at a time typing or pasting in code for every file. I'd hover over and import Android and other components as needed. The WiktionarySimple, for example, ran with only a couple of changes and several warnings that I left alone. (I had to add 'formatted="false" in the statements below...)
<string name="template_user_agent" formatted="false">"%s/%s (Linux; Android)"</string>
<string name="template_wotd_title" formatted="false">"Wiktionary:Word of the day/%s %s"</string>
But there has to be an easier way to import! I've done the intuitive and I've followed instructions that I've found, but to no avail. Can anyone give me a complete list as to how to import or create a project from existing source or from source I've downloaded from the web?
Step #1: Start a new Android project
Step #2: In the first page of the Android project wizard, choose the "Create project from existing source" radio button, then click the Browse button and find the directory containing the project
Step #3: Tweak settings to suit, then press Finish
Step #4: If needed (not sure if it is anymore), right-click over the project name, and choose Build Path > Configure Build Path from the context menu, and make sure the Android entry in the checklist is checked
Its quite possible that you are not importing these projects incorrectly and that you are simply running into common problems that occur when importing projects.
For instance your problem involving adding formatted="false" is quite common and due to a change in the strictness of aapt, which is explained in this question. It is likely that the sample project was created before the change and has not been updated since.
That error involving the formatted="false" can also cause many more errors, since any xml after that error is often not parsed and thus any resources declared after it are not known. So the error No resource found that matches the given name (at 'hint' with value '#string/search_hint') and others like it are often due to the formatted="false" error. I would suggest fixing all the % sign errors with the formatted="false" then letting it rebuild and see how many errors are left.
As for the String types not allowed (at 'layout_width' with value 'match_parent') a quick search on stackoverflow says that its caused because FILL_PARENT was replaced with MATCH_PARENT in Android 2.2. So you need to set your sdk for the project to be Android 2.2 or higher. Here is the link to that question as well.
This happened to me in importing the wiktionary sample and i found the solution.
Import the project through existing code
Right click project and choose properties
In 'Android' Tab the default choice is the minimum API. Changed it to the latest(highest API)
Click ok.
Clean and build your project and errors will be gone
(probably optional)
6. Change the target and Minimum SDK in the Android Manifest