Format specifier '%s' | Community
Skip to main content

Format specifier '%s'

  • September 8, 2023
  • 0 replies
  • 0 views

Joshua33

The application crashed with Proguard in the Release build.
Debug build works correctly.
The Crash relates to the following method.

HtmlParser() {
XmlPullParser xmlPullParser = null;

try {
final XmlPullParserFactory factory = XmlPullParserFactory.newInstance();
factory.setValidating(false);
factory.setFeature(Xml.FEATURE_RELAXED, true);
xmlPullParser = factory.newPullParser();
} catch (XmlPullParserException e) {
Logger.w(RequestActivity.LOG_TAG, "Unable to parse rich text. Error: '%s' | '%s'", e
.getLocalizedMessage());
} finally {
xpp = xmlPullParser;
}
}

The application crashed in the catch block in the following case of the formatter class.

case 0:  // ordinary index
lasto++;
last = lasto;
if (args != null && lasto > args.length - 1)
throw new MissingFormatArgumentException(fs.toString());
fs.print((args == null ? null : args[lasto]), l);
break;

I'm using the following proguard rules.

-keep class zendesk.** { *; }
-keepnames class zendesk.** { *; }
-keepnames class okhttp3.internal.publicsuffix.PublicSuffixDatabase

I also checked all the rules on the following websites. Those weren't useful.
Minify
Proguard
I found some similar issues without answers on Zendesk. Do you have a suggestion?