Module 'SquareReaderSDK' not found 'react-native-square-reader-sdk ' in react native - xcode

native-square-reader-sdk** for payments in my project.
iOS build is failing due to "Module 'SquareReaderSDK' not found"
package.json
"dependencies": {
"#react-native-community/async-storage": "^1.6.1",
"react": "16.9.0",
"react-native": "0.60.5",
"react-native-camera-kit": "^8.0.1",
"react-native-gesture-handler": "^1.4.1",
"react-native-globalize": "^3.0.0",
"react-native-permissions": "^1.2.0",
"react-native-square-reader-sdk": "1.3.0",
"react-navigation": "^3.11.1",
"react-native-webview": "7.0.5",
"react-native-star-prnt": "1.1.0",
"base-64": "0.1.0"
},
how to solve this ?
thanks

please follow the following steps to install SquareReaderSDK
Steps for SquareSDK Installation

Related

Netlify deployment

I am trying to deploy a git repo on Netlify and I am using parcel in the project.
I am getting the error in the photo about conflicting local requirement.
This is how my dependencies and devDependencies look like:
"dependencies": {
"axios": "^0.21.1",
"bootstrap": "^5.1.0",
"parcel": "^2.0.0-rc.0",
"react": "^17.0.2",
"react-bootstrap": "^1.6.1",
"react-dom": "^17.0.2",
"react-redux": "^7.2.4",
"react-router-dom": "^5.2.0",
"redux": "^4.1.1",
"redux-devtools-extension": "^2.13.9"
},
"devDependencies": {
"#parcel/transformer-sass": "^2.0.0-beta.3.1"
}
}
and I am getting the error in the photo
Any tip on how to resolve this ?? thanks
Ok solved,
just had to remove parcel as a dependency!

Execution failed for task ':app:transformClassesWithMultidexlistForDebug'. ( INotificationSideChannel$Stub$Proxy ? )

My Nativescript-Vue project has stopped working without reason, i don't know why.
The gradle build is crashing with this error :
D8: Program type already present: android.support.v4.app.INotificationSideChannel$Stub$Proxy
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:transformClassesWithMultidexlistForDebug'.
> com.android.build.api.transform.TransformException: Error while generating the main dex list:
Error while merging dex archives:
Learn how to resolve the issue at https://developer.android.com/studio/build/dependencies#duplicate_classes.
Program type already present: android.support.v4.app.INotificationSideChannel$Stub$Proxy
I don't know anything about native android developpment with java so i'm struggling with this error since many hours ..
Here is my app.graddle
apply plugin: "com.android.application"
apply plugin: "com.google.gms.google-services"
dependencies {
configurations.all {
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
def requested = details.requested
if (requested.group == 'com.android.support' && requested.name != 'multidex' ) {
details.useVersion '27.1.1'
}
}
}
}
dependencies {
implementation 'org.slf4j:slf4j-nop:1.7.25'
}
android {
defaultConfig {
multiDexEnabled true
generatedDensities = []
applicationId = "org.nativescript.application"
project.ext {
googlePlayServicesVersion = "+"
}
}
aaptOptions {
additionalParameters "--no-version-vectors"
}
}
and my package.json in case of this error is caused by one nativescript-plugin, which is what I think :
{
"name": "app",
"version": "1.21",
"license": "MIT",
"nativescript": {
"id": "org.nativescript.application",
"tns-ios": {
"version": "5.3.1"
},
"tns-android": {
"version": "5.3.1"
}
},
"scripts": {
"dev:android": "tns debug android --bundle",
"dev:ios": "tns debug ios --bundle",
"lint": "eslint --ext .js,.vue .",
"run:android": "tns run android --bundle",
"run:ios": "tns run ios --bundle",
"clean": "tns platform clean ios; tns platform clean android"
},
"dependencies": {
"axios": "^0.18.0",
"dotenv-webpack": "^1.7.0",
"nativescript": "^5.2.4",
"nativescript-applozic-chat": "^1.2.4",
"nativescript-appversion": "^1.4.1",
"nativescript-barcodescanner": "^3.0.3",
"nativescript-camera": "^4.2.0",
"nativescript-cardview": "^3.1.1",
"nativescript-checkbox": "^3.0.3",
"nativescript-floatingactionbutton": "^5.0.0",
"nativescript-geolocation": "^4.4.2",
"nativescript-google-maps-sdk": "^2.7.0",
"nativescript-google-places-autocomplete": "^1.0.3",
"nativescript-iqkeyboardmanager": "^1.4.0",
"nativescript-keyboard-toolbar": "^1.0.4",
"nativescript-laravel-echo": "^1.0.1",
"nativescript-lottie": "^3.0.2",
"nativescript-modal-datetimepicker": "^1.1.12",
"nativescript-oauth2": "^1.4.1",
"nativescript-pager": "^9.3.14",
"nativescript-phone": "^1.4.0",
"nativescript-plugin-firebase": "^8.1.1",
"nativescript-plugin-gplaces": "^2.4.6",
"nativescript-vue": "^2.0.0",
"nativescript-websockets": "^1.5.3",
"nativescript-windowed-modal": "^5.0.6",
"promise.prototype.finally": "^3.1.0",
"pusher-nativescript": "^1.0.0",
"tns-android": "^5.2.1",
"tns-core-modules": "^5.2.2",
"tns-ios": "^5.2.0",
"ts-loader": "^5.3.3",
"vue-i18n": "^8.9.0",
"vuelidate": "^0.7.4",
"vuex": "^3.0.1"
},
"devDependencies": {
"#babel/core": "^7.0.0",
"#babel/plugin-proposal-class-properties": "^7.4.4",
"#babel/preset-env": "^7.0.0",
"#vue/eslint-config-prettier": "^4.0.1",
"babel-eslint": "^10.0.1",
"babel-loader": "^8.0.2",
"babel-traverse": "6.26.0",
"babel-types": "6.26.0",
"babylon": "6.18.0",
"base-64": "^0.1.0",
"clean-webpack-plugin": "^1.0.1",
"copy-webpack-plugin": "^4.5.2",
"css-loader": "^1.0.0",
"date-fns": "^1.30.1",
"eslint": "^5.12.1",
"eslint-config-prettier": "^4.1.0",
"eslint-plugin-prettier": "^3.0.1",
"eslint-plugin-vue": "^5.1.0",
"lazy": "1.0.11",
"lodash": "^4.17.11",
"nativescript-dev-typescript": "^0.9.0",
"nativescript-dev-webpack": "^0.21.0-next-2019-02-15-084520-01",
"nativescript-image-cache-it": "^4.1.2",
"nativescript-vue-template-compiler": "^2.0.0",
"node-sass": "^4.9.2",
"prettier": "^1.16.1",
"sass-loader": "^7.1.0",
"terser-webpack-plugin": "^1.1.0",
"tns-platform-declarations": "^5.2.2",
"utf8": "^3.0.0",
"vue-loader": "^15.2.6",
"webpack": "^4.16.4",
"webpack-bundle-analyzer": "~3.0.4",
"webpack-cli": "^3.1.0"
}
}
I tried multiple things :
rm -rf hooks/ platforms/ node_modules/ package-lock.json and recompile the whole project
remove the whole .gradle directory in C:/Users/username/ and recompile
uninstall java, and nativescript cli ( tns ) that is globally install, reinstall and recompile
uninstall android-sdk installed with chocolatey in C:/Android, as asked in the nativescript doc, and recompile
tns platform clean android
reclone my project and try to recompile
I'm so desperate that I also created a docker image for nativescript-vue and android to be sure that the error is not related to my computer configuration/environnement, and the error is still here ...
I tried to compile a blank project created with :
vue init nativescript-vue/vue-cli-template
And it's working.
Also, my coworkers can compile the project so it's incomprehensible. My project is the same as theirs, i recloned the project to be sure and they have no not commited files...
I found that the error was caused by this package : "nativescript-google-maps-sdk". Maybe one of the only that i havn't uninstall to see if it was responsible of this error....
Anyway, you can found how i resolved this issue here :
https://github.com/dapriett/nativescript-google-maps-sdk/issues/345#issuecomment-503321201

Upgrade Laravel Mix to Use Babel 7

I need to update Laravel mix to use Babel 7.
I update my dependencies to use Laravel Mix 4.0.7 that should support Babel 7.
"devDependencies": {
"#babel/core": "^7.2.2",
"#babel/plugin-proposal-class-properties": "^7.2.1",
"#babel/preset-env": "^7.2.0",
"#babel/preset-react": "^7.0.0",
"axios": "^0.15.3",
"babel-loader": "^7.1.5",
"bootstrap": "4.1.3",
"browser-sync": "^2.26.3",
"browser-sync-webpack-plugin": "^2.0.1",
"jquery": "^3.1.1",
"laravel-mix": "^4.0.7",
"less": "^3.9.0",
"less-loader": "^4.1.0",
"lodash": "^4.17.10",
"react-color": "^2.14.1",
"resolve-url-loader": "^2.3.1",
"sass": "^1.15.2",
"sass-loader": "^7.1.0",
"styled-components": "^4.0.3",
"vue": "^2.5.13"
}
And in my .babelrc file i have:
{
"loader": "babel-loader",
"presets": ["#babel/preset-env", "#babel/preset-react"],
"plugins": [
"#babel/plugin-proposal-object-rest-spread",
"#babel/plugin-proposal-class-properties",
"#babel/plugin-transform-react-jsx"
]
}
And in my webpack.mix.js i have:
mix.react("resources/assets/app.js", "public/js");
The problem is when i run npm run watch i get the following error:
Module build failed (from ./node_modules/babel-loader/lib/index.js):
Error: Cannot find module 'babel-core'
Apparently, Laravel Mix is trying to use babel-core instead of #babel/core.
Any ideas on how to solve this?
I believe you need to upgrade babel-loader to 8.x.
If you read the docs at https://www.npmjs.com/package/babel-loader
This README is for babel-loader v8 + Babel v7
Check the 7.x branch for docs with Babel v6
So, babel-loader 8.x work with #babel-core 7. babel-loader 7.x works with babel-core 6.x

React Native Error: Ambiguous resolution

When I try to run my React Native app on the iOS simulator, I'm presented with a red screen with the following error:
Ambiguous resolution: module
'/Users/my-user/Documents/my-RN-app/app/index.js' tries to require
'react-native-vector-icons', but there are several files providing
this module. You can delete or fix them:
/Users/my-user/Documents/my-RN-app/ios/build/Build/Products/Debug-iphonesimulator/MyApp.app/my-RN-app/node_modules/react-native/local-cli/core/__fixtures__/files/package.json
/Users/my-user/Documents/my-RN-app/node_modules/react-native/local-cli/core/__fixtures__/files/package.json
However, both of those above files (the package.json files) are missing. I had actually gotten this error before, so I decided to delete the package.json file in the first directory location mentioned above (under ios/build/.. etc.) and refreshed the app and it loaded just fine. Now, after trying to start up my app again in the iOS simulator, I am back to the same error, but I cannot delete the package.json file because it doesn't even exist now in either location.
I've tried to just comment out the import of the react-native-vector-icons lib in my app/index.js file and restarting the sim, but the error still appears.
So finally, I've tried this:
sudo rm -rf node_modules (I get "permission denied" if I don't use sudo although it appears I have full read/write permission on all the files/folders in this project)
sudo rm -rf ios/build
npm install
cd ios && pod install
react-native link
And then back into Xcdoe: Product > Clean, after which I ran the simulator again. Still the same error.
As requested, here is my package.json file:
{
"name": "myApp",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
"run-ios": "node_modules/.bin/react-native run-ios",
},
"dependencies": {
"art": "^0.10.1",
"auto-bind": "^1.1.0",
"axios": "^0.16.1",
"eslint-plugin-react-native": "^2.3.1",
"jwt-decode": "^2.2.0",
"moment": "^2.19.1",
"native-base": "^2.3.1",
"prop-types": "^15.5.8",
"pubnub": "^4.18.0",
"react": "^16.0.0",
"react-native": "^0.49.3",
"react-native-actionsheet": "^2.3.0",
"react-native-device-info": "^0.11.0",
"react-native-fabric": "^0.5.1",
"react-native-fingerprint-scanner": "^2.2.1",
"react-native-flip-card": "^3.5.2",
"react-native-google-analytics-bridge": "^5.3.3",
"react-native-haptic": "^1.0.5",
"react-native-image-base64": "^0.1.3",
"react-native-image-picker": "^0.26.7",
"react-native-image-resizer": "^1.0.0",
"react-native-keyboard-aware-scroll-view": "^0.4.3",
"react-native-keyboard-spacer": "^0.4.1",
"react-native-keychain": "^1.2.1",
"react-native-maps": "^0.17.1",
"react-native-modal-dropdown": "^0.5.0",
"react-native-mplayer": "^1.0.1",
"react-native-notifications-badge-extensions": "^1.0.5",
"react-native-permissions": "^0.2.7",
"react-native-pie": "^0.4.0",
"react-native-router-flux": "^4.0.0-beta.26",
"react-native-snap-carousel": "^3.2.3",
"react-native-tag-input": "0.0.18",
"react-native-tooltip": "^5.2.0",
"react-native-uuid-generator": "^3.0.2",
"react-native-vector-icons": "^4.3.0",
"react-native-version-number": "^0.1.3",
"react-native-voice": "^0.2.5",
"react-navigation": "^1.2.0",
"sprintf-js": "^1.0.3",
"validator": "^9.2.0"
},
"devDependencies": {
"babel-jest": "18.0.0",
"babel-preset-react-native": "^4.0.0",
"enzyme": "^3.3.0",
"enzyme-adapter-react-16": "^1.1.1",
"enzyme-to-json": "^3.3.1",
"eslint": "^3.14.1",
"eslint-config-airbnb": "^14.1.0",
"eslint-plugin-import": "^2.2.0",
"eslint-plugin-jsx-a11y": "^4.0.0",
"eslint-plugin-react": "^7.5.1",
"jest": "18.1.0",
"jest-serializer-enzyme": "^1.0.0",
"jsdom": "11.6.2",
"jsdom-global": "3.0.2",
"metro-bundler": "^0.20.0",
"react-addons-test-utils": "^15.6.2",
"react-dom": "^16.2.0",
"react-native-mock": "^0.3.1",
"react-test-renderer": "16.0.0-alpha.12",
"sinon": "^4.1.2"
},
"resolutions": {
"moment": "2.19.1"
}
}
I had to manually link the React pod to node_modules:
pod 'React', :path => '../node_modules/react-native'
Then clean and build again

awesome-typescript-loader throws on either OSX or Ubuntu, with different versions

I have two strange errors; two different versions of awesome-typescript-loader throws errors on one OS(Ubuntu) and not on another(OSX), and vica verca - if I upgrade.
Case 1:
"awesome-typescript-loader": "3.1.0",
On OSX, it will throw this error:
[at-loader] Checking finished with 1 errors
[at-loader]: Child process failed to process the request: TypeError: Cannot read property '0' of undefined
Then we think: OK, let's upgrade to:
"awesome-typescript-loader": "3.1.3",
And it works on OSX! Except, we build on Jenkins(Ubuntu)... And while Jenkins is happy about the 3.1.0 version and build with no issues, upgrading to 3.1.3 throws the following:
[at-loader] Checking finished with 2 errors
Error in bail mode: [at-loader] ./src/pages/somePage.tsx:4:23
TS2307: Cannot find module 'History'.
.. This is related to React and React-router, I think? But why this module specifically?
In other words, we're in a position where we either cannot build without errors locally, or cannot build on a build server without errors.
What could be the issue? Is it with React-router-dom?
Here's a package.json sample:
"dependencies": {
"#types/history": "4.6.0",
"#types/react": "16.0.10",
"#types/react-dom": "16.0.1",
"#types/react-redux": "5.0.10",
"#types/react-router-dom": "4.0.8",
"#types/react-router-redux": "5.0.8",
"#types/react-tap-event-plugin": "0.0.30",
"history": "4.7.2",
"react": "16.0.0",
"react-dom": "16.0.0",
"react-redux": "5.0.6",
"react-router-dom": "4.2.2",
"react-router-redux": "4.0.8",
"react-tap-event-plugin": "3.0.2",
"redux": "3.7.2",
"redux-thunk": "2.2.0",
},
"devDependencies": {
"awesome-typescript-loader": "3.1.0", // Or 3.1.3 as mentioned
"connect-history-api-fallback": "1.3.0",
"cross-env": "5.0.5",
"express": "4.15.4",
"extract-text-webpack-plugin": "3.0.0",
"html-webpack-plugin": "2.30.1",
"http-proxy-middleware": "0.17.4",
"https": "1.0.0",
"react-hot-loader": "3.0.0-beta.7",
"redux-devtools": "3.4.0",
"source-map-loader": "0.2.1",
"tslint": "5.7.0",
"tslint-loader": "3.5.3",
"tslint-react": "3.2.0",
"typescript": "2.5.2",
"url-loader": "0.5.9",
"webpack": "3.5.5",
"webpack-dev-middleware": "1.12.0",
"webpack-hot-middleware": "2.18.2"
}

Resources