Dev. Blog isprometheo의 좌충우돌 개발 블로그
Posts with the tag react native:

[React Native] SQLite 사용하기

React Native 버전을 0.59에서 0.61로 업데이트하면서 Hermes를 사용해보기로 했다. Hermes 설정을 완료하고 앱을 구동했으나 다음과 같은 에러가 발생했다. RangeError: Maximum call stack size exceeded, js engine:hermes 릴리스 버전으로 빌드를 시도해봤지만 메모리 문제로 빌드가

[React Native] AdMob 라이브러리 변경

기존에 사용하던 라이브러리로 AdMob 광고를 표시하고 있었는데 정책 위반 메일을 받아서 이를 처리할 필요가 있었다. 그래서 react-native-admob 저장소에서 문서를 읽어봤다. isReady 메소드로 처리가 가능하겠다는 생각이 들었다. 그러다 우연히 react-nat

[React Native] AndroidX Migration

Gradle 버전을 5로 올리고 빌드를 하니 react-native-admob, react-native-custom-tabs, react-native-smart-splash-screen 에서 다음과 같은 에러가 났다. error: package android.support.annotation does not exist import android.support.annotation.Nullable; ^ error: cannot find symbol import android.support.customtabs.CustomTabsIntent; ^ 이를 해결하려면 각각 다음과 같이 변경하면 된다. // import android.support.annotation.Nullable; import androidx.annotation.Nullable; // import android.support.customtabs.CustomTabsIntent; import androidx.browser.customtabs.CustomTabsIntent; 참고 문헌 https://developer.android.com/jetpack/androidx/migrate

[React Native] 빌드 실패 해결(Firebase Analytics)

앱을 빌드하는데 다음과 같은 에러가 발생했다. > Configure project :@react-native-firebase_analytics :@react-native-firebase_analytics:firebase.bom using default value: 21.1.0 FAILURE: Build failed with an exception. * Where: Build file '../node_modules/@react-native-firebase/analytics/android/build.gradle' line: 60 * What went wrong: A problem occurred evaluating project ':@react-native-firebase_analytics'. > Could not find method platform() for arguments [com.google.firebase:firebase-bom:21.1.0] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler. android/gradle/wrapper/gradle-wrap

[React Native] Async Storage 사용하기

앱을 개발하다보니 설정된 내용을 저장할 필요가 있어 async-storage를 사용하게 되었다. React Native 버전이 0.59 이하인 경우 아래와 같이 하면 된다. 버전이 0.60 이상인 경우 link를 해주지 않아도 된다. $ npm install @react-native-community/async-storage $ react-native link @react-native-community/async-storage 데이터를

[React Native] MultiDex 추가

앱을 배포한 이후에 비정상 종료에 다음과 같은 내용들이 올라왔다. Caused by: java.lang.ClassNotFoundException: at dalvik.system.BaseDexClassLoader.findClass (BaseDexClassLoader.java:93) 이를 해결하기 위해 검색한 결과 multidex를 추가하면 해결이 된다는 내용을 보고 추가하기로 했다. 기본적인 내용들은 여기에서 보면 된다. Andr

[React Native] Firebase 충돌 해결

앱을 릴리즈로 빌드한 다음 실제 기기나 에뮬레이터에서 실행했을 때 충돌(Crash)이 나는 경우가 있다. 이럴 땐 어디서 에러가 났는지 확인해야하는데 다음의 명령어로 로그를 확인할 수 있다. $ adb logcat *:E zsh의 경우엔 다음과 같이 한다

[React Native] Firebase Analytics 사용

앱을 배포한 이후에 사용자가 어떤 행동을 하는지 알고 싶어졌다. 그래서 react-native-firebase를 이용하여 수집하기로 했다. yarn으로 설치하거나 다음을 실행하면 된다. $ npm install --save @react-native-firebase/app $ react-native link @react-native-firebase/app $ npm install --save @react-native-firebase/analytics $

[React Native] Webview 사용

react-native-webview를 사용할 때 gradle.properties에 다음을 추가해야 한다. android.useAndroidX=true android.enableJetifier=true 추가한 후에 빌드할 때 react-native-admob에서 빌드 실패가 나는 경우가 발생한다. >

[React Native] Admob 사용

react-native로 만든 앱에 광고를 넣기 위해 react-native-admob을 사용했다.(안드로이드만 사용) $ npm i --save react-native-admob@next $ react-native link react-native-admob@next android/app/build.gradle에 다음을 추가한다.