Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

keytool error :java.io.IoException:Incorrect AVA format

Probably you entered illegal character(something like,(comma)) in a field for Name, Organization or somewhere else.

Of course, if you really want some character can be escaped with \ sign

"+" (plus sign) sign also causes this issue. (People often tend to use + sign for the country code field)


I have faced an error while trying to export a signed .apk file with Eclipse ADT. The error was same like your error. In my case, I used a + sign before the country code. By removing the + sign from this name fixed the problem and allowed me to fully export my signed .apk file. Also, this error can occur when use comma,slash, semi-colon, quotation.


You tried to use special characters while exporting apk.You can't use these special characters in any field shown while creating the apk. The special character set includes:

  • Commas (,)
  • Addition symbol (+)
  • Quotation mark (")
  • Back-slash ("\")
  • Angled brackets(< and >)
  • Semi-colon (;)

I solved these Exception by changing the country code:

+91 to India


I came on this error when I did not set the distinguished name option at all. This was corrected by setting the option to a validly formatted string.

this command failed with the AVA format exception: (line breaks added for legibility)

C:\Program Files\Java\jdk1.6.0_45\jre\bin>keytool 
-genkey -v -dname PatrickTaylor -validity 10000 
-keystore C:\drops\patrickkeystore 

this command completed successfully:

C:\Program Files\Java\jdk1.6.0_45\jre\bin>keytool 
-genkey -v -dname PatrickTaylor -validity 10000 
-keystore C:\drops\patrickkeystore 
-dname "cn=Patrick Taylor, ou=engineering, o=company, c=US"

Special chars/escaping all good answers/could be the problem; you didn't share your actual "keytool" command line so harder to give an accurate answer. If you're trying to gen a pub/priv key pair ("-genkeypair" param), then 1 problem would be that the cert subject distinguished name ("-dname" arg) wasn't specified in the correct X.500 AVA ("Attribute/Value" Assertion) format. For example, omitting the "CN=" in front of the subject common name (CN). Param should look something like this:

keytool ... -dname="CN=SomeCertSubject" ...

In this distinguished name param, "CN" ("Common Name") is the "Attribute", "SomeCertSubject" is the "Value".