Skip to content

"Fix the crash issue when loading the roman_semi_b.ttf font with ResourcesCompat.getFont" #752

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

Open
wants to merge 23 commits into
base: androidx-main
Choose a base branch
from

Conversation

simplepeng
Copy link
Contributor

Proposed Changes

  • fix:TypefaceCompatApi29Impl createFromResourcesFontFile
  • fix:TypefaceCompatApi26Impl createFromResourcesFontFile

Testing

Test: TypefaceCompatTest.testRomanSemiB()

@simplepeng
Copy link
Contributor Author

@@ -50,7 +50,8 @@ androidXMultiplatform {
sourceSets {
commonMain {
dependencies {
api(project(":lifecycle:lifecycle-runtime"))
// api(project(":lifecycle:lifecycle-runtime"))
Copy link
Contributor

Choose a reason for hiding this comment

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

unintended change?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If I don't modify this line of code, I won't be able to run any unit test methods in TypefaceCompatTest, and it will give the following error.

Could not determine the dependencies of task ':core:core:compileReleaseAndroidTestJavaWithJavac'.
> Could not resolve all dependencies for configuration ':core:core:releaseAndroidTestCompileClasspath'.
   > Could not select a variant of project :lifecycle:lifecycle-runtime that matches the consumer attributes.
      > Could not find lifecycle-runtime.aar (project :lifecycle:lifecycle-runtime).

Possible solution:
 - Declare repository providing the artifact, see the documentation at https://docs.gradle.org/current/userguide/declaring_repositories.html

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I will revert it and resubmit.

@simplepeng simplepeng requested a review from yigit January 22, 2025 03:36
@yigit
Copy link
Contributor

yigit commented Jan 22, 2025

thanks, i'm approving this to create the gerrit shadow so it can be reviewed by the owners.

Copy link
Contributor

@yigit yigit left a comment

Choose a reason for hiding this comment

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

approving to create the gerrit clone.

@yigit
Copy link
Contributor

yigit commented Jan 22, 2025

gerrit change:
https://android-review.googlesource.com/c/platform/frameworks/support/+/3462059

to address any future comments, you can still upload new PR versions and they'll be synced to that CL.

@simplepeng simplepeng requested a review from yigit February 12, 2025 08:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants