Skip to content

Commit

Permalink
안드로이드 React Native 버전 업 이슈 대응 (#109)
Browse files Browse the repository at this point in the history
  • Loading branch information
ddarkr authored Jun 27, 2022
1 parent f73bf73 commit ab57489
Show file tree
Hide file tree
Showing 9 changed files with 114 additions and 25 deletions.
1 change: 1 addition & 0 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ buildscript {
compileSdkVersion = 31
targetSdkVersion = 31
ndkVersion = "21.4.7075529"
kotlinVersion = "1.6.21"
}
repositories {
google()
Expand Down
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"version": "1.1.0",
"private": true,
"scripts": {
"postinstall": "patch-package",
"android": "react-native run-android",
"ios": "react-native run-ios",
"start": "react-native start",
Expand All @@ -16,6 +17,8 @@
"@react-navigation/stack": "^6.2.1",
"lottie-ios": "3.2.3",
"lottie-react-native": "^5.1.3",
"patch-package": "^6.4.7",
"postinstall-postinstall": "^2.1.0",
"react": "18.0.0",
"react-native": "0.69.0",
"react-native-gesture-handler": "^2.4.2",
Expand Down
17 changes: 17 additions & 0 deletions patches/react-native-reanimated+2.8.0.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
diff --git a/node_modules/react-native-reanimated/android/build.gradle b/node_modules/react-native-reanimated/android/build.gradle
index cc460da..882402f 100644
--- a/node_modules/react-native-reanimated/android/build.gradle
+++ b/node_modules/react-native-reanimated/android/build.gradle
@@ -149,10 +149,10 @@ def detectAAR(minor, engine) {
println "\n\n\n"
println "****************************************************************************************"
println "\n\n\n"
- println "WARNING reanimated - no version-specific reanimated AAR for react-native version $rnMinorVersion found."
+ println "WARNING reanimated - no version-specific reanimated AAR for react-native version $rnMinorVersionCopy found."
println "Falling back to AAR for react-native version $rnMinorVersionCopy."
println "The react-native JSI interface is not ABI-safe yet, this may result in crashes."
- println "Please post a pull request to implement support for react-native version $rnMinorVersion to the reanimated repo."
+ println "Please post a pull request to implement support for react-native version $rnMinorVersionCopy to the reanimated repo."
println "Thanks!"
println "\n\n\n"
println "****************************************************************************************"
5 changes: 1 addition & 4 deletions src/components/ShareHandler.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -143,10 +143,7 @@ export const ShareHandler = ({ data, mimeType, handleClose, onMessage, onLoadEnd
<View style={{ flex: 1, backgroundColor: theme.color.background }}>
<WebView
uri={getAddContentURI()}
customRef={ref => {
if (!ref) return;
webViewRef.current = ref;
}}
customRef={webViewRef}
onMessage={onReceiveMessage}
onNavigate={handleNavigateChange}
onLoadEnd={handleLoadEnd}
Expand Down
16 changes: 6 additions & 10 deletions src/components/WebView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import theme from '~/styles/theme';
interface WebViewProps {
uri: string;
// eslint-disable-next-line @typescript-eslint/ban-types
customRef?: (ref: any) => void | undefined;
customRef?: React.MutableRefObject<RnWebView<{}> | undefined>;
onMessage?: (event: WebViewMessageEvent) => void;
onNavigate?: (event: WebViewNavigation) => boolean;
onLoadEnd?: () => void;
Expand All @@ -23,7 +23,7 @@ export default function WebView({
}: WebViewProps) {
const [isError, setIsError] = useState(false);
// eslint-disable-next-line react-hooks/rules-of-hooks
const webViewRef = useRef<RnWebView>();
const webViewRef = customRef ?? useRef<RnWebView>();
const fadeAnimationRef = useRef(new Animated.Value(0));

const animationConfig: Animated.TimingAnimationConfig = useMemo(() => {
Expand Down Expand Up @@ -97,14 +97,10 @@ export default function WebView({
}}
>
<RnWebView
ref={
customRef
? customRef
: ref => {
if (!ref) return;
webViewRef.current = ref;
}
}
ref={ref => {
if (!ref) return;
webViewRef.current = ref;
}}
source={{ uri }}
bounces={false}
applicationNameForUserAgent={'YgtangApp/1.0'}
Expand Down
8 changes: 6 additions & 2 deletions src/components/YgtStatusBar.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
import React from 'react';
import { StatusBar } from 'react-native';

export function YgtStatusBar() {
return <StatusBar backgroundColor="#D6DBDC" barStyle={'dark-content'} />;
interface StatusBarProps {
bgColor?: string;
}

export function YgtStatusBar({ bgColor = '#D6DBDC' }: StatusBarProps) {
return <StatusBar backgroundColor={bgColor} barStyle={'dark-content'} />;
}
5 changes: 1 addition & 4 deletions src/screens/HomeScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,7 @@ export default function HomeScreen() {
style={{ flex: 1, backgroundColor: theme.color.background }}
>
<WebView
customRef={ref => {
if (!ref) return;
webViewRef.current = ref;
}}
customRef={webViewRef}
uri={BASE_URI}
onLoadEnd={handleLoadEnd}
onMessage={onReceiveMessage}
Expand Down
2 changes: 2 additions & 0 deletions src/screens/SplashScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { StackNavigationProp } from '@react-navigation/stack';
import LottieView from 'lottie-react-native';
import { StyleSheet, View } from 'react-native';

import { YgtStatusBar } from '~/components/YgtStatusBar';
import { MainNavigatorParamsType } from '~/navigation/MainNavigator';
import theme from '~/styles/theme';

Expand All @@ -17,6 +18,7 @@ export default function SplashScreen({ navigation: { replace } }: SplashScreenPr

return (
<View style={styles.root}>
<YgtStatusBar bgColor={theme.color.gray02} />
<LottieView
source={require('../assets/ygt-splash.json')}
autoPlay
Expand Down
82 changes: 77 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1718,6 +1718,11 @@
"@typescript-eslint/types" "5.29.0"
eslint-visitor-keys "^3.3.0"

"@yarnpkg/lockfile@^1.1.0":
version "1.1.0"
resolved "https://registry.yarnpkg.com/@yarnpkg/lockfile/-/lockfile-1.1.0.tgz#e77a97fbd345b76d83245edcd17d393b1b41fb31"
integrity sha512-GpSwvyXOcOOlV70vbnzjj4fW5xW/FdUF6nQEt1ENy7m4ZCczi1+/buVUPAqmGfqznsORNFzUMjctTIp8a9tuCQ==

abab@^2.0.3, abab@^2.0.5:
version "2.0.6"
resolved "https://registry.yarnpkg.com/abab/-/abab-2.0.6.tgz#41b80f2c871d19686216b82309231cfd3cb3d291"
Expand Down Expand Up @@ -2309,7 +2314,7 @@ capture-exit@^2.0.0:
dependencies:
rsvp "^4.8.4"

chalk@^2.0.0:
chalk@^2.0.0, chalk@^2.4.2:
version "2.4.2"
resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424"
integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==
Expand Down Expand Up @@ -2556,7 +2561,7 @@ cosmiconfig@^5.0.5, cosmiconfig@^5.1.0:
js-yaml "^3.13.1"
parse-json "^4.0.0"

cross-spawn@^6.0.0:
cross-spawn@^6.0.0, cross-spawn@^6.0.5:
version "6.0.5"
resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-6.0.5.tgz#4a5ec7c64dfae22c3a14124dbacdee846d80cbc4"
integrity sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==
Expand Down Expand Up @@ -3406,6 +3411,13 @@ find-up@^4.0.0, find-up@^4.1.0:
locate-path "^5.0.0"
path-exists "^4.0.0"

find-yarn-workspace-root@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/find-yarn-workspace-root/-/find-yarn-workspace-root-2.0.0.tgz#f47fb8d239c900eb78179aa81b66673eac88f7bd"
integrity sha512-1IMnbjt4KzsQfnhnzNd8wUEgXZ44IzZaZmnLYx7D5FZlaHt2gW20Cri8Q+E/t5tIj4+epTBub+2Zxu/vNILzqQ==
dependencies:
micromatch "^4.0.2"

flat-cache@^3.0.4:
version "3.0.4"
resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-3.0.4.tgz#61b0338302b2fe9f957dcc32fc2a87f1c3048b11"
Expand Down Expand Up @@ -3464,6 +3476,15 @@ fs-extra@^1.0.0:
jsonfile "^2.1.0"
klaw "^1.0.0"

fs-extra@^7.0.1:
version "7.0.1"
resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-7.0.1.tgz#4f189c44aa123b895f722804f55ea23eadc348e9"
integrity sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw==
dependencies:
graceful-fs "^4.1.2"
jsonfile "^4.0.0"
universalify "^0.1.0"

fs-extra@^8.1.0:
version "8.1.0"
resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-8.1.0.tgz#49d43c45a88cd9677668cb7be1b46efdb8d2e1c0"
Expand Down Expand Up @@ -4118,7 +4139,7 @@ is-wsl@^1.1.0:
resolved "https://registry.yarnpkg.com/is-wsl/-/is-wsl-1.1.0.tgz#1f16e4aa22b04d1336b66188a66af3c600c3a66d"
integrity sha512-gfygJYZ2gLTDlmbWMI0CE2MwnFzSN/2SZfkMlItC4K/JBlsWVDB0bO6XhqcY13YXE7iMcAJnzTCJjPiTeJJ0Mw==

is-wsl@^2.2.0:
is-wsl@^2.1.1, is-wsl@^2.2.0:
version "2.2.0"
resolved "https://registry.yarnpkg.com/is-wsl/-/is-wsl-2.2.0.tgz#74a4c76e77ca9fd3f932f290c17ea326cd157271"
integrity sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww==
Expand Down Expand Up @@ -4816,6 +4837,13 @@ kind-of@^6.0.0, kind-of@^6.0.2:
resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.3.tgz#07c05034a6c349fa06e24fa35aa76db4580ce4dd"
integrity sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==

klaw-sync@^6.0.0:
version "6.0.0"
resolved "https://registry.yarnpkg.com/klaw-sync/-/klaw-sync-6.0.0.tgz#1fd2cfd56ebb6250181114f0a581167099c2b28c"
integrity sha512-nIeuVSzdCCs6TDPTqI8w1Yre34sSq7AkZ4B3sfOBbI2CgVSB4Du4aLQijFU2+lhAFCwt9+42Hel6lQNIv6AntQ==
dependencies:
graceful-fs "^4.1.11"

klaw@^1.0.0:
version "1.3.1"
resolved "https://registry.yarnpkg.com/klaw/-/klaw-1.3.1.tgz#4088433b46b3b1ba259d78785d8e96f73ba02439"
Expand Down Expand Up @@ -5654,6 +5682,14 @@ open@^6.2.0:
dependencies:
is-wsl "^1.1.0"

open@^7.4.2:
version "7.4.2"
resolved "https://registry.yarnpkg.com/open/-/open-7.4.2.tgz#b8147e26dcf3e426316c730089fd71edd29c2321"
integrity sha512-MVHddDVweXZF3awtlAS+6pgKLlm/JgxZ90+/NBurBoQctVOOB/zDdVjcyPzQ+0laDGbsWgrRkflI65sQeOgT9Q==
dependencies:
is-docker "^2.0.0"
is-wsl "^2.1.1"

optionator@^0.8.1:
version "0.8.3"
resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.8.3.tgz#84fa1d036fe9d3c7e21d99884b601167ec8fb495"
Expand Down Expand Up @@ -5693,7 +5729,7 @@ ora@^5.4.1:
strip-ansi "^6.0.0"
wcwidth "^1.0.1"

os-tmpdir@^1.0.0:
os-tmpdir@^1.0.0, os-tmpdir@~1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274"
integrity sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==
Expand Down Expand Up @@ -5793,6 +5829,25 @@ pascalcase@^0.1.1:
resolved "https://registry.yarnpkg.com/pascalcase/-/pascalcase-0.1.1.tgz#b363e55e8006ca6fe21784d2db22bd15d7917f14"
integrity sha512-XHXfu/yOQRy9vYOtUDVMN60OEJjW013GoObG1o+xwQTpB9eYJX/BjXMsdW13ZDPruFhYYn0AG22w0xgQMwl3Nw==

patch-package@^6.4.7:
version "6.4.7"
resolved "https://registry.yarnpkg.com/patch-package/-/patch-package-6.4.7.tgz#2282d53c397909a0d9ef92dae3fdeb558382b148"
integrity sha512-S0vh/ZEafZ17hbhgqdnpunKDfzHQibQizx9g8yEf5dcVk3KOflOfdufRXQX8CSEkyOQwuM/bNz1GwKvFj54kaQ==
dependencies:
"@yarnpkg/lockfile" "^1.1.0"
chalk "^2.4.2"
cross-spawn "^6.0.5"
find-yarn-workspace-root "^2.0.0"
fs-extra "^7.0.1"
is-ci "^2.0.0"
klaw-sync "^6.0.0"
minimist "^1.2.0"
open "^7.4.2"
rimraf "^2.6.3"
semver "^5.6.0"
slash "^2.0.0"
tmp "^0.0.33"

path-exists@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-3.0.0.tgz#ce0ebeaa5f78cb18925ea7d810d7b59b010fd515"
Expand Down Expand Up @@ -5882,6 +5937,11 @@ posix-character-classes@^0.1.0:
resolved "https://registry.yarnpkg.com/posix-character-classes/-/posix-character-classes-0.1.1.tgz#01eac0fe3b5af71a2a6c02feabb8c1fef7e00eab"
integrity sha512-xTgYBc3fuo7Yt7JbiuFxSYGToMoz8fLoE6TC9Wx1P/u+LfeThMOAqmuyECnlBaaJb+u1m9hHiXUEtwW4OzfUJg==

postinstall-postinstall@^2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/postinstall-postinstall/-/postinstall-postinstall-2.1.0.tgz#4f7f77441ef539d1512c40bd04c71b06a4704ca3"
integrity sha512-7hQX6ZlZXIoRiWNrbMQaLzUUfH+sSx39u8EJ9HYuDc1kLo9IXKWjM5RSquZN1ad5GnH8CGFM78fsAAQi3OKEEQ==

prelude-ls@^1.2.1:
version "1.2.1"
resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.2.1.tgz#debc6489d7a6e6b0e7611888cec880337d316396"
Expand Down Expand Up @@ -6409,7 +6469,7 @@ reusify@^1.0.4:
resolved "https://registry.yarnpkg.com/reusify/-/reusify-1.0.4.tgz#90da382b1e126efc02146e90845a88db12925d76"
integrity sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==

rimraf@^2.5.4:
rimraf@^2.5.4, rimraf@^2.6.3:
version "2.7.1"
resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.7.1.tgz#35797f13a7fdadc566142c29d4f07ccad483e3ec"
integrity sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==
Expand Down Expand Up @@ -6654,6 +6714,11 @@ sisteransi@^1.0.5:
resolved "https://registry.yarnpkg.com/sisteransi/-/sisteransi-1.0.5.tgz#134d681297756437cc05ca01370d3a7a571075ed"
integrity sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==

slash@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/slash/-/slash-2.0.0.tgz#de552851a1759df3a8f206535442f5ec4ddeab44"
integrity sha512-ZYKh3Wh2z1PpEXWr0MpSBZ0V6mZHAQfYevttO11c51CaWjGTaadiKZ+wVt1PbMlDV5qhMFslpZCemhwOK7C89A==

slash@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/slash/-/slash-3.0.0.tgz#6539be870c165adbd5240220dbe361f1bc4d4634"
Expand Down Expand Up @@ -7043,6 +7108,13 @@ through2@^2.0.1:
readable-stream "~2.3.6"
xtend "~4.0.1"

tmp@^0.0.33:
version "0.0.33"
resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.33.tgz#6d34335889768d21b2bcda0aa277ced3b1bfadf9"
integrity sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==
dependencies:
os-tmpdir "~1.0.2"

[email protected]:
version "1.0.5"
resolved "https://registry.yarnpkg.com/tmpl/-/tmpl-1.0.5.tgz#8683e0b902bb9c20c4f726e3c0b69f36518c07cc"
Expand Down

0 comments on commit ab57489

Please sign in to comment.