본문 바로가기

프로그래밍/React-Native <JSX>34

[React-Native] Flipper는 무엇인가? 소개 flipper 는 페이스북(메타)팀에서 개발, 운영하는 오픈소스 디버거 입니다. iOS, Android, React-Native 등의 모바일 플랫폼 개발에 활용할 수 있습니다. 일반적으로 데스크탑 어플리케이션 형태로 제공되어 사용할 수 있습니다. React-Native 에서의 Flipper React-Native 프로젝트에서는 기본적으로 Flipper가 설치되어 있습니다. 디버그 모드에서 개발 도중 에러 발생 시 아래와 같은 에러모달을 자주 확인하셨을 텐데요, 이게 flipper의 기능입니다. 데스크탑 앱 형태가 아니라 React-Native에 내장되어 있습니다. Flipper는 gradle 스크립트를 통해 디버그 모드에서만 의존성 목록에 포함되어 있습니다. 위 스크린샷은 metro 서버가 응답하지.. 2023. 6. 24.
[React-Native] android :app:checkDebugAarMetadata Failed to transform react-native-0.71.0-rc.0-debug.aar 에러 해결 발생 에러 > Task :app:checkDebugAarMetadata FAILED 4 actionable tasks: 4 executed FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':app:checkDebugAarMetadata'. > Could not resolve all files for configuration ':app:debugRuntimeClasspath'. > Failed to transform react-native-0.71.0-rc.0-debug.aar (com.facebook.react:react-native:0.71.0-rc.0) to match attributes {ar.. 2023. 6. 24.
[React-Native] android gradle Configuration with name 'compile' not found. 에러 해결 발생 에러 FAILURE: Build failed with an exception. * What went wrong: Configuration with name 'compile' not found. * Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights. * Get more help at https://help.gradle.org 해결 방법 이 글에서 제시하는 방법은 빌드 시 사용하는 gradle 버전이 7 이상일 상황에 한합니다. 프로젝트/android 디렉토리를 안드로이드 스튜디어로.. 2023. 6. 24.
[React-Native] android :app:processDebugResources Could not find com.facebook.fresco:fresco:2.2.0 에러 해결 발생 에러 FAILURE: Build failed with an exception. * What went wrong: Could not determine the dependencies of task ':app:processDebugResources'. > Could not resolve all task dependencies for configuration ':app:debugRuntimeClasspath'. > Could not find com.facebook.fresco:fresco:2.2.0. Searched in the following locations: - https://repo.maven.apache.org/maven2/com/facebook/fresco/fresco/2.2.0/fresco-.. 2023. 6. 23.
[React-Native] 구 버전(0.63.4) android 프로젝트 빌드하기 React-Native는 정말 많이, 빠르게 변화하고 있습니다. 크로스 모바일 플랫폼이다 보니 android, iOS 생태계의 변경에 민감하고 추가 적인 라이브러리에 매우 의존적입니다. 조금이라도 React-Native 버전이 최신 버전과 차이가 날 경우 늘 새로운 에러를 마주합니다. 이번 글엔 구 버전, 이 글에선 0.63.4 버전을 기준으로 빌드에 성공하는 방법에 대해 설명합니다. android 빌드에 한해 서술합니다. flipper 버전 수정 프로젝트/android 디렉토리를 안드로이드 스튜디오로 열어 gradle.properties 내 flipper 버전을 수정합니다. 0.99.0 으로 버전을 수정해 주세요. 의존성 라이브러리의 호환성 문제(fresco 등)를 해결하기 위해 버전을 수정해야 합니다.. 2023. 6. 23.
[React-Native] android app:installDebug FAILED INSTALL_FAILED_UPDATE_INCOMPATIBLE 문제 해결 안드로이드 빌드 시에만 해당되는 문제로 빌드 대상이 되는 기기에 동일하지만 빌드 서명키가 다른 어플리케이션이 이미 설치되어 있는 경우 발생하는 에러입니다. 저의 경우 이미 플레이스토어에 올라와 있는 프로덕션 키가 서명된 앱을 설치한 기기에 동일한 앱 빌드(디버그 서명키를 통해)를 시도하여 발생한 문제였습니다. 기존 프로덕션 서명 앱을 지우고 다시 빌드를 시도하니 잘 설치되었습니다. > Task :app:installDebug FAILED 161 actionable tasks: 6 executed, 155 up-to-date ... com.android.ddmlib.InstallException: INSTALL_FAILED_UPDATE_INCOMPATIBLE: Existing package com.iter.. 2023. 6. 19.
[React-Native] android CodePush 시작하기 앞선 app center sdk가 정상적으로 설치되어 있다는 전제하에 진행합니다. 먼저 app center sdk 설치 관련 글을 참고하세요. android CodePush 가이드 - 1. [React-Native] android App Center SDK 등록하기 - 2. [React-Native] android CodePush 시작하기 (현재 글) - 3. [React-Native] android CodePush 를 통해 업데이트 진행하기 react-native-code-push 설치 react-native 프로젝트에 필요한 프로젝트를 설치합니다. npm 으로 설치 시 에러가 나면 yarn으로 시도해 보세요. npm install --save react-native-code-push App Cente.. 2023. 6. 18.
[React-Native] android App Center SDK 등록하기 CodePush를 사용하기 위해 먼저 각 운영체제에 맞는 세팅을 해주어야 합니다. 이 글에선 안드로이드 앱에 관한 SDK 세팅에 관해 서술합니다. android CodePush 가이드 - 1. [React-Native] android App Center SDK 등록하기 (현재 글) - 2. [React-Native] android CodePush 시작하기 - 3. [React-Native] android CodePush 를 통해 업데이트 진행하기 SDK 추가 React-Native 프로젝트에 아래와 같이 SDK를 설치합니다. npm install appcenter appcenter-analytics appcenter-crashes --save-exact appcenter-config.json 파일 추가 .. 2023. 6. 18.
[React-Native] Recoil 사용하기 상태 관리 라이브러리 Recoil을 React-Native 에서 사용해 보겠습니다. Atom 관리의 대상이 되는 상태 단위입니다. 한 가지의 변수 뿐만 아니라 배열, Object 등 다양한 종류의 자료 구조 또한 Atom이 될 수 있습니다. key는 해당 Atom에 할당되는 고유한 id 입니다. 단순히 상태 업데이트 시 사용되는 것 뿐 아니라 캐싱을 통한 성능 개선을 위해 사용합니다. // 수 const numberTmpState = atom({ key: 'numberTmpState', default: 0, }); // 배열 const ArrayTmpState = atom({ key: 'ArrayTmpState', default: [], }); Selector 생성한 Atom을 활용하기 위해 Select.. 2023. 5. 23.
[React-Native] 두 Modal을 활용하여 뒷 배경 어둡게 처리하기 React Native 에서 기본적으로 제공하는 Modal 만을 활용해 Modal 활성화 시 배경을 어둡게 하도록 코드를 작성해 보겠습니다. 대부분의 앱들에서 볼 수 있는 사용자 경험입니다. 실행 화면 구현한 실행 화면부터 확인해 보겠습니다. - 뒷 배경 흐림에 fade 옵션을 준 경우 - 뒷 배경 흐림에 none 옵션을 준 경우, 보다 즉각적인 반응을 얻을 수 있습니다. 저라면 이 버전을 사용할 것 같네요. Modal 구현 이를 구현하기 위해 두 가지 Modal을 사용해야 합니다. 하나는 뒷 배경을 어둡게 할 ContainerModal 이고 나머지 하나는 사용자가 집중하게 될 내용을 담을 TestModal 입니다. ContainerModal 뒷 배경을 어둡게 처리할 Modal 입니다. 어떻게 어둡게 할.. 2023. 5. 6.
[React-Native] NativeWind 스타일링 미적용 문제 해결 TailWind 디자인 패턴을 RN 앱에 사용하기 위해 사용하는 라이브러리로 NativeWind가 있습니다. NativeWind를 활용한 스타일링이 적용되지 않을 때 시도할 수 있는 해결 방법들입니다. 캐시 삭제 NativeWind 스타일링은 각 파일의 캐쉬를 활용합니다. 바로 적용이 안되는 경우 캐쉬를 삭제한 후 다시 빌드를 시도합니다. npx react-native start --reset-cache tailwind.config.js 확인 NativeWind는 tailwind.config.js 파일을 통해 스타일링을 적용할 파일들을 확인합니다. 새로운 파일을 생성한 경우 파일을 다시 확인해 보세요. 제 경우, MainScreen 파일을 새로 만든 후 tailwind.config.js 파일에 해당 파일.. 2023. 4. 30.
[React-Native] Xcode DVTCoreDeviceEnabledState 빌드 오류 해결 발생 에러 아래와 같은 에러를 남기며 IOS 앱을 빌드할 수 없었습니다. warning: Run script build phase 'Start Packager' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'ITerviewClientMobile' from project 'ITervie.. 2023. 4. 29.