Compared to previous updates, the transition from Capacitor 4 to Capacitor 5 involves minimal breaking changes. This guide provides step-by-step instructions for updating your project to Capacitor 5, as well as a list of breaking changes for official plugins.
: __CAPGO_KEEP_0__ 5는 NodeJS 16 이상이 필요하며, Node 12은 종료되었으며 Node 14은 2023년 4월 30일 종료될 예정입니다. 최신 LTS 버전의 NodeJS를 사용하는 것을 권장합니다.: Capacitor 5 requires NodeJS 16 or higher, as Node 12 has reached end-of-life and Node 14 will reach end-of-life on April 30th, 2023. It is recommended to use the latest LTS version of NodeJS.
-
__CAPGO_KEEP_0__
latestCapacitor CLI 프로젝트의 Capacitor 버전:npm i -D @capacitor/cli@latest -
다음 명령어를 실행하여 CLI이 마이그레이션을 처리하도록 하세요:
npx cap migrate마이그레이션 단계 중 일부가 성공하지 못한 경우, 터미널 출력에 추가 정보가 제공됩니다. 수동 마이그레이션 단계는 아래에 나열되어 있습니다.
-
VS Code 확장 프로그램이 설치되어 있다면, 확장 프로그램의 추천 섹션에서 Capacitor 5로 프로젝트를 마이그레이션하는 옵션을 찾으세요.
Capacitor 4 iOS 프로젝트를 Capacitor 5로 업그레이드하는 방법
-
Xcode 업그레이드: Capacitor 5는 Xcode 14.1 이상이 필요합니다.
-
.gitignore 업데이트: __CAPGO_KEEP_0__ 파일을 업데이트 하세요:
.gitignore자원에 대한 업데이트: 단일 앱 아이콘을 사용하세요- App/Podfile.lock + App/output -
역할: 이미지 대체 텍스트. 본문에 나타나는 곳: 컴포넌트 솔루션/솔루션 앱 예제. 메시지 키 `solution_app_examples_icon_alt` (Solution App Examples Icon Alt).: Xcode 14은 1024x1024 단일 앱 아이콘을 지원합니다. AppIcon.appiconset을 업데이트하여 불필요한 모든 크기를 삭제하세요.
Capacitor 4 안드로이드 프로젝트를 Capacitor 5로 업그레이드하는 방법
-
안드로이드 스튜디오 업그레이드: Capacitor 5는 안드로이드 스튜디오 플래밍고 | 2022.2.1 이상이 필요합니다. 이는 Gradle 8의 사용으로 인해 Java JDK 17이 필요하기 때문입니다. Java 17은 안드로이드 스튜디오 플래밍고와 함께 제공되므로 추가 다운로드가 필요하지 않습니다.
-
AGP 업그레이드 도우미 실행: 안드로이드 스튜디오는 Gradle과 패키지 이동과 관련된 일부 업데이트를 도와줄 수 있습니다. 시작하려면
Tools -> AGP Upgrade Assistant. -
안드로이드 프로젝트 변수 업데이트: 프로젝트 폴더 내의
variables.gradle파일에서 값을 다음 새로운 최소값으로 업데이트하십시오:minSdkVersion = 22 compileSdkVersion = 33 targetSdkVersion = 33 androidxActivityVersion = '1.7.0' androidxAppCompatVersion = '1.6.1' androidxCoordinatorLayoutVersion = '1.2.0' androidxCoreVersion = '1.10.0' androidxFragmentVersion = '1.5.6' coreSplashScreenVersion = '1.0.0' androidxWebkitVersion = '1.6.1' junitVersion = '4.13.2' androidxJunitVersion = '1.1.5' androidxEspressoCoreVersion = '3.5.1' cordovaAndroidVersion = '10.1.1' -
구글 서비스 업데이트:
# build.gradle dependencies { - classpath 'com.google.gms:google-services:4.3.13' + classpath 'com.google.gms:google-services:4.3.15' } -
Gradle 플러그인 8.0.0으로 업그레이드:
# build.gradle dependencies { - classpath 'com.android.tools.build:gradle:7.2.1' + classpath 'com.android.tools.build:gradle:8.0.0' } -
Gradle 래퍼 8.0.2로 업그레이드:
# gradle-wrapper.properties distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists - distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-all.zip + distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.2-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -
Jetifier 비활성화:
# gradle.properties android.useAndroidX=true - android.enableJetifier=true -
패키지를 이동하세요.
build.gradle:# AndroidManifest.xml <?xml version="1.0" encoding="utf-8"?> - <manifest xmlns:android="http://schemas.android.com/apk/res/android" - package="[YOUR_PACKAGE_ID]"> + <manifest xmlns:android="http://schemas.android.com/apk/res/android"># build.gradle android { + namespace "[YOUR_PACKAGE_ID]" compileSdkVersion rootProject.ext.compileSdkVersion -
안드로이드 스키마를 업데이트 하세요.: Capacitor 버전 6 에서부터는
https기존 앱의 경우 __CAPGO_KEEP_0__ 앱이 시스템의 Autofill 기능을 사용할 수 있도록 하기 위해androidSchemefor existing apps to better enable Capacitor applications to use the system Autofill feature. To avoid data loss as a result of this change, set the scheme tohttp현재 기본값이더라도 __CAPGO_KEEP_0__ 버전 6 에서부터는{ server: { androidScheme: "http" } } -
이 스키마를Kotlin 버전을 업데이트 하세요.
kotlin_version: Kotlin을 사용하는 프로젝트의 경우'1.8.20'.
변수를
The following plugin functionality has been modified or removed. Update your code accordingly:
- 다음의 플러그인 기능이 수정되거나 제거되었습니다. __CAPGO_KEEP_0__을 업데이트하세요. : 액션 시트
- 브라우저
- 카메라
- 장치
- 위치 정보
- 구글 맵
- 지역 알림
- 푸시 알림
- 상태 바
액션 시트
- 업데이트 하기
androidxMaterialVersion변수를1.8.0.
브라우저
- 업데이트 하기
androidxBrowserVersion변수를1.5.0.
카메라
- Android 13에서 미디어 이미지 읽기 권한을 추가하십시오 (
<uses-permission android:name="android.permission.READ_MEDIA_IMAGES"/>)에서AndroidManifest.xml. - 업데이트 하기
androidxMaterialVersion변수를1.8.0. - 업데이트 하기
androidxExifInterfaceVersion변수를1.3.6.
디바이스
- 변경
DeviceId.uuid로DeviceId.identifier. - On iOS 16+,
DeviceInfo.namewill return a generic device name unless you add the appropriate entitlements .
Geolocation
- Update the
playServicesLocationVersionLive Update Dynamic Label To21.0.1.
Google Maps
- Update the following variables:
googleMapsPlayServicesVersionLive Update Dynamic Label To18.1.0.googleMapsUtilsVersionLive Update Dynamic Label To3.4.0.googleMapsKtxVersionLive Update Dynamic Label To3.4.0.googleMapsUtilsKtxVersionLive Update Dynamic Label To3.4.0.kotlinxCoroutinesVersion까지1.6.4.androidxCoreKTXVersion까지1.10.0.kotlin_version까지1.8.20.
지역 알림
- Android 13 버전에서 지역 알림을 예약하기 위해 SDK 33을 대상으로 하려면 새로운 런타임 권한 검사를 호출해야 합니다.
checkPermissions()그리고requestPermissions()Push 알림
Android 13 버전에서 Push 알림을 받기 위해 __CAPGO_KEEP_0__ 33을 대상으로 하려면 새로운 런타임 권한 검사를 호출해야 합니다.
- For Android 13, a new runtime permission check is required to receive push notifications when targeting SDK 33. Call
checkPermissions()업데이트 하세요requestPermissions()업데이트 하세요 - 업데이트 하세요
firebaseMessagingVersion변수에 대한23.1.2.
상태 바
- iOS에서 기본 상태 바 애니메이션은 변경되었습니다.
FADE.
이러한 단계를 따르면 code를 업데이트하고 Capacitor 4에서 Capacitor 5로 프로젝트를 업데이트하는 데 성공했을 것입니다. 모든 기능과 플러그인이 예상대로 작동하는지 확인하기 위해 애플리케이션을 철저히 테스트하세요.
Updating from Capacitor 4 to Capacitor 5: A Step-by-Step Guide
__CAPGO_KEEP_0__ 4에서 __CAPGO_KEEP_1__ 5로 업데이트하는 경우 Updating from Capacitor 4 to Capacitor 5: A Step-by-Step Guide __CAPGO_KEEP_0__를 사용하는 경우 Capgo Plugin Directory Capgo Plugin Directory에서 제품 워크플로우 Capacitor Plugins by Capgo Capacitor Plugins by Capgo의 구현 세부 사항 플러그인 추가 또는 업데이트 플러그인 추가 또는 업데이트 구현 세부 사항 아이오닉 엔터프라이즈 플러그인 대체 아이오닉 엔터프라이즈 플러그인 제품 워크플로우 Capgo 네이티브 빌드 Capgo 네이티브 빌드 제품 워크플로우