Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

java.util.UnknownFormatConversionException - Conversion = '$' #5637

Closed
seanlip opened this issue Jan 3, 2025 · 5 comments · Fixed by #5692
Closed

java.util.UnknownFormatConversionException - Conversion = '$' #5637

seanlip opened this issue Jan 3, 2025 · 5 comments · Fixed by #5692
Assignees
Labels
bug End user-perceivable behaviors which are not desirable. good first issue This item is good for new contributors to make their pull request. Impact: Low Low perceived user impact (e.g. edge cases). Work: Low Solution is clear and broken into good-first-issue-sized chunks.

Comments

@seanlip
Copy link
Member

seanlip commented Jan 3, 2025

Describe the bug

There is a new crash recorded in 0.14-beta-17f2ef3044. It has 11 crash events affecting 11 users. Here is the log:

 Caused by java.util.UnknownFormatConversionException: Conversion = '$'
       at java.util.Formatter$FormatSpecifier.conversion(Formatter.java:2781)
       at java.util.Formatter$FormatSpecifier.<init>(Formatter.java:2811)
       at java.util.Formatter$FormatSpecifierParser.<init>(Formatter.java:2624)
       at java.util.Formatter.parse(Formatter.java:2557)
       at java.util.Formatter.format(Formatter.java:2504)
       at java.util.Formatter.format(Formatter.java:2458)
       at java.lang.String.format(String.java:2814)
       at iW.E.b(SourceFile:79)
       at iW.E.a(SourceFile:73)
       at hO.j.a(SourceFile:38)
       at org.oppia.android.app.help.faq.p.a(SourceFile:35)
       at org.oppia.android.app.help.faq.p.a(SourceFile:2044)
       at org.oppia.android.app.help.faq.q.R_(SourceFile:1019)
       at eU.A.a(SourceFile:74)
       at org.oppia.android.app.help.faq.p.a(SourceFile:18)
       at hm.bL.g(SourceFile:116)
       at androidx.databinding.ViewDataBinding.h(SourceFile:3472)
       at androidx.databinding.ViewDataBinding$OnStartListener.onStart(SourceFile:1685)
       at java.lang.reflect.Method.invoke(Method.java)
       at androidx.lifecycle.c.a(SourceFile:216)
       at androidx.lifecycle.b.a(SourceFile:194)
       at androidx.lifecycle.b.a(SourceFile:185)
       at androidx.lifecycle.ReflectiveGenericLifecycleObserver.a(SourceFile:37)
       at androidx.lifecycle.x.a(SourceFile:354)
       at androidx.lifecycle.w.b(SourceFile:265)
       at androidx.lifecycle.w.c(SourceFile:307)
       at androidx.lifecycle.w.c(SourceFile:148)
       at androidx.lifecycle.w.a(SourceFile:134)
       at androidx.fragment.app.y.ak(SourceFile:3026)
       at androidx.fragment.app.aE.r(SourceFile:589)
       at androidx.fragment.app.aE.n(SourceFile:300)
       at androidx.fragment.app.aH.h(SourceFile:112)
       at androidx.fragment.app.ae.a(SourceFile:1647)
       at androidx.fragment.app.ae.e(SourceFile:3128)
       at androidx.fragment.app.ae.w(SourceFile:3079)
       at androidx.fragment.app.X.j(SourceFile:262)
       at androidx.fragment.app.FragmentActivity.onStart(SourceFile:510)
       at androidx.appcompat.app.AppCompatActivity.onStart(SourceFile:246)
       at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1339)
       at android.app.Activity.performStart(Activity.java:7403)
       at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3266)
       at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3411)
       at android.app.ActivityThread.-wrap12()
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1994)
       at android.os.Handler.dispatchMessage(Handler.java:108)
       at android.os.Looper.loop(Looper.java:166)
       at android.app.ActivityThread.main(ActivityThread.java:7529)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:245)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:921)
       

Steps To Reproduce

Not sure, this is filed based on a crashlytics report.

Expected Behavior

The error should not happen.

Screenshots/Videos

No response

What device/emulator are you using?

Huawei Y6 Prime 2018

Which Android version is your device/emulator running?

Android 8.0.0

Which version of the Oppia Android app are you using?

0.14-beta-17f2ef3044

Additional Context

No response

@seanlip seanlip added bug End user-perceivable behaviors which are not desirable. triage needed and removed triage needed labels Jan 3, 2025
@adhiamboperes adhiamboperes added Impact: Low Low perceived user impact (e.g. edge cases). Work: High It's not clear what the solution is. labels Feb 3, 2025
@adhiamboperes
Copy link
Collaborator

The errorjava.util.UnknownFormatConversionException: Conversion = '$'occurs when a String.format() method encounters an invalid format specifier—particularly, an unexpected $ symbol.

The %$ is not a valid format specifier, leading to the exception. I did a global search(ctrl + shift + F) for %$, and found the occurrance in string faq_answer_math_lessons in arabic contains this error. It should be corrected to %1$s

@adhiamboperes adhiamboperes added good first issue This item is good for new contributors to make their pull request. Work: Low Solution is clear and broken into good-first-issue-sized chunks. and removed Work: High It's not clear what the solution is. labels Feb 3, 2025
@aadityaverma2011
Copy link
Contributor

please assign this to me

@TanishMoral11
Copy link
Collaborator

Assigned this issue to you @aadityaverma2011 .

@aadityaverma2011
Copy link
Contributor

Assigned this issue to you @aadityaverma2011 .

I have raised a PR regarding the issue . please check it out!

@aadityaverma2011
Copy link
Contributor

@TanishMoral11 pls review the pull request

adhiamboperes added a commit that referenced this issue Feb 10, 2025
## Explanation


- Fixes #5637 java.util.UnknownFormatConversionException: Conversion =
'$' error caused by an invalid format specifier (%$) in the Arabic
translation of the FAQ answer about math lessons. The incorrect format
specifier is replaced with the correct "%1$s" format. Changes were done
in the strings.xml file only.


## Essential Checklist
<!-- Please tick the relevant boxes by putting an "x" in them. -->
- [x] The PR title and explanation each start with "Fix #bugnum: " (If
this PR fixes part of an issue, prefix the title with "Fix part of
#bugnum: ...".)
- [x] Any changes to
[scripts/assets](https://github.com/oppia/oppia-android/tree/develop/scripts/assets)
files have their rationale included in the PR explanation.
- [x] The PR follows the [style
guide](https://github.com/oppia/oppia-android/wiki/Coding-style-guide).
- [x] The PR does not contain any unnecessary code changes from Android
Studio
([reference](https://github.com/oppia/oppia-android/wiki/Guidance-on-submitting-a-PR#undo-unnecessary-changes)).
- [x] The PR is made from a branch that's **not** called "develop" and
is up-to-date with "develop".
- [x] The PR is **assigned** to the appropriate reviewers
([reference](https://github.com/oppia/oppia-android/wiki/Guidance-on-submitting-a-PR#clarification-regarding-assignees-and-reviewers-section)).

Co-authored-by: Adhiambo Peres <59600948+adhiamboperes@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug End user-perceivable behaviors which are not desirable. good first issue This item is good for new contributors to make their pull request. Impact: Low Low perceived user impact (e.g. edge cases). Work: Low Solution is clear and broken into good-first-issue-sized chunks.
Development

Successfully merging a pull request may close this issue.

4 participants