Solve Problem/Troubleshooting 38

[React Native] 가로의 길이가 바뀌는 디바이스(폴드) 대응: Dimensions -> useDimensions

[React Native] 가로의 길이가 바뀌는 디바이스(폴드) 대응: Dimensions -> useDimensions 루빗(루틴 관리 서비스 어플) 유저중에는 당연히 갤럭시 폴드 사용자도 있다.종종 해당 유저들로부터 버그제보가 들어온다. 디바이스를 접거나 펴면 화면이 그에 맞게 대응되지 않는다는 것. 직접 버그를 재현해보았다. 정말이었다. 접은 상태: A / 편 상태: B라고 하겠다.A에서 B로 바뀌었는데, 하단 탭바는 여전히 A에 맞게 대응되어 있다. 이유가 무엇일까? 바로 Dimensions에 있다./* 👎 Bad*/import { Dimensions, View } from 'react-native';const width = Dimensions.get('screen').width;const T..

[Error] NDK at ~/Library~ did not have a source.properties file

NDK at ~/Library/Android/sdk/ndk~ did not have a source.properties file에러 해결법 react-native-vision-camera 라이브러리에서 요구하는 ndk가 깔려있지 않아도 yarn install 하면서 깔리는데, 만약 해당 ndk 가 로컬에서 꼬여있거나 손상되어 있으면 빌드에 문제를 줌. -> 해당 ndk 폴더 삭제하면 됨. [파인더 - cmd+shift+. 숨김 폴더 보기 - ~/root/라이브러리/Android/sdk/ndk/ - 문제있는 버전 폴더 삭제] 참고) https://stackoverflow.com/questions/64372383/ndk-at-library-android-sdk-ndk-bundle-did-not-have-a-..

[iOS/Firebase/RN] iOS 개발자 계정 이전 이후 파이어베이스 푸시알람이 안올 때

배경 개발자 계정을 개인에서 법인으로 전환할 일이 생겨서 전환했는데, 그 이후 파이어베이스에서 보내는 푸시알람이 가지 않는 오류가 발생했습니다. 해결 APN 인증서를 재업로드하면 됩니다. 1. https://developer.apple.com/account/ 계정 - Certificates, Identifiers & Profiles - Keys - +버튼 클릭 - APN 선택 2. 다운로드 및 키 ID 인지 3. FIrebase console - 프로젝트 설정 - 일반 - ios 앱 - 팀 ID 변경 * 팀 ID는 developer 페이지 우상단에서 알 수 있습니다. 4. Firebase console - 프로젝트 설정 - 클라우드 메시징 - APN 인증키 삭제 후 다운로드 받은 파일로 재업로드 이 때 ..

[React Native] Could not find "client" in the context or passed in as an option 에러 해결법

Could not find "client" in the context or passed in as an option. Wrap the root component in an , or pass an ApolloClient instance in via options.분명 ApolloProvider에 client를 잘 넣었는데 이러한 오류가 발생할 때가 있다.그럴 땐 useMutation(또는 useQuery or useLazyQuery)를 import 하는 패키지를 확인하자.import { gql, ApolloError, useMutation } from '@apollo/client'; // no!!!!import { useLazyQuery } from '@apollo/react-hooks';import { ..

[React Native / Android] unexpected element <queries> found in <manifest>

에러unexpected element found in 해결법android/build.gradleAndroid Gradle plugin 버전을 3.4.2에서 3.4.3으로 바꿔준다.classpath("com.android.tools.build:gradle:3.4.3")참고 링크https://github.com/ivpusic/react-native-image-crop-picker/issues/1406https://stackoverflow.com/questions/62969917/how-do-i-fix-unexpected-element-queries-found-in-manifesthttps://android-developers.googleblog.com/2020/07/preparing-your-build-f..

[React Native] ScrollView과 position: absolute를 같이 쓰고 싶을 때 (flex를 이용하는 방법)

목표 각각의 탭을 클릭했을 때 나오는 content가 scrollview이면서 그 scrollview의 position이 absolute이고, zIndex로 해당 scrollview를 보여주고 숨기고를 구현하고 싶었다. 실패 여느 view를 구현하듯이 scrollview에도 position: 'absolute'를 적용했더니, 끝까지 스크롤되지 않았다. 구글링을 많이 해봤지만 통하지 않았다. 해결법 position: 'relative'. 즉 position은 건들지 않고, flex만 건들면 되는 문제였다. height도 설정해줘야 한다. 그렇지 않으면 완전히 겹쳐지지 않는다. 나같은 경우는 1000으로 설정했지만, 실제로 1000까지 스크롤되지는 않는다. 코드 {/* S1 *} {...content} {/..

[React Native / iOS] Admob 에러 - [admob/unknown] the provided view controller is already presenting another view controller

에러 [admob/unknown] the provided view controller is already presenting another view controller 원인 다른 화면에서 광고를 사용하고 있는데, 광고 id가 다름에도 불구하고. 알고보니, 나는 react-native-modal을 이용해 모달을 띄운 후 그 안에서 광고를 불러오려고 시도하고 있었다. 즉 현재 스크린 위에 모달이라는 뷰가 하나 더 덮여쓰여진 것이다. 그래서 위 에러가 났던 것이다. 그래서 모달에서는 광고를 띄우지 않으면, 광고는 정상적으로 불러와진다!

[React Native / Android] Task :~~library~~:verifyReleaseResources FAILED

1. 버그 > Task :react-native-disable-battery-optimizations-android:verifyReleaseResources FAILED FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':react-native-disable-battery-optimizations-android:verifyReleaseResources'. > 1 exception was raised by workers: com.android.builder.internal.aapt.v2.Aapt2Exception: Android resource linking failed error: resource a..

출처: https://mingos-habitat.tistory.com/34 [밍고의서식지:티스토리]