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

[RNMobile] Avoid excluding WordPress-Android-Utils module in demo app #49375

Merged
merged 1 commit into from
Mar 29, 2023

Conversation

fluiddot
Copy link
Contributor

@fluiddot fluiddot commented Mar 27, 2023

What?

Avoid excluding WordPress-Android-Utils module in the demo app by updating the Android build configuration.

Why?

This PR addresses a crash generated in the demo app when inserting a Quote block from the inserter menu.

The crash is produced due to invoking the AppLog class from ReactAztecText (reference). Based on the stack trace, this class is not included in the build and the app throws a java.lang.NoClassDefFoundError exception.

    Process: com.gutenberg, PID: 4968
    java.lang.NoClassDefFoundError: Failed resolution of: Lorg/wordpress/android/util/AppLog$T;
        at org.wordpress.mobile.ReactNativeAztec.ReactAztecText$5.run(ReactAztecText.java:220)
        at android.os.Handler.handleCallback(Handler.java:942)
        at android.os.Handler.dispatchMessage(Handler.java:99)
        at android.os.Looper.loopOnce(Looper.java:226)
        at android.os.Looper.loop(Looper.java:313)
        at android.app.ActivityThread.main(ActivityThread.java:8741)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:571)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1067)
     Caused by: java.lang.ClassNotFoundException: Didn't find class "org.wordpress.android.util.AppLog$T" on path: DexPathList

How?

The WordPress-Android-Utils module was excluded in the Android build configuration (reference), so the fix mainly implied removing the exclusion in order to incorporate that module.

Testing Instructions

  1. Build the demo app.
    NOTE: When using Android Studio, before building the demo app, sync the project with Gradle files.
  2. Tap ➕ button to open the inserter menu.
  3. Tap on the Quote block.
  4. Observe that the Quote block is inserted.
  5. Observe that the app doesn't crash after the block insertion.

Testing Instructions for Keyboard

N/A

Screenshots or screencast

N/A

@fluiddot fluiddot added the Mobile App - i.e. Android or iOS Native mobile impl of the block editor. (Note: used in scripts, ping mobile folks to change) label Mar 27, 2023
@fluiddot fluiddot self-assigned this Mar 27, 2023
@geriux geriux self-requested a review March 28, 2023 10:48
Copy link
Member

@derekblank derekblank left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! I was able to follow all of the testing instructions successfully. 🚀

@fluiddot fluiddot changed the title Avoid excluding WordPress-Android-Utils module in demo app [RNMobile] Avoid excluding WordPress-Android-Utils module in demo app Mar 29, 2023
@fluiddot fluiddot merged commit a0949f5 into trunk Mar 29, 2023
@fluiddot fluiddot deleted the rnmobile/fix-android-app-log-crash branch March 29, 2023 08:24
@github-actions github-actions bot added this to the Gutenberg 15.5 milestone Mar 29, 2023
@ryanwelcher ryanwelcher added the [Type] Bug An existing feature does not function as intended label Mar 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Mobile App - i.e. Android or iOS Native mobile impl of the block editor. (Note: used in scripts, ping mobile folks to change) [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants