Problems and Solutions when using Eclipse to sign APK
Today, I used the APK decompilation tool to read the APK file generated by my project and found that the Code is not obfuscated. So I set the ProGuard to confuse the code, however, obfuscation takes effect only in non-Debug mode. Even if you Run As to start the generated APK package in Release mode, ProGuard is still not used. So I decided to export the Release APK, which is divided into two types: "signature" and "non-signature". This is the case, of course, the signature is required, so we encountered the following two problems.
I. strings. xml Translation Problems
Right-click your project name and choose Android Tools> Export Signed Application Package from the shortcut menu ...,
Then you will see a prompt:
And get the following error description:
The Export Operation exits because of a fatal Lint Error Checking. Correct these errors before running the export operation, or, on the Android-> Lint Error Checking page in the settings, turn off the "Run full error check when exporting app" option.
In the error description, strings. the app_name in xml lacks af (Afrikaans), am (Amharic), ar, bg, bn-rBD, ca, cs, da, de... this may be related to the strings in appcompat_v7 of the project automatically generated when the project is created. the number of xml languages is related. Of course we don't want to translate every language, unless we really want to translate every language.
On the other hand, we do not want to turn off all Lint Error Checking, so we can do this, open the eclipse menu Windows-> Perferences,
Switch to the sub-item Android-> Lint Error Checking. below is the default setting of Missing Translation:
We can change the Severity of this item from Fatal (Fatal) to Ignore (Ignore) or Warning (Warning), for example:
Another question is worth noting about multilingual translation, for example, notes for translating strings from multiple languages in Android.
Ii. Question about the comma in the signed keystore
Click "OK" and start the previous step again to start exporting. This time, the export page is displayed. Select the project you want to export:
Select a keystore. You can select an existing keystore or create a new keystore. I select "new" and enter the password to go to the following settings page:
Next, at the end of the generation, we get the following error:
Google, find this article: keytool error: java. io. IOException: Incorrect AVA format, stackoverflow also has a similar discussion: keytool error: java. io. ioException: Incorrect AVA format. The conclusion is the same. It turns out that "," (comma) is considered a special character, which usually occurs when "City or Locality" is written, according to our usual habits, we will write "Beijing, China", and I write "GuangXi, China" as an exception, so I made an error. Find the cause and remove the comma and try again, OK.
In addition to using Eclipse, there is also a signature method, that is, using Keytool and Jarsigner to sign the app, and this signature allows this comma. keytool error: java. io. IOException: Incorrect AVA format.
Here I post a keytool on the description and usage of special characters, from: http://www.oschina.net/question/163910_29310,
Special characters include the plus sign (+), quotation marks ("), slash (\), greater than or equal to signs (<and>), semicolons (;), etc, the solution is to use the \ escape character.