Setup existing IONIC project in local
Steps:
- clone git repo
- install ionic - npm install -g @ionic/cli
- masuk folder repo project
- install npm dependencies - npm install
- run ionic project - ionic serve
- buka android studio / xcode - ionic cap open $var - $var = ‘android’ atau ‘ios’. ada dua je option, replace $var dgn dua option tu
- sync changes vscode & dkt android studio / xcode - ionic cap sync
- good luck
Common issues:
- dependency conflict
- check https://www.npmpeer.dev/ utk tengok version yg compatible
- try naikkan/turunkan version dependency yg keluar dkt error. tembak je sampai hilang error
- gradle issue
- try upgrade gradle. kalau tak boleh, try remove folder android & build semula
- error cocoapod
- make sure install xcode
- make sure install cocoapod
- error java home not found
- utk mac, buka ~/.zshrc & masukkan
- changes dkt VSC tak masuk android studio / xcode
- try ionic cap sync
- try quit & buka semula
- cordova.variables.gradle not found/exist
- npm run build
- npx cap sync android
- issue with google GMS thing
- update the version in build gradle, then sync & build again
Common trouble shoot for weird issues:
- clean & rebuild project
- delete & clone back.
- then run these commands:
- reinstall npm dependencies - npm install
- create www folder - npm run build
- sync android dependencies - npx cap sync android
Check NPM dependency compatibility
Ni website utk check npm dependency. kalau install dependency baru, boleh make sure dulu capacitor/core tu compatible tak dengan version dependency yg nk guna.
contoh: nk guna @capacitor/camera.
- input pertama masukkan nama dependency
- input kedua masukkan nama core yg dependency tu guna. in this case @capacitor/core
- input ketiga ni version utk input kedua. so version @capacitor/core. tengok pada file package.json & dapatkan version.
- tekan search, akan keluar version yg compatible. kalau nk tengok table full semua version, boleh klik link see all
Kalau ada masalah dgn gradle masa nk build app sbb error dkt dependency barcodescanner, boleh pergi ke file berikut:
node_modules/phonegap-plugin-barcodescanner/src/android/barcodescanner.gradle
tukar line berikut:
dependencies {
compile(name:'barcodescanner-release-2.1.5', ext:'aar')
}
kepada:
dependencies {
implementation(name:'barcodescanner-release-2.1.5', ext:'aar')
}


Comments
Post a Comment