Sunbird ED Mobile
​
Dependencies: NPM Version - above 6 Node JS Version - above 10
1. Ionic-Android build Setup - Install java - Install Gradle - Install Android Studio - After Android studio installation, install SDK - Open Android studio and goto settings/appearance and behavior/system settings/Android SDK - Install appropriate Android sdk platform package. - Add environment variables in ~/.bashrc or ~/.bash_profile as follows export ANDROID_SDK_ROOT=path_to_sdk export PATH=$PATH:$ANDROID_SDK_ROOT/tools/bin export PATH=$PATH:$ANDROID_SDK_ROOT/platform-tools - Reference: https://ionicframework.com/docs/installation/android​
1
CLI Setup
2
- `npm install -g ionic`
3
- `npm install -g cordova`
Copied!
2. Project Setup - git clone the repo(https://github.com/Sunbird-Ed/SunbirdEd-mobile-app). - Rename sunbird.properties.example file to sunbird.properties and put all the valid credentials and api endpoint. - Go to project folder and run npm i - Run ./build.sh
3. How to build apk - To check attached devices do adb devices - npm run ionic-build (Make sure you have attached device) - ionic cordova run android --prod - Apk location project_folder/platforms/android/app/build/outputs/apk/staging/debug/apk_name.apk
4. How to debug apk - Open chrome and enter chrome://inspect - Select app
​

IOS Development setup

Prerequisites

1
1. Node js version 10.18.1
2
2. Ionic 5.4.16 using `npm i [email protected] -g`
3
3. Cordova 9.0.0 using `npm i [email protected] -g`
4
4. cordova-res 0.15.3 - using `npm install -g cordova-res`
5
5. ios-deploy 1.11.4 - using `brew install ios-deploy`
6
all of the above should be installed globally
7
Xcode 12.4 Build version 12D4e or above
Copied!

Steps

1
1. Checkout sunbird-sdk repo from https://github.com/shikshalokam/sunbird-mobile-sdk with branch release-3.9.0-ios
2
2. cd to <sunbird-mobile-sdk> && npm i && npm run build:prod
3
3. Checkout sunbird-mobile-app repo from https://github.com/shikshalokam/SunbirdEd-mobile-app with branch release-3.9.0-ios
4
4. Add `GoogleService-Info.plist` file
5
5. cd to <sunbird-mobile-app> local path
6
6. RUN npm i <sunbird-sdk repo local path>/dist
7
7. RUN npm i
8
8. RUN ./build-ios.sh
9
9. RUN cordova emulate ios
Copied!

Possible Errors

  1. 1.
    error: Value for SWIFT_VERSION cannot be empty. (in target 'Sunbird' from project 'Sunbird') or Duplicate GoogleService-Info.plist file error

Solution

1
open platforms/ios/Sunbird.xcworkspace
2
Select Sunbird
3
Build setting Project, targets
4
update Swift language version to 4
5
Inside Tagets -> Build phases -> Copy Bundle Resources -> remove duplicate GoogleService-Info.plist if present
6
and close Xcode then rerun the **cordova emulate ios**
Copied!