React Native 0.59 업그레이드 후 Android 빌드 오류 해결
문제 상황
회사 앱을 React Native 0.58에서 0.59로 업그레이드했다. iOS는 문제없이 빌드됐지만 Android에서 계속 빌드가 실패했다.
Could not resolve all files for configuration ':app:debugCompileClasspath'.
원인 분석
0.59부터 AndroidX를 기본 지원하면서 기존 support 라이브러리와 충돌이 발생했다. 문제는 서드파티 라이브러리들이 아직 AndroidX로 마이그레이션되지 않은 상태였다는 점이다.
해결 방법
1. Jetifier 적용
android/gradle.properties에 다음 추가:
android.useAndroidX=true
android.enableJetifier=true
2. Gradle 버전 업데이트
android/build.gradle:
buildscript {
ext {
buildToolsVersion = "28.0.3"
minSdkVersion = 16
compileSdkVersion = 28
targetSdkVersion = 28
}
dependencies {
classpath("com.android.tools.build:gradle:3.3.2")
}
}
3. Clean Build
cd android
./gradlew clean
cd ..
react-native run-android
추가 이슈
일부 네이티브 모듈이 여전히 문제를 일으켰다. react-native-vector-icons의 경우 수동으로 링크를 다시 설정해야 했다.
결론
AndroidX 마이그레이션은 필수 과정이지만 서드파티 라이브러리 호환성을 미리 확인하는 게 중요하다. 다음 업그레이드부터는 사전에 릴리스 노트를 더 꼼꼼히 읽어야겠다.