이전 업데이트와 비교하여 Capacitor 4에서 Capacitor 5로의 전환은 최소한의 깨지지 않는 변경 사항을 포함합니다. 이 안내서에서는 Capacitor 5로 업데이트하는 데 필요한 단계별 지침을 제공하며, 공식 플러그인에 대한 깨지지 않는 변경 사항의 목록도 제공합니다.
주의: Capacitor 5는 NodeJS 16 이상을 요구하며, Node 12은 종료되었으며 Node 14은 2023년 4월 30일 종료될 예정입니다. 최신 LTS 버전의 NodeJS를 사용하는 것을 권장합니다.
-
Capacitor 5를 설치하세요
latestCapacitor 5로 업그레이드하는 버전의 Capacitor CLI 프로젝트에 있습니다.npm i -D @capacitor/cli@latest -
Run the following command to let the CLI handle the migration:
npx cap migrateVS __CAPGO_KEEP_0__ 확장 프로그램이 설치되어 있다면, 확장 프로그램의 추천 섹션에서 프로젝트를 __CAPGO_KEEP_1__ 5로 마이그레이션하는 옵션을 찾을 수 있습니다.
-
Code 4 iOS 프로젝트를 Capacitor 5로 업그레이드하는 방법
업그레이드 Capacitor 4 iOS 프로젝트를 Capacitor 5로
-
업그레이드 Xcode: Capacitor 5는 Xcode 14.1 이상이 필요합니다.
-
업데이트 .gitignore: __CAPGO_KEEP_0__ 5의 다음 변경 사항을 적용하세요.
.gitignore파일:- App/Podfile.lock + App/output -
업데이트 Assets를 사용하여 단일 앱 아이콘으로컨텍스트: 솔루션 페이지 앱 예시 섹션. 역할: 이미지 대체 텍스트. 표시되는 곳: 컴포넌트 솔루션/솔루션 앱 예시.astro. 메시지 키 `solution_app_examples_icon_alt` (솔루션 앱 예시 아이콘 대체 텍스트).
업그레이드 Capacitor 4 안드로이드 프로젝트를 Capacitor 5로
-
__CAPGO_KEEP_0__ 4 Android 프로젝트를 __CAPGO_KEEP_1__ 5로 업그레이드: Capacitor 5 requires Android Studio Flamingo | 2022.2.1 or newer due to the usage of Gradle 8, which requires Java JDK 17. Java 17 ships with Android Studio Flamingo, so no additional downloads are needed.
-
: __CAPGO_KEEP_0__ 5는 Android Studio Flamingo | 2022.2.1 이상이 필요합니다. Gradle 8의 사용으로 인해 Java JDK 17이 필요합니다. Java 17은 Android Studio Flamingo와 함께 제공되므로 별도의 다운로드가 필요하지 않습니다.AGP 업그레이드 어시스턴트 실행하기
Tools -> AGP Upgrade Assistant. -
업데이트 Android 프로젝트 변수: Android 프로젝트의
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에서
https시스템의 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현재 기본값이더라도 이제는.{ server: { androidScheme: "http" } } -
Kotlin 버전 업데이트: Kotlin을 사용하는 프로젝트라면
kotlin_version변수를'1.8.20'.
플러그인 기능 변경
다음과 같이 플러그인 기능이 변경되거나 제거되었습니다. code을 업데이트하십시오:
- 액션 시트
- 브라우저
- 카메라
- 디바이스
- 위치 정보
- 구글 맵
- Local Notifications
- 푸시 알림
- 상태 표시줄
액션 시트
- 업데이트 하기
androidxMaterialVersion변수를1.8.0.
브라우저
- 업데이트 하기
androidxBrowserVersion변수를1.5.0.
카메라
- Android 13에서 미디어 이미지 읽기 권한을 추가하십시오 (
<uses-permission android:name="android.permission.READ_MEDIA_IMAGES"/>) inAndroidManifest.xml. - 업데이트 하기
androidxMaterialVersion변수를1.8.0. - 업데이트 하기
androidxExifInterfaceVersion변수를1.3.6.
기기
- 변경
DeviceId.uuid로DeviceId.identifier. - iOS 16 이상에서,
DeviceInfo.name적절한 권한을.
지오리케이션
- 업데이트 하기
playServicesLocationVersion까지21.0.1.
구글 맵
- 다음 변수를 업데이트하세요:
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까지1.8.20.
Local Notifications
- Android 13에서 로컬 알림을 예약할 때 SDK 33을 대상으로 하므로 새로운 런타임 권한 확인이 필요합니다.
checkPermissions()그리고requestPermissions()따라서.
푸시 알림
- Android 13에서 푸시 알림을 받으려면 SDK 33을 대상으로 하는 경우 새로운 런타임 권한 검사를 호출해야 합니다.
checkPermissions()그리고requestPermissions()따라서. - 업데이트하십시오.
firebaseMessagingVersion변수에23.1.2.
상태 표시줄
- iOS에서 기본 상태 표시줄 애니메이션은 __CAPGO_KEEP_0__로 변경되었습니다.
FADE.
이러한 단계를 따르고 code를 업데이트하십시오. 따라서 Capacitor 4에서 Capacitor 5로 프로젝트를 성공적으로 업데이트한 것입니다. 모든 기능과 플러그인이 예상대로 작동하는지 확인하기 위해 애플리케이션을 철저히 테스트하십시오.
업데이트하는 Capacitor 4에서 Capacitor 5로 가는 단계별 안내서
Capacitor 4에서 Capacitor 5로 업데이트하는 방법 Updating from Capacitor 4 to Capacitor 5: A Step-by-Step Guide 자연 플러그인 작업을 계획하려면 Capgo 플러그인 디렉토리 Capacitor 5로 업그레이드하는 제품 워크플로우에서 Capgo 플러그인 디렉토리. Capacitor 플러그인들에 의해 Capgo Capacitor 플러그인에 대한 구현 세부 사항은 Capgo에 의해 관리됩니다. 플러그인을 추가하거나 업데이트 플러그인을 추가하거나 업데이트에서 구현 세부 정보 Ionic Enterprise 플러그인 대체 Ionic Enterprise 플러그인 대체에서 제품 워크플로우 Capgo 원시 빌드 Capgo 제품 워크플로우에서 Capgo 네이티브 빌드에 대해.