React Native app fails to run after installing react-native-iap - android

I have an otherwise working React-Native app but need to include in-app purchases for it to be accepted on the app store.
After a little Googling, it looks like react-native-iap is pretty much the only option.
First Error
After following the installation steps HERE, I get the following error in Android Studio:
e: C:\path_to_my_project\node_modules\react-native-iap\android\src\play\java\com\dooboolab\RNIap\RNIapModule.kt: (215, 37): Type mismatch: inferred type is String? but String was expected
As stated in the link, the error is being thrown in the RNIapModule.kt file, which I will link an excerpt from below (the full code pushes me over the character limit, but I have not changed it since installation).
I undid all the changes from the instructions, and it seems the only thing that prevents me from getting this error is not adding the store specification in android/app/build.gradle, which of course, also errors out, I assume just before the error mention above.
Second Error
Looking higher up in build section, I see another error:
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':react-native-iap:compilePlayDebugKotlin'.
> Compilation error. See log for more details
Error log: An unexpected packet was received before the handshake.
RN and IAP versions
React-Native version: 0.63.4
react-native-iap version: ^8.0.5
Full dependency list
"dependencies": {
"#react-native-async-storage/async-storage": "^1.13.2",
"#react-native-community/checkbox": "^0.5.7",
"#react-native-community/masked-view": "^0.1.11",
"#react-native-community/netinfo": "^6.0.0",
"#react-native-community/progress-bar-android": "^1.0.4",
"#react-native-community/progress-view": "^1.2.3",
"#reduxjs/toolkit": "^1.4.0",
"#thecodingmachine/redux-toolkit-wrapper": "1.3.0",
"axios": "^0.21.1",
"buffer": "^6.0.3",
"date-fns": "^2.19.0",
"es6-symbol": "^3.1.3",
"flipper-plugin-react-native-inspect-json-client": "^0.1.2",
"formik": "^2.1.4",
"i18next": "^19.8.2",
"lottie-ios": "3.1.8",
"lottie-react-native": "4.0.2",
"moment": "^2.29.1",
"prop-types": "^15.7.2",
"ramda": "^0.27.1",
"react": "16.13.1",
"react-i18next": "^11.7.3",
"react-native": "0.63.4",
"react-native-app-intro-slider": "^3.0.0",
"react-native-appearance": "^0.3.4",
"react-native-chart-kit": "^6.10.1",
"react-native-charts-wrapper": "^0.5.7",
"react-native-copilot": "^2.5.0",
"react-native-dotenv": "^0.2.0",
"react-native-flipper": "^0.130.0",
"react-native-gesture-handler": "^1.10.3",
"react-native-iap": "^8.0.5",
"react-native-image-crop-picker": "^0.35.3",
"react-native-image-picker": "^3.1.4",
"react-native-iphone-x-helper": "^1.3.1",
"react-native-map-link": "^2.7.25",
"react-native-material-menu": "^1.2.0",
"react-native-modal": "^11.7.0",
"react-native-permissions": "^3.2.0",
"react-native-picker-select": "^6 P.5.0",
"react-native-progress": "^5.0.0",
"react-native-prompt-android": "^1.1.0",
"react-native-reanimated": "^2.3.0",
"react-native-safe-area-context": "^3.2.0",
"react-native-screens": "^3.3.0",
"react-native-size-matters": "^0.3.0",
"react-native-sqlite-storage": "^5.0.0",
"react-native-svg": "^12.1.0",
"react-native-template-": "thecodingmachine/react-native-boilerplate",
"react-native-toast-message": "^1.4.9",
"react-native-video": "^5.1.1",
"react-navigation": "^3.11.2",
"react-redux": "^7.2.1",
"redux": "^4.0.5",
"redux-flipper": "^1.4.2",
"redux-logger": "^3.0.6",
"redux-persist": "^6.0.0",
"redux-saga": "^1.0.2",
"reduxsauce": "^1.0.1",
"utf8": "^3.0.0",
"yup": "^0.28.1"
},
"devDependencies": {
"#babel/core": "^7.8.4",
"#babel/plugin-proposal-decorators": "^7.13.5",
"#babel/runtime": "^7.8.4",
"#react-native-community/eslint-config": "^1.1.0",
"babel-jest": "^25.1.0",
"babel-plugin-ignite-ignore-reactotron": "^0.3.0",
"eslint": "^6.5.1",
"eslint-config-prettier": "^4.1.0",
"eslint-config-standard": "^12.0.0",
"eslint-plugin-import": "^2.16.0",
"eslint-plugin-node": "^8.0.1",
"eslint-plugin-prettier": "^3.0.1",
"eslint-plugin-promise": "^4.0.1",
"eslint-plugin-react": "^7.12.4",
"eslint-plugin-react-native": "^3.6.0",
"eslint-plugin-standard": "^4.0.0",
"jest": "^25.1.0",
"metro-react-native-babel-preset": "^0.59.0",
"prettier": "^1.16.4",
"react-native-rename": "^2.4.1",
"react-test-renderer": "16.13.1",
"reactotron-react-native": "^4.0.2",
"reactotron-redux": "^3.1.2",
"reactotron-redux-saga": "^4.2.3",
"seamless-immutable": "^7.1.4",
"seamless-immutable-mergers": "^7.1.0"
},
Code from RNIapModule.kt
Just the function block where the error was thrown:
...
#ReactMethod
fun getItemsByType(type: String?, skuArr: ReadableArray, promise: Promise) {
ensureConnection(
promise,
object : EnsureConnectionCallback {
override fun run(billingClient: BillingClient) {
val skuList = ArrayList<String>()
for (i in 0 until skuArr.size()) {
skuList.add(skuArr.getString(i))
}
...

skuList.add(skuArr.getString(i).orEmpty())
please try added .orEmpty()

Related

react-native-webview android issue: Found interface com.facebook.react.uimanager.events.EventDispatcher, but class was expected

I am using react-native-webview for my react native app which has the rn version 0.64.4,
But I cannot open screen when we have a web view in it, the app get crash immediately. this is only happening on the android. Then I open up the android project via android studio, then I could see the below error on the log. How can I fix this issue?
Error log:
E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.xapp, PID: 21712
java.lang.IncompatibleClassChangeError: Found interface com.facebook.react.uimanager.events.EventDispatcher, but class was expected (declaration of 'com.facebook.react.uimanager.events.EventDispatcher' appears in /data/app/~~qPom7HPfdYNLFEMUio836A==/com.verime-gQSY9JQLtB6GGgsqfvIrFg==/base.apk!classes3.dex)
at com.reactnativecommunity.webview.RNCWebViewManager.dispatchEvent(RNCWebViewManager.java:168)
at com.reactnativecommunity.webview.RNCWebViewManager$RNCWebChromeClient.onProgressChanged(RNCWebViewManager.java:1153)
at la.handleMessage(chromium-TrichromeWebViewGoogle6432.aab-stable-530410534:278)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loopOnce(Looper.java:226)
at android.os.Looper.loop(Looper.java:313)
at android.app.ActivityThread.main(ActivityThread.java:8751)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:571)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1135)
This is my package.json
{
"name": "xapp",
"version": "0.0.1",
"private": true,
"scripts": {
"android": "react-native run-android",
"ios": "react-native run-ios",
"start": "react-native start",
"test": "jest",
"lint": "eslint .",
"np": "np --no-publish",
"postversion": "react-native-version",
"build:ios": "react-native bundle --entry-file index.js --platform ios --dev false --bundle-output ios/main.jsbundle --assets-dest ios",
"postinstall": "patch-package"
},
"dependencies": {
"#react-native-async-storage/async-storage": "^1.17.10",
"#react-native-community/art": "^1.2.0",
"#react-native-community/checkbox": "^0.5.7",
"#react-native-community/datetimepicker": "^3.4.1",
"#react-native-community/picker": "^1.8.1",
"#react-native-firebase/app": "^11.0.0",
"#react-native-firebase/messaging": "^11.0.0",
"#react-native-picker/picker": "^2.4.8",
"#react-navigation/bottom-tabs": "^5.5.2",
"#react-navigation/native": "^5.6.1",
"#react-navigation/stack": "^5.5.1",
"#woonivers/react-native-document-scanner": "^2.1.1",
"axios": "^0.21.1",
"base-64": "^0.1.0",
"install": "^0.13.0",
"lottie-react-native": "^5.1.4",
"moment": "^2.27.0",
"native-base": "^2.15.2",
"npm": "^7.20.5",
"pdf-lib": "^1.10.0",
"radio-buttons-react-native": "^1.0.4",
"react": "17.0.1",
"react-native": "0.64.4",
"react-native-biometrics": "^3.0.1",
"react-native-blob-util": "^0.15.0",
"react-native-camera": "^3.30.0",
"react-native-circular-progress": "^1.3.7",
"react-native-contacts": "^7.0.2",
"react-native-device-info": "^8.0.1",
"react-native-document-picker": "^5.0.3",
"react-native-floating-action": "^1.21.0",
"react-native-fs": "^2.16.6",
"react-native-gesture-handler": "^1.10.3",
"react-native-image-crop-picker": "^0.36.2",
"react-native-image-picker": "^3.3.2",
"react-native-image-progress": "^1.1.1",
"react-native-image-resizer": "^1.2.6",
"react-native-image-to-pdf": "^1.2.0",
"react-native-image-tools-wm": "^1.5.8",
"react-native-invoke-app": "^1.0.6",
"react-native-jitsi-meet": "^2.2.0",
"react-native-keyboard-aware-scroll-view": "^0.9.5",
"react-native-keychain": "^7.0.0",
"react-native-linear-gradient": "^2.6.2",
"react-native-masked-text": "^1.13.0",
"react-native-modal-datetime-picker": "^9.2.0",
"react-native-paper": "^3.10.1",
"react-native-pdf": "^6.2.0",
"react-native-pdf-lib": "^1.0.0",
"react-native-permissions": "^3.0.5",
"react-native-perspective-image-cropper": "git+https://github.com/kmwi/react-native-perspective-image-cropper.git",
"react-native-progress": "^4.1.2",
"react-native-reanimated": "^1.9.0",
"react-native-rectangle-scanner": "^1.0.10",
"react-native-safe-area-context": "^3.0.5",
"react-native-screens": "^2.9.0",
"react-native-select-multiple": "^2.1.0",
"react-native-signature-canvas": "4.4.1",
"react-native-simple-radio-button": "^2.7.4",
"react-native-simple-toast": "^1.1.2",
"react-native-snackbar": "^2.4.0",
"react-native-snap-carousel": "^3.9.1",
"react-native-status-bar-height": "^2.6.0",
"react-native-svg": "git+https://github.com/expo/react-native-svg.git",
"react-native-tooltips": "^1.0.3",
"react-native-user-avatar": "^1.0.8",
"react-native-vector-icons": "^7.0.0",
"react-native-view-pdf": "^0.11.0",
"react-native-virtual-keyboard": "^1.1.0",
"react-native-walkthrough-tooltip": "^1.3.1",
"react-native-webview": "11.18.1",
"react-navigation": "^4.3.9",
"react-navigation-drawer": "^2.4.13",
"react-navigation-stack": "^2.7.0",
"react-redux": "^7.2.0",
"redux": "^4.0.5",
"redux-devtools-extension": "^2.13.8",
"redux-persist": "^6.0.0",
"redux-saga": "^1.1.3"
},
"devDependencies": {
"#babel/core": "^7.12.9",
"#babel/runtime": "^7.12.5",
"#react-native-community/eslint-config": "^2.0.0",
"babel-jest": "^26.6.3",
"eslint": "7.14.0",
"jest": "^26.6.3",
"jetifier": "^2.0.0",
"metro-react-native-babel-preset": "^0.64.0",
"np": "^7.6.1",
"patch-package": "^6.5.0",
"postinstall-postinstall": "^2.1.0",
"react-native-version": "^4.0.0",
"react-test-renderer": "17.0.1",
"reactotron-react-native": "^5.0.0",
"reactotron-redux": "^3.1.3",
"reactotron-redux-saga": "^4.2.3"
},
"jest": {
"preset": "react-native"
}
}
Similar case here, the libraries involved are invertase/react-native-apple-authentication and react-native-webview. They suddenly started crashing due to a Kotlin version difference, after correcting them, react-native-reanimated started giving a similar error as yours, but instead of expecting a class, it expects interface, the other way around.
Found class com.facebook.react.uimanager.events.EventDispatcher, but interface was expected.
at com.swmansion.reanimated.NodesManager.(NodesManager.java:116)
UPDATE: I just resolved my problem, it was due to a library trying to use a newer version of react native, and I ended upgrading my project to RN 64.
Since RN 64, the EventDispatcher.java file in the react-native project changed a lot, from class in 63.5 to a interface in 64. Your issue could be that a library is trying to use older RN version and is expecting a class, but your RN version already works with Interface regarding that file.
Hope it helps you, good luck!

React Native Android app crashes in production

React Native Android Application is crashing in release mode. I am not able to discover the issue or a fix
here are the dependencies used
{
"dependencies": {
"#react-native-community/async-storage": "^1.12.1",
"#react-native-community/datetimepicker": "^3.5.2",
"#react-native-community/masked-view": "^0.1.11",
"#react-native-community/netinfo": "^7.1.7",
"#react-native-firebase/app": "^12.9.0",
"#react-native-firebase/dynamic-links": "^12.9.2",
"#react-native-firebase/messaging": "^12.9.0",
"#react-native-google-signin/google-signin": "^6.0.0",
"#react-native-picker/picker": "^2.4.1",
"#react-navigation/bottom-tabs": "^5.11.10",
"#react-navigation/native": "^5.9.4",
"#react-navigation/stack": "^5.14.4",
"axios": "^0.21.1",
"moment": "^2.29.1",
"native-base": "^2.15.2",
"patch-package": "^6.4.7",
"postinstall-postinstall": "^2.1.0",
"radio-buttons-react-native": "^1.0.4",
"react": "17.0.2",
"react-hook-form": "^7.20.5",
"react-native": "0.67.3",
"react-native-app-intro-slider": "^4.0.4",
"react-native-bootsplash": "^3.2.4",
"react-native-camera": "^4.0.0",
"react-native-date-picker": "^4.1.2",
"react-native-elements": "^3.4.2",
"react-native-fast-image": "^8.5.11",
"react-native-image-crop-picker": "^0.36.2",
"react-native-image-picker": "^4.7.3",
"react-native-image-zoom-viewer": "^3.0.1",
"react-native-keyboard-aware-scroll-view": "^0.9.4",
"react-native-modal": "^13.0.0",
"react-native-multiple-select": "^0.5.6",
"react-native-navigation-bar-color": "^2.0.1",
"react-native-picker-select": "6.6.0",
"react-native-progress": "^5.0.0",
"react-native-reanimated": "^2.1.0",
"react-native-safe-area-context": "^3.2.0",
"react-native-screens": "^3.1.1",
"react-native-story": "^0.1.3",
"react-native-svg": "^12.1.1",
"react-native-swiper": "^1.6.0",
"react-native-textarea": "^1.0.4",
"react-native-url-preview": "^1.1.9",
"react-native-vector-icons": "^8.1.0",
"react-native-video": "^5.2.0",
"react-native-webview": "^11.16.0",
"react-native-windows": "0.41.0-rc.1",
"react-native-youtube-iframe": "^2.2.2",
"react-redux": "^7.2.6",
"react-use-websocket": "^2.7.1",
"redux": "^4.1.2",
"rn-fetch-blob": "^0.12.0",
"socket.io-client": "^4.2.0",
"zego-express-engine-reactnative": "^0.17.3"
},
"devDependencies": {
"#babel/core": "^7.14.0",
"#babel/runtime": "^7.14.0",
"#bam.tech/react-native-make": "^3.0.3",
"#react-native-community/eslint-config": "^2.0.0",
"babel-jest": "^26.6.3",
"eslint": "^7.25.0",
"jest": "^26.6.3",
"metro-react-native-babel-preset": "^0.66.0",
"react-test-renderer": "16.13.1",
"reactotron-react-native": "^5.0.0"
}
}
In release mode you still can check the logs. you can use android logcats to view the all logs of mobile. filter the logs so to find easier the problem and look fo "Caused by" keyword in logs.

Invariant Violation: Tried to register two views with the same name WheelPicker

I am creating a react-native project using expo-managed workflow with the following dependencies in package.json.
I use wix/react-native-ui-lib for creating my UI components in the react-native app.
{
"dependencies": {
"#codler/react-native-keyboard-aware-scroll-view": "^1.0.1",
"#react-native-picker/picker": "1.9.11",
"#react-navigation/bottom-tabs": "^5.11.11",
"#react-navigation/native": "^5.9.4",
"#react-navigation/stack": "^5.14.5",
"expo": "~41.0.1",
"expo-app-loading": "^1.0.3",
"expo-linear-gradient": "~9.1.0",
"expo-status-bar": "~1.0.4",
"lodash": "^4.17.21",
"react": "16.13.1",
"react-dom": "16.13.1",
"react-native": "https://github.com/expo/react-native/archive/sdk-41.0.0.tar.gz",
"react-native-gesture-handler": "^1.10.3",
"react-native-iphone-x-helper": "^1.3.1",
"react-native-logs": "^3.0.3",
"react-native-material-ripple": "^0.9.1",
"react-native-phone-number-input": "^2.1.0",
"react-native-reanimated": "~2.1.0",
"react-native-responsive-fontsize": "^0.5.0",
"react-native-responsive-screen": "^1.4.2",
"react-native-root-toast": "^3.2.1",
"react-native-screens": "~3.0.0",
"react-native-snap-carousel": "^3.9.1",
"react-native-svg": "12.1.0",
"react-native-ui-lib": "^5.24.2",
"react-native-web": "~0.13.12",
"validator": "^13.6.0"
},
"devDependencies": {
"#babel/core": "^7.9.0",
"#babel/runtime": "^7.14.0",
"#react-native-community/eslint-config": "^2.0.0",
"#types/jest": "^26.0.23",
"#types/lodash": "^4.14.169",
"#types/react": "~16.9.35",
"#types/react-native": "~0.63.2",
"#types/react-native-material-ripple": "^0.9.1",
"#types/react-native-snap-carousel": "^3.8.3",
"#types/react-test-renderer": "^17.0.1",
"babel-jest": "^26.6.3",
"babel-plugin-module-resolver": "^3.2.0",
"eslint": "^7.26.0",
"eslint-import-resolver-babel-module": "^5.3.1",
"eslint-plugin-import": "^2.23.2",
"flush-promises": "^1.0.2",
"jest": "^26.6.3",
"metro-react-native-babel-preset": "^0.59.0",
"prettier": "^2.3.0",
"react-native-typescript-transformer": "^1.2.13",
"react-test-renderer": "^17.0.2",
"ts-jest": "^26.5.6",
"typescript": "~4.0.0"
},
}
When running the app, sometimes I get the following error message in the expo logs.
Invariant Violation: Tried to register two views with the same name WheelPicker
at node_modules/react-native/Libraries/Core/ExceptionsManager.js:104:6 in reportException
at node_modules/react-native/Libraries/Core/ExceptionsManager.js:171:19 in handleException
at node_modules/react-native/Libraries/Core/setUpErrorHandling.js:24:6 in handleError
at node_modules/expo-error-recovery/build/ErrorRecovery.fx.js:12:21 in ErrorUtils.setGlobalHandler$argument_0
at [native code]:null in flushedQueue
at [native code]:null in invokeCallbackAndReturnFlushedQueue
Is this due to a dependency error and how can this be removed ?

ReactNativeJS: TypeError: undefined is not an object (evaluating 't.default')

App is running properly without any error in debug mode.but its crashing in release mode after splash screen. and also when i'm trying to archive it,its getting successful archive but im not getting anything under window.
package.json
"dependencies": {
"#react-native-community/async-storage": "^1.9.0",
"#react-native-community/masked-view": "^0.1.6",
"#react-navigation/drawer": "^5.0.0",
"#react-navigation/material-bottom-tabs": "^5.0.0",
"#react-navigation/native": "^5.0.0",
"#react-navigation/stack": "^5.0.0",
"babel-preset-react-app": "^9.1.2",
"mobx": "^5.15.4",
"mobx-react": "^6.2.2",
"react": "16.9.0",
"react-native": "0.61.5",
"react-native-admob": "^2.0.0-beta.6",
"react-native-animatable": "^1.3.3",
"react-native-device-info": "^5.5.6",
"react-native-gesture-handler": "^1.6.0",
"react-native-i18n": "^2.0.15",
"react-native-image-gallery": "^2.1.4",
"react-native-image-view": "^2.1.2",
"react-native-linear-gradient": "^2.5.6",
"react-native-material-ripple": "^0.9.1",
"react-native-onesignal": "^3.7.3",
"react-native-paper": "^3.6.0",
"react-native-reanimated": "^1.7.0",
"react-native-responsive-dimensions": "^3.1.1",
"react-native-responsive-screen": "^1.4.0",
"react-native-safe-area-context": "^0.7.3",
"react-native-screens": "^2.0.0-beta.8",
"react-native-share": "^3.3.0",
"react-native-slideshow": "^1.0.1",
"react-native-snap-carousel": "^3.8.4",
"react-native-svg": "^12.0.3",
"react-native-unity-ads": "^1.0.3",
"react-native-vector-icons": "^6.6.0",
"rn-fetch-blob": "^0.12.0"
},
"devDependencies": {
"#babel/plugin-proposal-decorators": "^7.8.3",
"#babel/core": "^7.6.2",
"#babel/runtime": "^7.6.2",
"#react-native-community/eslint-config": "^0.0.5",
"babel-jest": "^24.9.0",
"eslint": "^6.5.1",
"jest": "^24.9.0",
"metro-react-native-babel-preset": "^0.56.0",
"react-test-renderer": "16.9.0"
},

React Native: Android build - App.js: Cannot read property 'bindings' of null

I'm trying to build my project, but it has tuned into a nightmare...
Now I'm facing this issue when I run ./gradlew assembleRelease
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:bundleReleaseJsAndAssets'.
And more specifically:
transform[stderr]: Trace: The node type SpreadProperty has been renamed to SpreadElement
transform[stderr]: at Object.isSpreadProperty (/Users/danielrvt/IdeaProjects/my-app/node_modules/#babel/types/lib/validators/generated/index.js:4208:11)
transform[stderr]: at hasSpread (/Users/danielrvt/IdeaProjects/my-app/node_modules/babel-plugin-transform-object-rest-spread/lib/index.js:38:13)
transform[stderr]: at PluginPass.ObjectExpression (/Users/danielrvt/IdeaProjects/my-app/node_modules/babel-plugin-transform-object-rest-spread/lib/index.js:234:14)
transform[stderr]: at newFn (/Users/danielrvt/IdeaProjects/my-app/node_modules/#babel/traverse/lib/visitors.js:193:21)
transform[stderr]: at NodePath._call (/Users/danielrvt/IdeaProjects/my-app/node_modules/#babel/traverse/lib/path/context.js:53:20)
transform[stderr]: at NodePath.call (/Users/danielrvt/IdeaProjects/my-app/node_modules/#babel/traverse/lib/path/context.js:40:17)
transform[stderr]: at NodePath.visit (/Users/danielrvt/IdeaProjects/my-app/node_modules/#babel/traverse/lib/path/context.js:88:12)
transform[stderr]: at TraversalContext.visitQueue (/Users/danielrvt/IdeaProjects/my-app/node_modules/#babel/traverse/lib/context.js:118:16)
transform[stderr]: at TraversalContext.visitSingle (/Users/danielrvt/IdeaProjects/my-app/node_modules/#babel/traverse/lib/context.js:90:19)
transform[stderr]: at TraversalContext.visit (/Users/danielrvt/IdeaProjects/my-app/node_modules/#babel/traverse/lib/context.js:146:19)
App.js: Cannot read property 'bindings' of null
TypeError: Cannot read property 'bindings' of null
at Scope.moveBindingTo (/Users/danielrvt/IdeaProjects/my-app/node_modules/#babel/traverse/lib/scope/index.js:867:13)
at BlockScoping.updateScopeInfo (/Users/danielrvt/IdeaProjects/my-app/node_modules/babel-plugin-transform-es2015-block-scoping/lib/index.js:364:17)
at BlockScoping.run (/Users/danielrvt/IdeaProjects/my-app/node_modules/babel-plugin-transform-es2015-block-scoping/lib/index.js:330:12)
at PluginPass.BlockStatementSwitchStatementProgram (/Users/danielrvt/IdeaProjects/my-app/node_modules/babel-plugin-transform-es2015-block-scoping/lib/index.js:70:24)
at newFn (/Users/danielrvt/IdeaProjects/my-app/node_modules/#babel/traverse/lib/visitors.js:193:21)
at NodePath._call (/Users/danielrvt/IdeaProjects/my-app/node_modules/#babel/traverse/lib/path/context.js:53:20)
at NodePath.call (/Users/danielrvt/IdeaProjects/my-app/node_modules/#babel/traverse/lib/path/context.js:40:17)
at NodePath.visit (/Users/danielrvt/IdeaProjects/my-app/node_modules/#babel/traverse/lib/path/context.js:88:12)
at TraversalContext.visitQueue (/Users/danielrvt/IdeaProjects/my-app/node_modules/#babel/traverse/lib/context.js:118:16)
I honestly have absolutely no idea what's wrong now, how can I debug this?
This is my package.json:
{
"name": "my-app",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
"test": "jest"
},
"dependencies": {
"#ptomasroos/react-native-multi-slider": "0.0.12",
"firebase": "^5.1.0",
"javascript-time-ago": "^1.0.30",
"mobx": "^4.1.1",
"mobx-react": "^5.0.0",
"native-base": "^2.8.1",
"prop-types": "^15.6.2",
"protobufjs": "^6.8.8",
"react": "16.2.0",
"react-native": "^0.57.7",
"react-native-actionsheet": "^2.3.0",
"react-native-aws3": "0.0.8",
"react-native-axios": "^0.17.1",
"react-native-billing": "^2.9.1",
"react-native-card-stack-swiper": "^1.0.5",
"react-native-collapsible": "^0.10.0",
"react-native-cookies": "^3.2.0",
"react-native-datepicker": "^1.6.0",
"react-native-dropdownalert": "^3.5.0",
"react-native-elements": "^0.19.0",
"react-native-event-listeners": "^1.0.3",
"react-native-expandable-section-flatlist": "^1.0.3",
"react-native-fbsdk": "^0.8.0",
"react-native-fcm": "^16.0.0",
"react-native-floating-action": "^1.10.1",
"react-native-geocoding": "^0.3.0",
"react-native-gifted-chat": "^0.4.3",
"react-native-google-places-autocomplete": "^1.3.6",
"react-native-hide-show-password-input": "^1.0.7",
"react-native-image-crop-picker": "^0.19.3",
"react-native-image-picker": "^0.26.10",
"react-native-image-placeholder": "^1.0.14",
"react-native-instagram-login": "^1.0.7",
"react-native-keyboard-aware-scroll-view": "^0.4.4",
"react-native-keyboard-aware-scrollview": "^2.0.0",
"react-native-keyboard-spacer": "^0.4.1",
"react-native-linear-gradient": "^2.4.0",
"react-native-linkedin": "^1.3.1",
"react-native-localization": "^2.0.0",
"react-native-material-bottom-navigation": "^0.9.0",
"react-native-modal-datetime-picker": "^6.0.0",
"react-native-open-settings": "^1.0.1",
"react-native-pages": "^0.7.0",
"react-native-permissions": "^1.1.1",
"react-native-picker-select": "^5.1.0",
"react-native-popup-menu": "^0.12.4",
"react-native-pulse": "^1.0.6",
"react-native-scrollable-tab-view": "^0.8.0",
"react-native-share": "^1.0.26",
"react-native-simple-toast": "0.0.8",
"react-native-snap-carousel": "^3.7.2",
"react-native-splash-screen": "^3.1.1",
"react-native-star-rating": "^1.0.9",
"react-native-swipe-cards": "^0.1.1",
"react-native-swipe-list-view": "^1.0.7",
"react-native-swipeable-flat-list": "0.0.5",
"react-native-swipeout": "^2.3.3",
"react-native-switch": "^1.4.0",
"react-native-twitter-signin": "https://github.com/GoldenOwlAsia/react-native-twitter-signin.git#master",
"react-native-view-more-text": "^2.0.1",
"react-native-viewpager": "^0.2.13",
"react-navigation": "^1.0.3",
"rn-viewpager": "^1.2.9"
},
"devDependencies": {
"#babel/plugin-proposal-decorators": "^7.2.0",
"babel-jest": "22.2.2",
"babel-preset-react-native": "4.0.0",
"jest": "22.2.2",
"react-test-renderer": "16.2.0"
},
"jest": {
"preset": "react-native",
"transform": {
"^.+\\.js$": "<rootDir>/node_modules/react-native/jest/preprocessor.js"
}
}
}
From https://www.npmjs.com/package/babel-preset-react-native
babel-preset-react-native has been replaced by
metro-react-native-babel-preset, which now uses Babel 7.0.0. If you're
using React Native v0.57 or later you should update your babel config
to point to the metro-react-native-babel-preset preset.
I think this may be related to a particular issue with babel-core, you could try this solution https://github.com/babel/babel/issues/8263#issuecomment-402546923
Add to your package.json
"babel-plugin-transform-object-rest-spread": "^7.0.0-beta.3"
and then npm install

Categories

Resources