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

[BUG]: App crashes in production builds #5284

Closed
BenHenning opened this issue Dec 23, 2023 · 2 comments · Fixed by #5287 or #5288
Closed

[BUG]: App crashes in production builds #5284

BenHenning opened this issue Dec 23, 2023 · 2 comments · Fixed by #5287 or #5288
Assignees
Labels
bug End user-perceivable behaviors which are not desirable. Impact: High High perceived user impact (breaks a critical feature or blocks a release). Work: Low Solution is clear and broken into good-first-issue-sized chunks.

Comments

@BenHenning
Copy link
Sponsor Member

Describe the bug

When trying to navigate to the home screen (or likely any activity with a navigation drawer) the app will crash on production builds (alpha, beta, GA).

Steps To Reproduce

  1. Build & install a production version of the app, e.g.: bazel run //:install_oppia_beta.
  2. Open the app & navigate through the profile screen.
  3. Attempt to open the home screen (e.g. by selecting a profile).

Expected Behavior

The app should not crash.

Screenshots/Videos

No response

What device/emulator are you using?

Pixel XL

Which Android version is your device/emulator running?

SDK 33

Which version of the Oppia Android app are you using?

0.11-beta-74f4bafc71

Additional Context

From investigation, it seems that this was caused by #5191.

@BenHenning BenHenning added bug End user-perceivable behaviors which are not desirable. triage needed labels Dec 23, 2023
@BenHenning BenHenning self-assigned this Dec 23, 2023
@BenHenning BenHenning added the Impact: High High perceived user impact (breaks a critical feature or blocks a release). label Dec 23, 2023
@BenHenning
Copy link
Sponsor Member Author

NB: This is blocking us from launching beta 0.12 of the app. I'm aiming to revert the PR that caused it, plus #5276 since it follows that PR.

@BenHenning
Copy link
Sponsor Member Author

Forgot to attach the stack trace in the original posting:

21:43:22.344  E  FATAL EXCEPTION: main
                 Process: org.oppia.android, PID: 12793
                 java.lang.RuntimeException: Unable to start activity ComponentInfo{org.oppia.android/org.oppia.android.app.home.HomeActivity}: android.view.InflateException: Binary XML file line #36 in org.oppia.android:layout/home_activity: Binary XML file line #36 in org.oppia.android:layout/home_activity: Error inflating class androidx.fragment.app.FragmentContainerView
                  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3635)
                  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3792)
                  at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:103)
                  at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
                  at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
                  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2210)
                  at android.os.Handler.dispatchMessage(Handler.java:106)
                  at android.os.Looper.loopOnce(Looper.java:201)
                  at android.os.Looper.loop(Looper.java:288)
                  at android.app.ActivityThread.main(ActivityThread.java:7839)
                  at java.lang.reflect.Method.invoke(Native Method)
                  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
                  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003)
                 Caused by: android.view.InflateException: Binary XML file line #36 in org.oppia.android:layout/home_activity: Binary XML file line #36 in org.oppia.android:layout/home_activity: Error inflating class androidx.fragment.app.FragmentContainerView
                 Caused by: android.view.InflateException: Binary XML file line #36 in org.oppia.android:layout/home_activity: Error inflating class androidx.fragment.app.FragmentContainerView
                 Caused by: androidx.fragment.app.m: Unable to instantiate fragment org.oppia.android.app.drawer.NavigationDrawerFragment: make sure class name exists
                  at androidx.fragment.app.A.b(SourceFile:91)
                  at androidx.fragment.app.h.a(SourceFile:546)
                  at androidx.fragment.app.I.c(SourceFile:1057)
                  at androidx.fragment.app.FragmentContainerView.<init>(SourceFile:161)
                  at androidx.fragment.app.C.onCreateView(SourceFile:51)
                  at androidx.fragment.app.z.a(SourceFile:135)
                  at androidx.fragment.app.FragmentActivity.a(SourceFile:356)
                  at androidx.fragment.app.FragmentActivity.onCreateView(SourceFile:335)
                  at android.view.LayoutInflater.tryCreateView(LayoutInflater.java:1073)
                  at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:1001)
                  at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:965)
                  at android.view.LayoutInflater.rInflate(LayoutInflater.java:1127)
                  at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:1088)
                  at android.view.LayoutInflater.inflate(LayoutInflater.java:686)
                  at android.view.LayoutInflater.inflate(LayoutInflater.java:538)
                  at android.view.LayoutInflater.inflate(LayoutInflater.java:485)
                  at androidx.appcompat.app.AppCompatDelegateImpl.c(SourceFile:696)
                  at androidx.appcompat.app.AppCompatActivity.setContentView(SourceFile:170)
                  at org.oppia.android.app.home.b.a(SourceFile:22)
                  at org.oppia.android.app.home.HomeActivity.onCreate(SourceFile:55)
                  at android.app.Activity.performCreate(Activity.java:8051)
                  at android.app.Activity.performCreate(Activity.java:8031)
                  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1329)
                  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3608)
                  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3792)
                  at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:103)
                  at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
                  at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
                  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2210)
                  at android.os.Handler.dispatchMessage(Handler.java:106)
                  at android.os.Looper.loopOnce(Looper.java:201)
21:43:22.347  E   at android.os.Looper.loop(Looper.java:288)
                  at android.app.ActivityThread.main(ActivityThread.java:7839)
                  at java.lang.reflect.Method.invoke(Native Method)
                  at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
                  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003)
                 Caused by: java.lang.ClassNotFoundException: org.oppia.android.app.drawer.NavigationDrawerFragment
                  at java.lang.Class.classForName(Native Method)
                  at java.lang.Class.forName(Class.java:454)
                  at androidx.fragment.app.A.d(SourceFile:47)
                  at androidx.fragment.app.A.b(SourceFile:88)
                  ... 35 more
                 Caused by: java.lang.ClassNotFoundException: Didn't find class "org.oppia.android.app.drawer.NavigationDrawerFragment" on path: DexPathList[[zip file "/data/app/~~qoVmikBh3VVc0Yqh3LrF0Q==/org.oppia.android-awsg1iYE_iAW-8bWxLRdHw==/base.apk", zip file "/data/app/~~qoVmikBh3VVc0Yqh3LrF0Q==/org.oppia.android-awsg1iYE_iAW-8bWxLRdHw==/split_config.xxxhdpi.apk"],nativeLibraryDirectories=[/data/app/~~qoVmikBh3VVc0Yqh3LrF0Q==/org.oppia.android-awsg1iYE_iAW-8bWxLRdHw==/lib/x86_64, /system/lib64, /system_ext/lib64]]
                  at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:218)
                  at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
                  at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
                  ... 39 more
                  Suppressed: java.io.IOException: Failed to open dex files from /data/app/~~qoVmikBh3VVc0Yqh3LrF0Q==/org.oppia.android-awsg1iYE_iAW-8bWxLRdHw==/split_config.xxxhdpi.apk because: Entry not found
                    at dalvik.system.DexFile.openDexFileNative(Native Method)
                    at dalvik.system.DexFile.openDexFile(DexFile.java:371)
                    at dalvik.system.DexFile.<init>(DexFile.java:113)
                    at dalvik.system.DexFile.<init>(DexFile.java:86)
                    at dalvik.system.DexPathList.loadDexFile(DexPathList.java:438)
                    at dalvik.system.DexPathList.makeDexElements(DexPathList.java:397)
                    at dalvik.system.DexPathList.<init>(DexPathList.java:166)
                    at dalvik.system.BaseDexClassLoader.<init>(BaseDexClassLoader.java:134)
                    at dalvik.system.BaseDexClassLoader.<init>(BaseDexClassLoader.java:109)
                    at dalvik.system.PathClassLoader.<init>(PathClassLoader.java:107)
                    at com.android.internal.os.ClassLoaderFactory.createClassLoader(ClassLoaderFactory.java:88)
                    at com.android.internal.os.ClassLoaderFactory.createClassLoader(ClassLoaderFactory.java:117)
                    at android.app.ApplicationLoaders.getClassLoader(ApplicationLoaders.java:123)
                    at android.app.ApplicationLoaders.getClassLoaderWithSharedLibraries(ApplicationLoaders.java:60)
                    at android.app.LoadedApk.createOrUpdateClassLoaderLocked(LoadedApk.java:971)
                    at android.app.LoadedApk.getClassLoader(LoadedApk.java:1062)
                    at android.app.LoadedApk.getResources(LoadedApk.java:1310)
                    at android.app.ContextImpl.createAppContext(ContextImpl.java:3012)
                    at android.app.ContextImpl.createAppContext(ContextImpl.java:3004)
                    at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6623)
                    at android.app.ActivityThread.access$1500(ActivityThread.java:247)
                    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2053)
                    ... 7 more

BenHenning added a commit that referenced this issue Dec 23, 2023
… binding already initialized" (#5285)

Fixes part of #5284

Reverts #5276 as part of preparing to revert #5191.

Note that this reintroduces #5266 but that should stay fixed once #5191
is reverted.
@adhiamboperes adhiamboperes added Work: Low Solution is clear and broken into good-first-issue-sized chunks. and removed triage needed labels Dec 23, 2023
BenHenning pushed a commit that referenced this issue Dec 23, 2023
…omView + FragmentTagUsage" (#5287)

Fix #5284: Reverts #5191. See issue for details.

This should be a clean revert.
BenHenning added a commit that referenced this issue Dec 23, 2023
… binding already initialized" (#5285)

Fixes part of #5284

Reverts #5276 as part of preparing to revert #5191.

Note that this reintroduces #5266 but that should stay fixed once #5191
is reverted.
BenHenning pushed a commit that referenced this issue Dec 23, 2023
…omView + FragmentTagUsage" (#5287)

Fix #5284: Reverts #5191. See issue for details.

This should be a clean revert.
BenHenning added a commit that referenced this issue Dec 23, 2023
## Explanation
This fixes #5284 for the upcoming 0.12 release by cherry-picking #5285
and #5287 into the release branch.

Both cherry-picks happened cleanly, so the review is expected to be
straightforward.

## Essential Checklist
- [ ] ~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
See corresponding cherry-picks and original PRs for references on what
reverted behavior is being checked in within this PR.

---------

Co-authored-by: Adhiambo Peres <[email protected]>
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. Impact: High High perceived user impact (breaks a critical feature or blocks a release). Work: Low Solution is clear and broken into good-first-issue-sized chunks.
2 participants