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

App crashes when trying to access In-lesson options #4712

Closed
KolliAnitha opened this issue Nov 13, 2022 · 6 comments · Fixed by #4731
Closed

App crashes when trying to access In-lesson options #4712

KolliAnitha opened this issue Nov 13, 2022 · 6 comments · Fixed by #4731
Assignees
Labels
Impact: Medium Moderate perceived user impact (non-blocking bugs and general improvements).

Comments

@KolliAnitha
Copy link

Describe the bug
In-Lesson options are not working
To Reproduce
Steps to reproduce the behavior:

  1. Login to Oppia App
  2. Click on any Topic say 'Place Values'
  3. Open 1st Chapter 'What are the Place Values'
  4. Click on more options
  5. See error

Expected behavior
Reading text size and Default Audio options must be seen

Actual behavior:
App crashes or reopens the lesson page

Environment

  • Device/emulator being used: Infinix SMART 5
  • Android or SDK version (e.g. Android 5 or SDK 21): Android version 11
  • App version (you can get this through system app settings or via the admin controls menu in-app): 0.10-beta-5e64fae55e
app.crash.mp4
@KolliAnitha KolliAnitha added issue_type_bug Impact: Medium Moderate perceived user impact (non-blocking bugs and general improvements). labels Nov 13, 2022
@KolliAnitha KolliAnitha changed the title In-lesson options are not working App crashes when trying to access In-lesson options Nov 13, 2022
@iampradeep-hr
Copy link

Can I work on this please ?

@BenHenning
Copy link
Member

Thanks @iampradeep-hr. While this would normally be a great issue to start working on, it's time sensitive since it's blocking a real that's about to go out so unfortunately it may not be the best problem to work on right now. I suggest looking at other issues which aren't part of a release milestone (which you can see on the right side of the issue's details under "Milestone").

@BenHenning
Copy link
Member

Okay, so it seems this only repros on Proguarded-builds. Stack trace:

2022-11-14 17:58:50.408 12020-12020/org.oppia.android E/AndroidRuntime: FATAL EXCEPTION: main
    Process: org.oppia.android, PID: 12020
    android.view.InflateException: Binary XML file line #41: Could not inflate Behavior subclass com.google.android.material.bottomsheet.BottomSheetBehavior
    Caused by: java.lang.RuntimeException: Could not inflate Behavior subclass com.google.android.material.bottomsheet.BottomSheetBehavior
        at androidx.coordinatorlayout.widget.CoordinatorLayout.a(SourceFile:649)
        at androidx.coordinatorlayout.widget.f.<init>(SourceFile:2896)
        at androidx.coordinatorlayout.widget.CoordinatorLayout.generateLayoutParams(SourceFile:29740)
        at android.view.LayoutInflater.rInflate(LayoutInflater.java:865)
        at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:824)
        at android.view.LayoutInflater.rInflate(LayoutInflater.java:866)
        at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:824)
        at android.view.LayoutInflater.inflate(LayoutInflater.java:515)
        at android.view.LayoutInflater.inflate(LayoutInflater.java:423)
        at android.view.LayoutInflater.inflate(LayoutInflater.java:374)
        at android.view.View.inflate(View.java:23239)
        at bw.j.e(SourceFile:188)
        at bw.j.a(SourceFile:200)
        at bw.j.setContentView(SourceFile:93)
        at androidx.fragment.app.d.c(SourceFile:488)
        at androidx.fragment.app.h.i(SourceFile:2717)
        at androidx.fragment.app.W.e(SourceFile:336)
        at androidx.fragment.app.F.a(SourceFile:1186)
        at androidx.fragment.app.F.d(SourceFile:1354)
        at androidx.fragment.app.F.e(SourceFile:1432)
        at androidx.fragment.app.F.a(SourceFile:1495)
        at androidx.fragment.app.a.f(SourceFile:447)
        at androidx.fragment.app.F.b(SourceFile:2167)
        at androidx.fragment.app.F.a(SourceFile:1990)
        at androidx.fragment.app.F.b(SourceFile:1945)
        at androidx.fragment.app.F.b(SourceFile:1816)
        at androidx.fragment.app.a.d(SourceFile:297)
        at androidx.fragment.app.d.b(SourceFile:212)
        at org.oppia.android.app.player.exploration.o.onClick(SourceFile:105)
        at android.view.View.performClick(View.java:6294)
        at android.view.View$PerformClick.run(View.java:24770)
        at android.os.Handler.handleCallback(Handler.java:790)
        at android.os.Handler.dispatchMessage(Handler.java:99)
        at android.os.Looper.loop(Looper.java:164)
        at android.app.ActivityThread.main(ActivityThread.java:6494)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
     Caused by: java.lang.ClassNotFoundException: com.google.android.material.bottomsheet.BottomSheetBehavior
        at java.lang.Class.classForName(Native Method)
        at java.lang.Class.forName(Class.java:453)
        at androidx.coordinatorlayout.widget.CoordinatorLayout.a(SourceFile:642)
        at androidx.coordinatorlayout.widget.f.<init>(SourceFile:2896) 
        at androidx.coordinatorlayout.widget.CoordinatorLayout.generateLayoutParams(SourceFile:29740) 
        at android.view.LayoutInflater.rInflate(LayoutInflater.java:865) 
        at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:824) 
        at android.view.LayoutInflater.rInflate(LayoutInflater.java:866) 
        at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:824) 
        at android.view.LayoutInflater.inflate(LayoutInflater.java:515) 
        at android.view.LayoutInflater.inflate(LayoutInflater.java:423) 
        at android.view.LayoutInflater.inflate(LayoutInflater.java:374) 
        at android.view.View.inflate(View.java:23239) 
        at bw.j.e(SourceFile:188) 
        at bw.j.a(SourceFile:200) 
        at bw.j.setContentView(SourceFile:93) 
        at androidx.fragment.app.d.c(SourceFile:488) 
        at androidx.fragment.app.h.i(SourceFile:2717) 
        at androidx.fragment.app.W.e(SourceFile:336) 
        at androidx.fragment.app.F.a(SourceFile:1186) 
        at androidx.fragment.app.F.d(SourceFile:1354) 
        at androidx.fragment.app.F.e(SourceFile:1432) 
        at androidx.fragment.app.F.a(SourceFile:1495) 
        at androidx.fragment.app.a.f(SourceFile:447) 
        at androidx.fragment.app.F.b(SourceFile:2167) 
        at androidx.fragment.app.F.a(SourceFile:1990) 
        at androidx.fragment.app.F.b(SourceFile:1945) 
        at androidx.fragment.app.F.b(SourceFile:1816) 
        at androidx.fragment.app.a.d(SourceFile:297) 
        at androidx.fragment.app.d.b(SourceFile:212) 
        at org.oppia.android.app.player.exploration.o.onClick(SourceFile:105) 
        at android.view.View.performClick(View.java:6294) 
        at android.view.View$PerformClick.run(View.java:24770) 
        at android.os.Handler.handleCallback(Handler.java:790) 
        at android.os.Handler.dispatchMessage(Handler.java:99) 
        at android.os.Looper.loop(Looper.java:164) 
        at android.app.ActivityThread.main(ActivityThread.java:6494) 
        at java.lang.reflect.Method.invoke(Native Method) 
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438) 
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807) 
     Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.android.material.bottomsheet.BottomSheetBehavior" on path: DexPathList[[zip file "/data/app/org.oppia.android-X-b_Kfh41XvXCJn0B3ERWQ==/base.apk", zip file "/data/app/org.oppia.android-X-b_Kfh41XvXCJn0B3ERWQ==/split_config.xxhdpi.apk"],nativeLibraryDirectories=[/data/app/org.oppia.android-X-b_Kfh41XvXCJn0B3ERWQ==/lib/arm64, /system/lib64, /vendor/lib64]]
        at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:125)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
        at java.lang.Class.classForName(Native Method) 
        at java.lang.Class.forName(Class.java:453) 
        at androidx.coordinatorlayout.widget.CoordinatorLayout.a(SourceFile:642) 
        at androidx.coordinatorlayout.widget.f.<init>(SourceFile:2896) 
        at androidx.coordinatorlayout.widget.CoordinatorLayout.generateLayoutParams(SourceFile:29740) 
        at android.view.LayoutInflater.rInflate(LayoutInflater.java:865) 
        at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:824) 
        at android.view.LayoutInflater.rInflate(LayoutInflater.java:866) 
        at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:824) 
        at android.view.LayoutInflater.inflate(LayoutInflater.java:515) 
        at android.view.LayoutInflater.inflate(LayoutInflater.java:423) 
        at android.view.LayoutInflater.inflate(LayoutInflater.java:374) 
        at android.view.View.inflate(View.java:23239) 
        at bw.j.e(SourceFile:188) 
        at bw.j.a(SourceFile:200) 
        at bw.j.setContentView(SourceFile:93) 
        at androidx.fragment.app.d.c(SourceFile:488) 
        at androidx.fragment.app.h.i(SourceFile:2717) 
        at androidx.fragment.app.W.e(SourceFile:336) 
        at androidx.fragment.app.F.a(SourceFile:1186) 
        at androidx.fragment.app.F.d(SourceFile:1354) 
        at androidx.fragment.app.F.e(SourceFile:1432) 
        at androidx.fragment.app.F.a(SourceFile:1495) 
        at androidx.fragment.app.a.f(SourceFile:447) 
        at androidx.fragment.app.F.b(SourceFile:2167) 
        at androidx.fragment.app.F.a(SourceFile:1990) 
        at androidx.fragment.app.F.b(SourceFile:1945) 
        at androidx.fragment.app.F.b(SourceFile:1816) 
        at androidx.fragment.app.a.d(SourceFile:297) 
        at androidx.fragment.app.d.b(SourceFile:212) 
        at org.oppia.android.app.player.exploration.o.onClick(SourceFile:105) 
        at android.view.View.performClick(View.java:6294) 
        at android.view.View$PerformClick.run(View.java:24770) 
        at android.os.Handler.handleCallback(Handler.java:790) 
        at android.os.Handler.dispatchMessage(Handler.java:99) 
        at android.os.Looper.loop(Looper.java:164) 
        at android.app.ActivityThread.main(ActivityThread.java:6494) 
        at java.lang.reflect.Method.invoke(Native Method) 
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438) 
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807) 
    	Suppressed: java.io.IOException: No original dex files found for dex location /data/app/org.oppia.android-X-b_Kfh41XvXCJn0B3ERWQ==/split_config.xxhdpi.apk
        at dalvik.system.DexFile.openDexFileNative(Native Method)
        at dalvik.system.DexFile.openDexFile(DexFile.java:353)
        at dalvik.system.DexFile.<init>(DexFile.java:100)
        at dalvik.system.DexFile.<init>(DexFile.java:74)
        at dalvik.system.DexPathList.loadDexFile(DexPathList.java:374)
        at dalvik.system.DexPathList.makeDexElements(DexPathList.java:337)
        at dalvik.system.DexPathList.<init>(DexPathList.java:157)
        at dalvik.system.BaseDexClassLoader.<init>(BaseDexClassLoader.java:65)
2022-11-14 17:58:50.408 12020-12020/org.oppia.android E/AndroidRuntime:     at dalvik.system.PathClassLoader.<init>(PathClassLoader.java:64)
        at com.android.internal.os.ClassLoaderFactory.createClassLoader(ClassLoaderFactory.java:73)
        at com.android.internal.os.ClassLoaderFactory.createClassLoader(ClassLoaderFactory.java:88)
        at android.app.ApplicationLoaders.getClassLoader(ApplicationLoaders.java:69)
        at android.app.ApplicationLoaders.getClassLoader(ApplicationLoaders.java:35)
        at android.app.LoadedApk.createOrUpdateClassLoaderLocked(LoadedApk.java:693)
        at android.app.LoadedApk.getClassLoader(LoadedApk.java:727)
        at android.app.LoadedApk.getResources(LoadedApk.java:954)
        at android.app.ContextImpl.createAppContext(ContextImpl.java:2270)
        at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5639)
        at android.app.ActivityThread.-wrap1(Unknown Source:0)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1656)
        at android.os.Handler.dispatchMessage(Handler.java:106)
        		... 5 more

I think this is the same issue the monkey tests found on our pre-launch report. It's definitely tied to the new options bottom sheet--I suspect something is relying on a direct name being present & Proguard is obfuscating it.

@BenHenning
Copy link
Member

@BenHenning
Copy link
Member

Confirming that keeping subclasses of androidx.coordinatorlayout.widget.CoordinatorLayout/Behavior from being renamed fixes the problem (and ensuring subclass constructors are never removed). Unfortunately, we can't test this without end-to-end tests, so we'll need rely on manual testing for verification & continued regression testing.

BenHenning added a commit that referenced this issue Nov 17, 2022
BenHenning added a commit that referenced this issue Nov 17, 2022
…ed during binary optimizations (#4731)

## Explanation
Fixes #4712

Proguard was renaming CoordinatorLayout behaviors and removing
implementation constructors, where both can be referenced via reflection
in CoordinatorLayout. We haven't run into this issue before since it
seems the new bottom navigation component introduced in #4482 is the
first time we actually started using CoordinatorLayout behaviors.

Note that this is inherently difficult to test as it requires verifying
runtime functionality in a Proguard-optimized build. Hence, it's only
testable with end-to-end tests (and our own end-to-end tests currently
are manual tests) so no new unit/integration tests are being added.

Note also that this PR will be cherry-picked for the upcoming beta MR2
release.

## Essential Checklist
- [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)).

## For UI-specific PRs only
This doesn't seem particularly valuable to fill out here--the video
would just show the options menu opening as it should (and does for
developer builds). I've verified it works locally, and #4712 will
require reverifying once the PR is merged,
BenHenning added a commit that referenced this issue Nov 18, 2022
…ed during binary optimizations (#4731)

## Explanation
Fixes #4712

Proguard was renaming CoordinatorLayout behaviors and removing
implementation constructors, where both can be referenced via reflection
in CoordinatorLayout. We haven't run into this issue before since it
seems the new bottom navigation component introduced in #4482 is the
first time we actually started using CoordinatorLayout behaviors.

Note that this is inherently difficult to test as it requires verifying
runtime functionality in a Proguard-optimized build. Hence, it's only
testable with end-to-end tests (and our own end-to-end tests currently
are manual tests) so no new unit/integration tests are being added.

Note also that this PR will be cherry-picked for the upcoming beta MR2
release.

## Essential Checklist
- [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)).

## For UI-specific PRs only
This doesn't seem particularly valuable to fill out here--the video
would just show the options menu opening as it should (and does for
developer builds). I've verified it works locally, and #4712 will
require reverifying once the PR is merged,
@KolliAnitha
Copy link
Author

Layout of the Options has changed but it is working fine now.
Screenshot (Nov 24, 2022 11_15_53 AM)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Impact: Medium Moderate perceived user impact (non-blocking bugs and general improvements).
Projects
None yet
3 participants