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.
주의4에서 5로 업데이트하는 경우 Capacitor 5는 NodeJS 16 이상을 요구하며, Node 12은 종료되었으며 Node 14은 2023년 4월 30일 종료됩니다. 최신 LTS 버전의 NodeJS를 사용하는 것을 권장합니다.
-
설치
latestCapacitor CLI의 __CAPGO_KEEP_2__ 버전을 프로젝트에 설치하세요.npm i -D @capacitor/cli@latest -
다음 명령어를 실행하여 CLI가 마이그레이션을 처리하도록 하세요:
npx cap migrateIf any migration steps cannot be achieved, additional information will be provided in the terminal output. Manual migration steps are listed below.
-
If you have the VS Code extension installed, check the recommendations section of the extension to find the option to migrate your project to Capacitor 5.
Capacitor 4 iOS Project을 Capacitor 5로 업그레이드하는 방법
-
Xcode 업그레이드: Capacitor 5는 Xcode 14.1 이상이 필요합니다.
-
.gitignore 업데이트: 다음 변경 사항을 적용하세요.
.gitignore파일:- App/Podfile.lock + App/output -
.gitignore 업데이트: 앱 아이콘을 하나만 사용하도록 업데이트하세요.
Capacitor 4 Android Project을 Capacitor 5로 업그레이드하는 방법
-
Android Studio 업그레이드: Capacitor 5는 Android Studio Flamingo | 2022.2.1 이상이 필요합니다. Gradle 8의 사용으로 인해 Java JDK 17이 필요합니다. Java 17은 Android Studio Flamingo와 함께 제공되므로 추가 다운로드가 필요하지 않습니다.
-
AGP 업그레이드 어시스턴트 실행: Android Studio는 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' -
Google 서비스 업데이트:
# 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 wrapper 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 -
androidScheme 업데이트: Capacitor 6 에서
httpswill be the default setting forandroidScheme기존 앱을 위해 Capacitor 애플리케이션을 시스템 Autofill 기능을 사용할 수 있도록 하기 위해http이 변경을 피하기 위해 scheme을{ 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__을 업데이트하십시오:
- 액션 시트
- 브라우저
- __CAPGO_KEEP_0__
- __CAPGO_KEEP_1__
- __CAPGO_KEEP_2__
- __CAPGO_KEEP_3__
- __CAPGO_KEEP_4__
- __CAPGO_KEEP_5__
__CAPGO_KEEP_6__
- __CAPGO_KEEP_7__ __CAPGO_KEEP_8__
androidxMaterialVersion__CAPGO_KEEP_9__1.8.0.
__CAPGO_KEEP_10__
- __CAPGO_KEEP_11__
androidxBrowserVersion__CAPGO_KEEP_12__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. - iOS 16+에서
DeviceInfo.name디바이스 이름을 일반적으로 반환합니다. 특정 디바이스 이름을 반환하려면 해당 디바이스 이름을 추가하십시오. 권한.
위치 정보
- 업데이트 하기
playServicesLocationVersion에서21.0.1.
Google Maps
- 업데이트 하기
googleMapsPlayServicesVersion를18.1.0.googleMapsUtilsVersion로3.4.0.googleMapsKtxVersion로3.4.0.googleMapsUtilsKtxVersion로3.4.0.kotlinxCoroutinesVersion로1.6.4.androidxCoreKTXVersion로1.10.0.kotlin_version__CAPGO_KEEP_0__ 버전 33. Call 이후1.8.20.
Local Notifications
- For Android 13, a new runtime permission check is required to schedule local notifications when targeting SDK 33. Call
checkPermissions()Push NotificationsrequestPermissions()Android 13 버전에서 푸시 알림을 받기 위해 새로운 런타임 권한 검사를 호출해야 합니다. accordingly.
업데이트
- For Android 13, a new runtime permission check is required to receive push notifications when targeting SDK 33. Call
checkPermissions()상태 표시줄을 업데이트합니다.requestPermissions()__CAPGO_KEEP_0__ 버전 33. Call 이후 - and
firebaseMessagingVersionaccordingly.23.1.2.
__CAPGO_KEEP_0__ 버전 33. Call 이후
- iOS에서 기본 상태栏 애니메이션을 변경했습니다.
FADE.
code을 업데이트하고 Capacitor 4에서 Capacitor 5로 프로젝트를 업데이트한 후에 이 단계를 따르면 code을 업데이트한 후에 Capacitor 4에서 Capacitor 5로 프로젝트를 업데이트한 후에 모든 기능과 플러그인이 예상대로 작동하는지 확인하기 위해 애플리케이션을 철저히 테스트하세요.
Capacitor 4에서 Capacitor 5로 업데이트하는 방법: 단계별 안내
__CAPGO_KEEP_0__을 사용하고 있다면 Capacitor 4에서 Capacitor 5로 업데이트하는 방법: 단계별 안내 자연 플러그인 작업을 계획하고자 한다면 Capgo 플러그인 디렉토리 Capgo 플러그인 디렉토리에서 제품 워크플로우 Capacitor 플러그인들에 의해 Capgo Capacitor 플러그인들에 의해 Capgo의 구현 세부 사항 플러그인 추가 또는 업데이트 플러그인 추가 또는 업데이트 구현 세부 사항 Ionic Enterprise Plugin Alternatives Ionic Enterprise Plugin Alternatives의 제품 워크플로우에 대한 Capgo Native Builds Capgo Native Builds의 제품 워크플로우에 대한