Split the Dataset into parts to send in a request - scala

I have very big Dataset.
For example, the dataset looks like this:
+--------------+--------------------+-------------+---------+---------+--------+--------------------+
| schema_from| table_from| column_from|link_type|schema_to|table_to| column_to|
+--------------+--------------------+-------------+---------+---------+--------+--------------------+
|custom_cib_stg|p_overall_part_te...| inn_num| direct| dbname1| table1| avg_ensure_sum_12m|
|custom_cib_stg|p_overall_part_te...|protocol_dttm| direct| dbname1| table1| avg_ensure_sum_12m|
|custom_cib_stg|p_overall_part_te...| inn_num| indirect| dbname1| table1| avg_ensure_sum_12m|
|custom_cib_stg|p_overall_part_te...|protocol_dttm| indirect| dbname1| table1| avg_ensure_sum_12m|
|custom_cib_stg|p_overall_part_te...| ensure_sum| direct| dbname1| table1| avg_ensure_sum_12m|
|custom_cib_stg|p_overall_part_te...| inn_num| indirect| dbname1| table1| avg_ensure_sum_3m|
|custom_cib_stg|p_overall_part_te...|protocol_dttm| indirect| dbname1| table1| avg_ensure_sum_3m|
|custom_cib_stg|p_overall_part_te...| ensure_sum| direct| dbname1| table1| avg_ensure_sum_3m|
|custom_cib_stg|p_overall_part_te...|protocol_dttm| direct| dbname1| table1| avg_ensure_sum_3m|
|custom_cib_stg|p_overall_part_te...| inn_num| direct| dbname1| table1| avg_ensure_sum_3m|
|custom_cib_stg|p_overall_part_te...| inn_num| indirect| dbname1| table1| avg_ensure_sum_6m|
|custom_cib_stg|p_overall_part_te...|protocol_dttm| indirect| dbname1| table1| avg_ensure_sum_6m|
|custom_cib_stg|p_overall_part_te...| inn_num| direct| dbname1| table1| avg_ensure_sum_6m|
|custom_cib_stg|p_overall_part_te...|protocol_dttm| direct| dbname1| table1| avg_ensure_sum_6m|
|custom_cib_stg|p_overall_part_te...| ensure_sum| direct| dbname1| table1| avg_ensure_sum_6m|
|custom_cib_stg|p_overall_part_te...| inn_num| indirect| dbname1| table1|avg_ensure_value_12m|
|custom_cib_stg|p_overall_part_te...|protocol_dttm| indirect| dbname1| table1|avg_ensure_value_12m|
|custom_cib_stg|p_overall_part_te...| ensure_value| direct| dbname1| table1|avg_ensure_value_12m|
|custom_cib_stg|p_overall_part_te...| inn_num| direct| dbname1| table1|avg_ensure_value_12m|
|custom_cib_stg|p_overall_part_te...|protocol_dttm| direct| dbname1| table1|avg_ensure_value_12m|
+--------------+--------------------+-------------+---------+---------+--------+--------------------+
I convert such a dataset to json and send it in the body of an http request.
Everything is going well, but my server accepts a maximum of 10 MB of information.
And the dataset can be 15-20 MB. I can't send such large datasets. I need to split the dataset into pieces.
So here's what I have:
10mb = 10240kb х 1024 = 10 485 760 byte
Maximum size of one row from the dataset = 500 byte.
So I can send a maximum of one http request = 10 485 760 / 500 = 20 971 rows
And based on this information, I want an algorithm that will divide the dataset into parts so that the size of these parts does not exceed 20,000 rows.
When dividing, one more condition must be met.
The group from the column "column_to" must be located inside the same dataset.
For example dataset contain 4 group:
avg_ensure_sum_12m
avg_ensure_sum_3m
avg_ensure_sum_6m
avg_ensure_value_12m
Then the data sets will be divided approximately as follows.
first part:
+--------------+--------------------+-------------+---------+---------+--------+--------------------+
| schema_from| table_from| column_from|link_type|schema_to|table_to| column_to|
+--------------+--------------------+-------------+---------+---------+--------+--------------------+
|custom_cib_stg|p_overall_part_te...| inn_num| direct| dbname1| table1| avg_ensure_sum_12m|
|custom_cib_stg|p_overall_part_te...|protocol_dttm| direct| dbname1| table1| avg_ensure_sum_12m|
|custom_cib_stg|p_overall_part_te...| inn_num| indirect| dbname1| table1| avg_ensure_sum_12m|
|custom_cib_stg|p_overall_part_te...|protocol_dttm| indirect| dbname1| table1| avg_ensure_sum_12m|
|custom_cib_stg|p_overall_part_te...| ensure_sum| direct| dbname1| table1| avg_ensure_sum_12m|
|custom_cib_stg|p_overall_part_te...| inn_num| indirect| dbname1| table1| avg_ensure_sum_3m|
|custom_cib_stg|p_overall_part_te...|protocol_dttm| indirect| dbname1| table1| avg_ensure_sum_3m|
|custom_cib_stg|p_overall_part_te...| ensure_sum| direct| dbname1| table1| avg_ensure_sum_3m|
|custom_cib_stg|p_overall_part_te...|protocol_dttm| direct| dbname1| table1| avg_ensure_sum_3m|
|custom_cib_stg|p_overall_part_te...| inn_num| direct| dbname1| table1| avg_ensure_sum_3m|
second part:
+--------------+--------------------+-------------+---------+---------+--------+--------------------+
| schema_from| table_from| column_from|link_type|schema_to|table_to| column_to|
+--------------+--------------------+-------------+---------+---------+--------+--------------------+
|custom_cib_stg|p_overall_part_te...| inn_num| indirect| dbname1| table1| avg_ensure_sum_6m|
|custom_cib_stg|p_overall_part_te...|protocol_dttm| indirect| dbname1| table1| avg_ensure_sum_6m|
|custom_cib_stg|p_overall_part_te...| inn_num| direct| dbname1| table1| avg_ensure_sum_6m|
|custom_cib_stg|p_overall_part_te...|protocol_dttm| direct| dbname1| table1| avg_ensure_sum_6m|
|custom_cib_stg|p_overall_part_te...| ensure_sum| direct| dbname1| table1| avg_ensure_sum_6m|
|custom_cib_stg|p_overall_part_te...| inn_num| indirect| dbname1| table1|avg_ensure_value_12m|
|custom_cib_stg|p_overall_part_te...|protocol_dttm| indirect| dbname1| table1|avg_ensure_value_12m|
|custom_cib_stg|p_overall_part_te...| ensure_value| direct| dbname1| table1|avg_ensure_value_12m|
|custom_cib_stg|p_overall_part_te...| inn_num| direct| dbname1| table1|avg_ensure_value_12m|
|custom_cib_stg|p_overall_part_te...|protocol_dttm| direct| dbname1| table1|avg_ensure_value_12m|
+--------------+--------------------+-------------+---------+---------+--------+--------------------+
The most important condition is that one group is located in one dataset. Help to assemble a successful algorithm.

So, i have put together a working solution.
case class DataLink(schema_from: String,
table_from: String,
column_from: String,
link_type: String,
schema_to: String,
table_to: String,
column_to: String)
val dataLinksDs = targetDataLineage.dataLinks.repartition(col("column_to")).persist
val targetGroups = dataLinksDs.groupBy("column_to")
.as[String, Long]
.count().collect().toMap
val groupsDsList: List[Dataset[DataLink]] = splitDataset(dataLinksDs, targetGroups)
groupsDsList.foreach(_.show())
private def splitDataset(ds: Dataset[DataLink], targetGroups: Map[String, Long]): List[Dataset[DataLink]] = {
if (targetGroups.values.sum <= 20000 || targetGroups.size == 1)
ds :: Nil
else {
val leftGroups = targetGroups.take(targetGroups.size / 2)
val rightGroups = targetGroups.takeRight(targetGroups.size - targetGroups.size / 2)
splitDataset(ds.filter(col("column_to") isin (leftGroups.keys.toList:_*)), leftGroups) ++
splitDataset(ds.filter(col("column_to") isin (rightGroups.keys.toList:_*)), rightGroups)
}
}

Related

Ionic Capacitor Build Error: Caused by: org.gradle.api.InvalidUserDataException: You must specify a URL for a Maven repository

I am trying to build my old project with all the latest versions of ionic, angular & capacitor here is my version list ( package.json )
"dependencies": {
"#angular/cdk": "^15.0.0",
"#angular/common": "^15.0.0",
"#angular/core": "^15.0.0",
"#angular/fire": "^5.2.1",
"#angular/forms": "^15.0.0",
"#angular/platform-browser": "^15.0.0",
"#angular/platform-browser-dynamic": "^15.0.0",
"#angular/router": "^15.0.0",
"#angular/service-worker": "^15.1.2",
"#capacitor-community/facebook-login": "^1.0.0",
"#capacitor/android": "^4.6.3",
"#capacitor/app": "4.1.1",
"#capacitor/camera": "^4.1.4",
"#capacitor/core": "4.6.2",
"#capacitor/geolocation": "^4.1.0",
"#capacitor/haptics": "4.1.0",
"#capacitor/ios": "^2.2.1",
"#capacitor/keyboard": "4.1.1",
"#capacitor/splash-screen": "^4.1.3",
"#capacitor/status-bar": "4.1.1",
"#ionic-native/app-availability": "^5.15.0",
"#ionic-native/app-rate": "^5.15.0",
"#ionic-native/appsflyer": "^5.31.1",
"#ionic-native/core": "^5.0.0",
"#ionic-native/diagnostic": "^5.24.0",
"#ionic-native/fcm": "^5.25.0",
"#ionic-native/firebase-x": "^5.25.0",
"#ionic-native/google-plus": "^5.15.0",
"#ionic-native/in-app-browser": "^5.24.0",
"#ionic-native/location-accuracy": "^5.24.0",
"#ionic-native/native-geocoder": "^5.22.0",
"#ionic-native/social-sharing": "^5.26.0",
"#ionic-native/splash-screen": "^5.0.0",
"#ionic-native/status-bar": "^5.0.0",
"#ionic-native/stripe": "^5.26.0",
"#ionic-super-tabs/angular": "^6.4.0",
"#ionic-super-tabs/core": "^6.4.0",
"#ionic/angular": "^6.1.9",
"#ionic/pwa-elements": "^1.5.2",
"#ionic/storage": "^2.2.0",
"#ngx-translate/core": "^11.0.1",
"#ngx-translate/http-loader": "^6.0.0",
"#turf/turf": "^5.1.6",
"#types/googlemaps": "^3.39.2",
"#types/jquery": "^3.3.36",
"angular-i18next": "^7.0.0",
"angularx-flatpickr": "^6.3.1",
"capacitor-apple-login": "git+https://github.com/rlfrahm/capacitor-apple-login.git",
"cordova-android": "^8.1.0",
"cordova-browser": "5.0.4",
"cordova-ios": "^5.1.1",
"cordova-plugin-androidx": "^3.0.0",
"cordova-plugin-androidx-adapter": "^1.1.3",
"cordova-plugin-appavailability": "^0.4.2",
"cordova-plugin-apprate": "^1.5.0",
"cordova-plugin-appsflyer-sdk": "^6.2.40",
"cordova-plugin-browsertab": "^0.2.0",
"cordova-plugin-buildinfo": "^4.0.0",
"cordova-plugin-compat": "^1.2.0",
"cordova-plugin-customurlscheme": "^4.4.0",
"cordova-plugin-dialogs": "^2.0.2",
"cordova-plugin-enable-multidex": "^0.2.0",
"cordova-plugin-firebasex": "^9.1.2",
"cordova-plugin-globalization": "^1.11.0",
"cordova-plugin-googleplus": "^8.4.0",
"cordova-plugin-inappbrowser": "^3.2.0",
"cordova-plugin-ionic-webview": "~4.1.3",
"cordova-plugin-nativestorage": "^2.3.2",
"cordova-plugin-whitelist": "~1.3.3",
"cordova-plugin-x-socialsharing": "^5.6.4",
"cordova-res": "^0.14.0",
"cordova-sqlite-storage": "^5.0.0",
"cordova-universal-links-plugin": "git+https://github.com/walteram/cordova-universal-links-plugin.git",
"core-js": "^2.5.4",
"es6-promise-plugin": "^4.2.2",
"firebase": "^7.1.0",
"flatpickr": "^4.6.3",
"i18next": "^19.0.3",
"i18next-browser-languagedetector": "^4.0.1",
"i18next-xhr-backend": "^3.2.2",
"ionicons": "^6.0.3",
"jquery": "^3.5.0",
"leaflet": "^1.6.0",
"ngx-quill": "^8.0.0",
"ngx-virtual-scroller": "^3.0.3",
"quill": "^1.3.7",
"rxjs": "~7.5.0",
"sharp": "^0.25.2",
"text-mask-core": "^5.1.2",
"tslib": "^2.3.0",
"underscore": "^1.10.2",
"uuid": "^8.0.0",
"zone.js": "~0.11.4"
},
"devDependencies": {
"#angular-devkit/build-angular": "^15.0.0",
"#angular-eslint/builder": "^14.0.0",
"#angular-eslint/eslint-plugin": "^14.0.0",
"#angular-eslint/eslint-plugin-template": "^14.0.0",
"#angular-eslint/template-parser": "^14.0.0",
"#angular/cli": "^15.0.0",
"#angular/compiler": "^15.0.0",
"#angular/compiler-cli": "^15.0.0",
"#angular/language-service": "^15.0.0",
"#capacitor/cli": "4.6.2",
"#ionic/angular-toolkit": "^6.0.0",
"#types/jasmine": "~4.0.0",
"#types/node": "^12.11.1",
"#typescript-eslint/eslint-plugin": "5.3.0",
"#typescript-eslint/parser": "5.3.0",
"codelyzer": "^5.0.0",
"cordova-plugin-ionic-webview": "^4.1.3",
"cordova-plugin-whitelist": "^1.3.4",
"jasmine-core": "~4.3.0",
"jasmine-spec-reporter": "~5.0.0",
"jetifier": "^2.0.0",
"karma": "~6.4.0",
"karma-chrome-launcher": "~3.1.0",
"karma-coverage": "~2.2.0",
"karma-coverage-istanbul-reporter": "~3.0.2",
"karma-jasmine": "~5.1.0",
"karma-jasmine-html-reporter": "~2.0.0",
"moment": "^2.25.3",
"protractor": "~5.4.0",
"ts-node": "~8.3.0",
"tslint": "~5.15.0",
"typescript": "~4.8.4"
},
Blow is the error that I see in android studio
Caused by: org.gradle.api.InvalidUserDataException: You must specify a URL for a Maven repository.

ngx-image-cropper: Doesn't work into ionic modal view

I have a problem using ngx-image-cropper into an ionic modal view.
It's a headache.
If a call a view normally by route, it works.
I look for a solution or at least some one with the problem and nothing.
I am using:
"dependencies": {
"#angular/common": "^14.0.0",
"#angular/core": "^14.1.0",
"#angular/forms": "^14.0.0",
"#angular/platform-browser": "^14.0.0",
"#angular/platform-browser-dynamic": "^14.0.0",
"#angular/router": "^14.0.0",
"#capacitor/android": "3.6.0",
"#capacitor/app": "1.1.1",
"#capacitor/camera": "^1.3.1",
"#capacitor/core": "3.6.0",
"#capacitor/device": "^1.1.2",
"#capacitor/haptics": "1.1.4",
"#capacitor/ios": "3.6.0",
"#capacitor/keyboard": "1.2.3",
"#capacitor/status-bar": "1.0.8",
"#capacitor/storage": "^1.2.5",
"#capacitor/toast": "^1.0.8",
"#ionic-native/call-number": "^5.36.0",
"#ionic/angular": "^6.2.0",
"#ionic/pwa-elements": "^3.1.1",
"call-number": "^1.0.1",
"hammerjs": "^2.0.8",
"ngx-image-cropper": "^6.2.2",
"rendered-country-flags": "^1.2.1",
"rxjs": "~6.6.0",
"tslib": "^2.2.0",
"zone.js": "~0.11.4"
},
"devDependencies": {
"#angular-devkit/build-angular": "^14.0.0",
"#angular-eslint/builder": "~13.0.1",
"#angular-eslint/eslint-plugin": "~13.0.1",
"#angular-eslint/eslint-plugin-template": "~13.0.1",
"#angular-eslint/template-parser": "~13.0.1",
"#angular/cli": "^14.0.0",
"#angular/compiler": "^14.0.0",
"#angular/compiler-cli": "^14.0.0",
"#angular/language-service": "^14.0.0",
"#capacitor/cli": "3.6.0",
"#ionic/angular-toolkit": "^6.1.0",
"#ionic/lab": "3.2.13",
"#types/jasmine": "~3.6.0",
"#types/jasminewd2": "~2.0.3",
"#types/node": "^12.11.1",
"#typescript-eslint/eslint-plugin": "5.3.0",
"#typescript-eslint/parser": "5.3.0",
"eslint": "^7.6.0",
"eslint-plugin-import": "2.22.1",
"eslint-plugin-jsdoc": "30.7.6",
"eslint-plugin-prefer-arrow": "1.2.2",
"jasmine-core": "~3.8.0",
"jasmine-spec-reporter": "~5.0.0",
"karma": "~6.3.2",
"karma-chrome-launcher": "~3.1.0",
"karma-coverage": "~2.0.3",
"karma-coverage-istanbul-reporter": "~3.0.2",
"karma-jasmine": "~4.0.0",
"karma-jasmine-html-reporter": "^1.5.0",
"protractor": "~7.0.0",
"ts-node": "~8.3.0",
"typescript": "~4.7.3"
},
Into Ionic 6.20.0
I encapsulate the cropper call into a service that manages camera or gallery photo and pass it to cropper modal view.

No visible #interface for 'FIRTrace' declares the selector 'incrementCounterNamed'. FirebasePlugin.m

I have this problem reported in the title, I can't build my app on my iOS, it's the only error that happens.
No visible #interface for 'FIRTrace' declares the selector 'incrementCounterNamed'. FirebasePlugin.m
image error
this is my package.json
{
"dependencies": {
"#angular/common": "^7.2.2",
"#angular/core": "^7.2.15",
"#angular/forms": "^7.2.2",
"#angular/http": "^7.2.2",
"#angular/platform-browser": "^7.2.2",
"#angular/platform-browser-dynamic": "^7.2.2",
"#angular/router": "^7.2.2",
"#ionic-native/app-version": "^5.1.0",
"#ionic-native/base64-to-gallery": "^5.14.0",
"#ionic-native/core": "^5.0.0",
"#ionic-native/device": "^5.2.0",
"#ionic-native/firebase": "^5.3.0",
"#ionic-native/in-app-browser": "^5.15.1",
"#ionic-native/ionic-webview": "^5.1.0",
"#ionic-native/keyboard": "^5.1.0",
"#ionic-native/network": "^5.1.0",
"#ionic-native/push": "^5.2.0",
"#ionic-native/safari-view-controller": "^5.15.1",
"#ionic-native/splash-screen": "^5.0.0",
"#ionic-native/status-bar": "^5.0.0",
"#ionic-native/unique-device-id": "^5.1.0",
"#ionic/angular": "^4.0.0",
"#ionic/storage": "^2.2.0",
"angularfire2": "^5.1.2",
"chart.js": "^2.8.0",
"chartjs-plugin-datalabels": "^0.7.0",
"cordova-android": "^8.0.0",
"cordova-base64-to-gallery": "^4.1.3",
"cordova-ios": "^5.1.1",
"cordova-lib": "^9.0.1",
"cordova-plugin-androidx": "^1.0.2",
"cordova-plugin-androidx-adapter": "^1.1.0",
"cordova-plugin-app-version": "0.1.9",
"cordova-plugin-device": "2.0.2",
"cordova-plugin-firebase": "2.0.5",
"cordova-plugin-inappbrowser": "3.0.0",
"cordova-plugin-ionic-keyboard": "2.1.3",
"cordova-plugin-ionic-webview": "^4.1.1",
"cordova-plugin-network-information": "2.0.1",
"cordova-plugin-safariviewcontroller": "^1.6.0",
"cordova-plugin-splashscreen": "^5.0.3",
"cordova-plugin-statusbar": "2.4.2",
"cordova-plugin-uniquedeviceid": "1.3.2",
"cordova-plugin-whitelist": "1.3.3",
"cordova-sqlite-storage": "3.0.0",
"cordova-support-android-plugin": "1.0.1",
"cordova-support-google-services": "1.1.0",
"core-js": "^2.5.4",
"firebase": "^5.9.2",
"phonegap-plugin-multidex": "1.0.0",
"phonegap-plugin-push": "2.2.3",
"rxjs": "~6.3.3",
"rxjs-compat": "^6.4.0",
"sw-toolbox": "^3.6.0",
"zone.js": "~0.8.29"
},
"devDependencies": {
"#angular-devkit/architect": "~0.12.3",
"#angular-devkit/build-angular": "~0.12.3",
"#angular-devkit/core": "~7.2.3",
"#angular-devkit/schematics": "~7.2.3",
"#angular/cli": "~7.2.3",
"#angular/compiler": "~7.2.2",
"#angular/compiler-cli": "~7.2.2",
"#angular/language-service": "~7.2.2",
"#compodoc/compodoc": "^1.1.9",
"#ionic/angular-toolkit": "~1.4.0",
"#ionic/app-scripts": "^3.2.2",
"#types/chart.js": "^2.8.5",
"#types/jasmine": "~2.8.8",
"#types/jasminewd2": "~2.0.3",
"#types/node": "~10.12.0",
"codelyzer": "~4.5.0",
"cordova-android-support-gradle-release": "~3.0.1",
"cordova-plugin-add-swift-support": "~2.0.2",
"cordova-plugin-firebasex": "~6.0.2",
"cordova-plugin-speechrecognition": "^1.2.0",
"jasmine-core": "~2.99.1",
"jasmine-spec-reporter": "~4.2.1",
"karma": "~3.1.4",
"karma-chrome-launcher": "~2.2.0",
"karma-coverage-istanbul-reporter": "~2.0.1",
"karma-jasmine": "~1.1.2",
"karma-jasmine-html-reporter": "^0.2.2",
"protractor": "~5.4.0",
"ts-node": "~8.0.0",
"tslint": "~5.12.0",
"typescript": "~3.1.6",
"xcode": "^2.0.0"
},
"description": "An Ionic project",
"cordova": {
"plugins": {
"cordova-plugin-app-version": {},
"cordova-plugin-device": {},
"cordova-plugin-ionic-keyboard": {},
"cordova-plugin-network-information": {},
"cordova-sqlite-storage": {},
"cordova-plugin-uniquedeviceid": {},
"cordova-plugin-whitelist": {},
"cordova-plugin-statusbar": {},
"cordova-plugin-firebase": {},
"phonegap-plugin-push": {
"ANDROID_SUPPORT_V13_VERSION": "27.+",
"FCM_VERSION": "11.6.2"
},
"cordova-plugin-inappbrowser": {},
"cordova-plugin-androidx": {},
"cordova-plugin-androidx-adapter": {},
"cordova-plugin-speechrecognition": {},
"cordova-android-support-gradle-release": {
"ANDROID_SUPPORT_VERSION": "27.+"
},
"cordova-plugin-firebasex": {},
"cordova-plugin-add-swift-support": {},
"cordova-plugin-ionic-webview": {
"ANDROID_SUPPORT_ANNOTATIONS_VERSION": "27.+"
},
"cordova-plugin-splashscreen": {},
"cordova-base64-to-gallery": {},
"cordova-plugin-safariviewcontroller": {}
}
}
}
I Tried to update my pods and deintegrate, cache clean, but don't works.
Thank you all

How to solve Source path does not exist: resources/android/xml/network_security_config.xml

I do build with ionic 4.
ionic cordova build android
Got this error
cordova build android
Source path does not exist:
resources/android/xml/network_security_config.xml [ERROR] An error
occurred while running subprocess cordova.
I removed this part from config.xml. Is it fine?
<edit-config file="app/src/main/AndroidManifest.xml" mode="merge" target="/manifest/application" xmlns:android="http://schemas.android.com/apk/res/android">
<application android:networkSecurityConfig="#xml/network_security_config" />
</edit-config>
<resource-file src="resources/android/xml/network_security_config.xml" target="app/src/main/res/xml/network_security_config.xml" />
package.json
{
"name": "morenito",
"version": "0.0.1",
"author": "Ionic Framework",
"homepage": "https://ionicframework.com/",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
},
"private": true,
"dependencies": {
"#angular/animations": "~8.0.1",
"#angular/cdk": "8.0.1",
"#angular/material": "8.0.1",
"#angular/common": "~8.1.2",
"#angular/compiler": "~8.1.2",
"#angular/core": "~8.1.2",
"#angular/forms": "~8.1.2",
"#angular/http": "^7.2.2",
"#angular/platform-browser": "~8.1.2",
"#angular/platform-browser-dynamic": "~8.1.2",
"#angular/router": "~8.1.2",
"#ionic-native/base64": "^5.5.1",
"#ionic-native/base64-to-gallery": "^5.6.0",
"#ionic-native/camera": "^5.10.0",
"#ionic-native/camera-preview": "^5.4.0",
"#ionic-native/core": "^5.0.0",
"#ionic-native/file": "^5.4.0",
"#ionic-native/file-chooser": "^5.4.0",
"#ionic-native/file-path": "^5.5.1",
"#ionic-native/file-transfer": "^5.5.1",
"#ionic-native/image-picker": "^5.5.1",
"#ionic-native/splash-screen": "^5.0.0",
"#ionic-native/status-bar": "^5.0.0",
"#ionic/angular": "^4.7.1",
"browser": "^0.2.6",
"cordova-android": "^8.0.0",
"cordova-plugin-camera": "^4.1.0",
"cordova-plugin-ionic-webview": "^4.1.1",
"cordova-plugin-telerik-imagepicker": "^2.3.3",
"core-js": "^2.5.4",
"hammerjs": "^2.0.8",
"highcharts": "^7.1.1",
"highcharts-angular": "^2.4.0",
"highcharts-more": "^0.1.7",
"highcharts-more-node": "^5.0.13",
"moment": "^2.24.0",
"ng2-charts": "^2.0.3",
"rxjs": "~6.5.1",
"tslib": "^1.9.0",
"zone.js": "~0.9.1"
},
"devDependencies": {
"#angular-devkit/architect": "~0.801.2",
"#angular-devkit/build-angular": "~0.801.2",
"#angular-devkit/core": "~8.1.2",
"#angular-devkit/schematics": "~8.1.2",
"#angular/cli": "~8.1.2",
"#angular/compiler": "~8.1.2",
"#angular/compiler-cli": "~8.1.2",
"#angular/language-service": "~8.1.2",
"#ionic/angular-toolkit": "~2.0.0",
"#types/jasmine": "~3.3.8",
"#types/jasminewd2": "~2.0.3",
"#types/node": "~8.9.4",
"codelyzer": "^5.0.0",
"cordova-plugin-device": "^2.0.2",
"cordova-plugin-ionic-keyboard": "^2.1.3",
"cordova-plugin-splashscreen": "^5.0.2",
"cordova-plugin-statusbar": "^2.4.2",
"cordova-plugin-whitelist": "^1.3.3",
"jasmine-core": "~3.4.0",
"jasmine-spec-reporter": "~4.2.1",
"karma": "~4.1.0",
"karma-chrome-launcher": "~2.2.0",
"karma-coverage-istanbul-reporter": "~2.0.1",
"karma-jasmine": "~2.0.1",
"karma-jasmine-html-reporter": "^1.4.0",
"protractor": "~5.4.0",
"ts-node": "~7.0.0",
"tslint": "~5.15.0",
"typescript": "~3.4.3"
}
,
"description": "An Ionic project",
"cordova": {
"plugins": {
"cordova-plugin-whitelist": {},
"cordova-plugin-statusbar": {},
"cordova-plugin-device": {},
"cordova-plugin-splashscreen": {},
"cordova-plugin-ionic-webview": {
"ANDROID_SUPPORT_ANNOTATIONS_VERSION": "27.+"
},
"cordova-plugin-ionic-keyboard": {},
"cordova-plugin-telerik-imagepicker": {},
"cordova-plugin-camera": {
"ANDROID_SUPPORT_V4_VERSION": "27.+"
}
},
"platforms": [
"android"
]
}
}
FOR VALIDATOR ONLY: Is it a stackoverflow or an art competition? Hello validator - you bother me day by day. This post contains enough of text.
Examine the resources folder if the xml folder exists in /android, if it doesn't just create it like..
resources/
android/
xml/
network_security_config.xml
Enter the following inside the file
<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
<domain-config cleartextTrafficPermitted="true">
<domain includeSubdomains="true">localhost</domain>
</domain-config>
</network-security-config>
I also got that error check this
https://github.com/ionic-team/starters/issues/758
in android platform in ionic
<platform name="android">
<edit-config file="AndroidManifest.xml" mode="merge" target="/manifest/application" xmlns:android="http://schemas.android.com/apk/res/android">
<application android:networkSecurityConfig="#xml/network_security_config" />
</edit-config>
<resource-file src="resources/android/xml/network_security_config.xml" target="res/xml/network_security_config.xml" />
<allow-intent href="market:*" />
within your project: resources => android => create folder "xml" create file.xml:
network_security_config.xml
<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
<domain-config cleartextTrafficPermitted="true">
<domain includeSubdomains="true">localhost</domain>
</domain-config>
</network-security-config>`
H guys, I did have also this problem, my fix to It was, in config.xml remove this line <resource-file src="resources/android/xml/network_security_config.xml" target="app/src/main/res/xml/network_security_config.xml" /> and It works for me.

React project showing babel plugin errors on Codeship

Attempting to set up my react starter kit project to have CI on codeship, and the project works fine locally. I'm getting the following error ReferenceError: Unknown plugin "syntax-trailing-function-commas" specified.. when I'm attempting to run npm test on codeship.
My test command
mocha --require babel-register
How do I need to configure the codeship environment to get this to work?
package.json
...
"babel": {
"presets": [
"react",
"stage-0"
],
"plugins": [
"syntax-trailing-function-commas",
"transform-async-to-generator",
"transform-es2015-destructuring",
"transform-es2015-parameters",
"transform-es2015-duplicate-keys",
"transform-es2015-modules-commonjs",
"transform-exponentiation-operator",
"transform-runtime"
],
"env": {
"test": {
"plugins": [
"rewire"
]
}
}
},
"dependencies": {
"apollo-client": "^0.5.20",
"babel-polyfill": "6.16.0",
"babel-runtime": "6.18.0",
"bluebird": "3.4.6",
"body-parser": "1.15.2",
"braintree": "^1.46.0",
"classnames": "^2.2.5",
"cookie-parser": "1.4.3",
"core-js": "2.4.1",
"express": "4.14.0",
"express-graphql": "0.6.1",
"express-jwt": "5.1.0",
"fastclick": "1.0.6",
"fbjs": "0.8.6",
"front-matter": "2.1.1",
"graphql": "0.8.2",
"graphql-tag": "^1.1.2",
"history": "4.4.0",
"isomorphic-fetch": "^2.2.1",
"isomorphic-style-loader": "1.1.0",
"jsonwebtoken": "7.1.9",
"markdown-it": "8.1.0",
"moment": "^2.17.1",
"node-fetch": "1.6.3",
"normalize.css": "5.0.0",
"passport": "0.3.2",
"passport-auth0": "^0.6.0",
"passport-facebook": "2.1.1",
"pretty-error": "2.0.2",
"query-string": "4.2.3",
"react": "15.4.1",
"react-apollo": "^0.7.1",
"react-dom": "15.4.1",
"react-redux": "4.4.5",
"react-slick": "^0.14.5",
"react-stack-grid": "^0.1.1",
"redux": "3.6.0",
"redux-actions": "^1.1.0",
"redux-form": "^6.3.2",
"redux-logger": "2.7.4",
"redux-thunk": "2.1.0",
"serialize-javascript": "1.3.0",
"source-map-support": "0.4.6",
"speakingurl": "11.0.0",
"universal-router": "2.0.0",
"uploadcare-widget": "^2.10.2",
"whatwg-fetch": "2.0.1",
"xml2js": "^0.4.17"
},
"devDependencies": {
"assets-webpack-plugin": "^3.5.0",
"autoprefixer": "^6.5.3",
"babel-cli": "^6.18.0",
"babel-core": "^6.18.2",
"babel-eslint": "^7.1.1",
"babel-loader": "^6.2.8",
"babel-plugin-rewire": "^1.0.0",
"babel-plugin-transform-runtime": "^6.15.0",
"babel-preset-latest": "^6.16.0",
"babel-preset-react": "^6.16.0",
"babel-preset-react-optimize": "^1.0.1",
"babel-preset-stage-0": "^6.16.0",
"babel-register": "^6.18.0",
"babel-template": "^6.16.0",
"babel-types": "^6.19.0",
"browser-sync": "^2.18.2",
"chai": "^3.5.0",
"css-loader": "^0.26.0",
"enzyme": "^2.6.0",
"eslint": "^3.10.2",
"eslint-config-airbnb": "^13.0.0",
"eslint-loader": "^1.6.1",
"eslint-plugin-import": "^2.2.0",
"eslint-plugin-jsx-a11y": "^2.2.3",
"eslint-plugin-react": "^6.7.1",
"extend": "^3.0.0",
"file-loader": "^0.9.0",
"gaze": "^1.1.2",
"git-repository": "^0.1.4",
"glob": "^7.1.1",
"json-loader": "^0.5.4",
"mkdirp": "^0.5.1",
"mocha": "^3.1.2",
"pixrem": "^3.0.2",
"pleeease-filters": "^3.0.0",
"postcss": "^5.2.5",
"postcss-calc": "^5.3.1",
"postcss-color-function": "^2.0.1",
"postcss-custom-media": "^5.0.1",
"postcss-custom-properties": "^5.0.1",
"postcss-custom-selectors": "^3.0.0",
"postcss-flexbugs-fixes": "^2.0.0",
"postcss-loader": "^1.1.1",
"postcss-media-minmax": "^2.1.2",
"postcss-nested": "^1.0.0",
"postcss-nesting": "^2.3.1",
"postcss-partial-import": "^2.1.0",
"postcss-pseudoelements": "^3.0.0",
"postcss-selector-matches": "^2.0.5",
"postcss-selector-not": "^2.0.0",
"postcss-url": "^5.1.2",
"raw-loader": "^0.5.1",
"react-addons-test-utils": "15.4.0",
"react-deep-force-update": "^2.0.1",
"react-hot-loader": "^3.0.0-beta.6",
"redbox-react": "^1.3.3",
"redux-mock-store": "^1.2.1",
"rimraf": "^2.5.4",
"sinon": "^2.0.0-pre.3",
"stylelint": "^7.6.0",
"stylelint-config-standard": "^15.0.0",
"url-loader": "^0.5.7",
"webpack": "^1.13.3",
"webpack-hot-middleware": "^2.13.2",
"webpack-middleware": "^1.5.1"
},