Skip to content

Commit 2e02f76

Browse files
swansontecsamholmes
authored andcommitted
Hack around Android freeze
1 parent 8ed2302 commit 2e02f76

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

android/settings.gradle

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,17 @@ includeBuild('../node_modules/@react-native/gradle-plugin')
2020
expoAutolinking.useExpoModules()
2121
expoAutolinking.useExpoVersionCatalog()
2222
includeBuild(expoAutolinking.reactNativeGradlePlugin)
23+
24+
// Hack around Android freeze:
25+
includeBuild('../node_modules/react-native') {
26+
dependencySubstitution {
27+
substitute(module("com.facebook.react:react-android"))
28+
.using(project(":packages:react-native:ReactAndroid"))
29+
substitute(module("com.facebook.react:react-native"))
30+
.using(project(":packages:react-native:ReactAndroid"))
31+
substitute(module("com.facebook.react:hermes-android"))
32+
.using(project(":packages:react-native:ReactAndroid:hermes-engine"))
33+
substitute(module("com.facebook.react:hermes-engine"))
34+
.using(project(":packages:react-native:ReactAndroid:hermes-engine"))
35+
}
36+
}

patches/react-native+0.79.2.patch

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
diff --git a/node_modules/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/TextAttributeProps.java b/node_modules/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/TextAttributeProps.java
2+
index ae8bb00..a84c31b 100644
3+
--- a/node_modules/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/TextAttributeProps.java
4+
+++ b/node_modules/react-native/ReactAndroid/src/main/java/com/facebook/react/views/text/TextAttributeProps.java
5+
@@ -397,8 +397,7 @@ public class TextAttributeProps {
6+
: PixelUtil.toPixelFromDIP(mLetterSpacingInput);
7+
8+
if (mFontSize <= 0) {
9+
- throw new IllegalArgumentException(
10+
- "FontSize should be a positive value. Current value: " + mFontSize);
11+
+ return 0;
12+
}
13+
// `letterSpacingPixels` and `mFontSize` are both in pixels,
14+
// yielding an accurate em value.

0 commit comments

Comments
 (0)