Task :expo-permissions:compileReleaseKotlin FAILED - javascript

I want to create an apk . i am using expo bare project and i am using this command to create the apk for android
cd android && ./gradlew assembleRelease
and i am getting this error every time when i run the command .
here is the error
I have also tried to create the apk for a boilerplate app and that's working fine
but i am getting the error from this one i was using this command before
expo build:android
but by using this command by has a large size so i want to decrease its size that's why i am using
cd android && ./gradlew assembleRelease
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':expo-permissions:compileReleaseKotlin'.
> Compilation error. See log for more details
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.3/userguide/command_line_interface.html#sec:command_line_warnings
Package.json
{
"main": "index.js",
"scripts": {
"android": "react-native run-android",
"ios": "react-native run-ios",
"web": "expo start --web",
"start": "react-native start",
"test": "jest"
},
"dependencies": {
"#expo-google-fonts/montserrat": "^0.1.0",
"#expo-google-fonts/oswald": "^0.1.0",
"#expo-google-fonts/playfair-display": "^0.1.0",
"#react-native-community/cli-platform-ios": "^4.13.0",
"#react-native-community/masked-view": "^0.1.10",
"#react-native-community/netinfo": "^5.9.2",
"#react-native-community/slider": "^3.0.0",
"#react-navigation/bottom-tabs": "^5.11.1",
"#react-navigation/drawer": "^5.9.0",
"#react-navigation/material-top-tabs": "^5.3.10",
"#react-navigation/native": "^5.6.1",
"#react-navigation/stack": "^5.6.2",
"#unimodules/core": "~6.0.0",
"base64-arraybuffer": "^0.2.0",
"expo": "~40.0.0",
"expo-av": "~8.7.0",
"expo-camera": "~9.1.0",
"expo-constants": "~9.3.3",
"expo-file-system": "~9.3.0",
"expo-image-picker": "~9.2.0",
"expo-linear-gradient": "^8.4.0",
"expo-localization": "~9.1.0",
"expo-location": "~10.0.0",
"expo-media-library": "~10.0.0",
"expo-splash-screen": "~0.8.0",
"expo-status-bar": "~1.0.3",
"expo-updates": "~0.4.0",
"i18n-js": "^3.8.0",
"import": "^0.0.6",
"localstorage-polyfill": "^1.0.1",
"moment": "^2.29.1",
"native-base": "^2.13.14",
"query-string": "^6.13.7",
"react": "16.13.1",
"react-dom": "16.13.1",
"react-native": "~0.63.4",
"react-native-deck-swiper": "^2.0.5",
"react-native-dropdown-picker": "^3.7.6",
"react-native-easy-grid": "^0.2.2",
"react-native-gesture-handler": "~1.8.0",
"react-native-keyboard-aware-scroll-view": "^0.9.2",
"react-native-material-menu": "^1.2.0",
"react-native-paper": "^4.1.0",
"react-native-reanimated": "~1.13.0",
"react-native-responsive-fontsize": "^0.5.0",
"react-native-responsive-screen": "^1.4.1",
"react-native-safe-area-context": "~3.1.9",
"react-native-screens": "~2.15.0",
"react-native-size-matters": "^0.3.1",
"react-native-step-indicator": "^1.0.3",
"react-native-svg": "^12.1.0",
"react-native-tab-view": "^2.15.2",
"react-native-unimodules": "~0.12.0",
"react-native-web": "~0.13.12",
"react-native-webview": "^11.0.0",
"react-navigation": "^4.4.0",
"socket.io-client": "^2.3.0"
},
"devDependencies": {
"#babel/core": "~7.9.0",
"babel-jest": "~25.2.6",
"jest": "~25.2.6",
"react-test-renderer": "~16.13.1"
},
"jest": {
"preset": "react-native"
},
"private": true
}

For bare workflow, you have to exclude expo-permissions module:
android/app/build.gradle:
Replace:
addUnimodulesDependencies()
with
addUnimodulesDependencies([exclude: ['expo-permissions']])
for iOS in Podfile:
Replace:
use_unimodules!
with
use_unimodules!(exclude: ['expo-permissions'])
The solution was posted here : https://github.com/expo/expo/issues/10283

Related

Invalid Podfile file: "react-native-community/cli" type of error

I am failing to install iOS dependencies using pod install annd after pressing enter button to run pod install.
Node Version: v16.16.0
NPM Version: 8.11.0
Working Process which I followed:
First way to install pod: Firstly install npm then install pod
Second way to install pod: after deleting node_modules then run pod install
Failed to install to follow the both of rules as mentioned before and to check the error, please check the attached file.
The dependencies are install in our projects as given below as package.json file.
{
"name": "shohan",
"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 ."
},
"dependencies": {
"#react-native-async-storage/async-storage": "^1.16.2",
"#react-native-community/blur": "^3.6.0",
"#react-native-community/cli-platform-ios": "^8.0.6",
"#react-native-community/clipboard": "^1.5.1",
"#react-native-community/datetimepicker": "^6.1.2",
"#react-native-masked-view/masked-view": "^0.2.6",
"#react-native-picker/picker": "^2.4.2",
"#react-navigation/bottom-tabs": "^6.2.0",
"#react-navigation/material-top-tabs": "^6.2.1",
"#react-navigation/native": "^6.0.8",
"#react-navigation/native-stack": "^6.5.0",
"#rneui/base": "^0.0.0-edge.2",
"#rneui/themed": "^0.0.0-edge.2",
"#twotalltotems/react-native-otp-input": "^1.3.11",
"axios": "^0.26.1",
"moment": "^2.29.2",
"radio-buttons-react-native": "^1.0.4",
"react": "17.0.2",
"react-hook-form": "^7.28.1",
"react-native": "0.67.3",
"react-native-animatable": "^1.3.3",
"react-native-audio-record": "^0.2.2",
"react-native-bar-chart": "^0.1.0",
"react-native-countdown-component": "^2.7.1",
"react-native-date-picker": "^4.2.0",
"react-native-datepicker": "^1.7.2",
"react-native-dropdown-picker": "^5.3.0",
"react-native-elevation": "^1.0.0",
"react-native-emoji-selector": "^0.2.0",
"react-native-fs": "^2.20.0",
"react-native-image-picker": "^4.8.4",
"react-native-infinite-scrolling": "^2.0.0",
"react-native-keyboard-aware-scroll-view": "^0.9.5",
"react-native-linear-gradient": "^2.5.6",
"react-native-loading-spinner-overlay": "^3.0.0",
"react-native-pager-view": "^5.4.15",
"react-native-paper": "^4.12.1",
"react-native-picker-select": "^8.0.4",
"react-native-pure-chart": "^0.0.24",
"react-native-render-html": "^6.3.4",
"react-native-safe-area-context": "^4.1.2",
"react-native-screens": "^3.13.1",
"react-native-skeleton-placeholder": "^5.0.0",
"react-native-snap-carousel": "^3.9.1",
"react-native-sound": "^0.11.2",
"react-native-step-indicator": "^1.0.3",
"react-native-super-grid": "^4.4.0",
"react-native-svg": "^12.4.0",
"react-native-swiper-flatlist": "^3.0.16",
"react-native-tab-view": "^3.1.1",
"react-native-text-gradient": "^0.1.7",
"react-native-vector-icons": "^9.1.0",
"react-native-video": "^2.3.1",
"react-native-video-player": "^0.12.0",
"react-native-webview": "^11.18.1",
"react-native-youtube-iframe": "^2.2.2",
"socket.io-client": "^4.5.1"
},
"devDependencies": {
"#babel/core": "^7.17.5",
"#babel/runtime": "^7.17.2",
"#react-native-community/eslint-config": "^3.0.1",
"babel-jest": "^27.5.1",
"eslint": "^8.11.0",
"jest": "^27.5.1",
"metro-react-native-babel-preset": "^0.69.0",
"react-test-renderer": "17.0.2"
},
"jest": {
"preset": "react-native"
}
}
Here is the Podfile's code is given below,
require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/#react-native-community/cli-platform-ios/native_modules'
platform :ios, '11.0'
target 'shohan' do
config = use_native_modules!
use_react_native!(
:path => config[:reactNativePath],
# to enable hermes on iOS, change `false` to `true` and then install pods
:hermes_enabled => false
)
target 'shohanTests' do
inherit! :complete
# Pods for testing
end
# Enables Flipper.
#
# Note that if you have use_frameworks! enabled, Flipper will not work and
# you should disable the next line.
use_flipper!()
post_install do |installer|
react_native_post_install(installer)
__apply_Xcode_12_5_M1_post_install_workaround(installer)
end
end
The occurred error is given in the attached file please check it and help me.

angular 13: Module not found: Error: Can't resolve 'rxjs/operators'

I have upgraded my angular to angular 13. when I run to build SSR it gives me following error.
ERROR in ./node_modules/#angular/common/fesm2015/http.mjs 12:0-56
Module not found: Error: Can't resolve 'rxjs/operators' in '/Users/nr/aws/jobsaf-website-staging/application/node_modules/#angular/common/fesm2015'
Did you mean 'index.js'?
BREAKING CHANGE: The request 'rxjs/operators' failed to resolve only because it was resolved as fully specified
(probably because the origin is strict EcmaScript Module, e. g. a module with javascript mimetype, a '*.mjs' file, or a '*.js' file where the package.json contains '"type": "module"').
The extension in the request is mandatory for it to be fully specified.
Add the extension to the request.
# ./src/app/app.server.module.ts 6:0-57 16:25-42
# ./src/main.server.ts 3:0-58 3:0-58
# ./server.ts 32:0-52 40:15-30 44:0-34 44:0-34
ERROR in ./node_modules/#angular/core/fesm2015/core.mjs 8:0-39
Module not found: Error: Can't resolve 'rxjs/operators' in '/Users/nr/aws/jobsaf-website-staging/application/node_modules/#angular/core/fesm2015'
Did you mean 'index.js'?
BREAKING CHANGE: The request 'rxjs/operators' failed to resolve only because it was resolved as fully specified
(probably because the origin is strict EcmaScript Module, e. g. a module with javascript mimetype, a '*.mjs' file, or a '*.js' file where the package.json contains '"type": "module"').
The extension in the request is mandatory for it to be fully specified.
Add the extension to the request.
# ./server.ts 30:0-47 35:0-14
ERROR in ./node_modules/#angular/forms/fesm2015/forms.mjs 11:0-37
Module not found: Error: Can't resolve 'rxjs/operators' in '/Users/nr/aws/jobsaf-website-staging/application/node_modules/#angular/forms/fesm2015'
Did you mean 'index.js'?
BREAKING CHANGE: The request 'rxjs/operators' failed to resolve only because it was resolved as fully specified
(probably because the origin is strict EcmaScript Module, e. g. a module with javascript mimetype, a '*.mjs' file, or a '*.js' file where the package.json contains '"type": "module"').
The extension in the request is mandatory for it to be fully specified.
Add the extension to the request.
# ./src/app/app.module.ts 12:0-45 78:12-23
# ./src/app/app.server.module.ts 3:0-41 12:18-27
# ./src/main.server.ts 3:0-58 3:0-58
# ./server.ts 32:0-52 40:15-30 44:0-34 44:0-34
ERROR in ./node_modules/#angular/platform-server/fesm2015/platform-server.mjs 21:0-39
Module not found: Error: Can't resolve 'rxjs/operators' in '/Users/nr/aws/jobsaf-website-staging/application/node_modules/#angular/platform-server/fesm2015'
Did you mean 'index.js'?
BREAKING CHANGE: The request 'rxjs/operators' failed to resolve only because it was resolved as fully specified
(probably because the origin is strict EcmaScript Module, e. g. a module with javascript mimetype, a '*.mjs' file, or a '*.js' file where the package.json contains '"type": "module"').
The extension in the request is mandatory for it to be fully specified.
Add the extension to the request.
# ./src/main.server.ts 4:0-77 4:0-77 4:0-77
# ./server.ts 32:0-52 40:15-30 44:0-34 44:0-34
ERROR in ./node_modules/#angular/router/fesm2015/router.mjs 10:0-180
Module not found: Error: Can't resolve 'rxjs/operators' in '/Users/nr/aws/jobsaf-website-staging/application/node_modules/#angular/router/fesm2015'
Did you mean 'index.js'?
BREAKING CHANGE: The request 'rxjs/operators' failed to resolve only because it was resolved as fully specified
(probably because the origin is strict EcmaScript Module, e. g. a module with javascript mimetype, a '*.mjs' file, or a '*.js' file where the package.json contains '"type": "module"').
The extension in the request is mandatory for it to be fully specified.
Add the extension to the request.
# ./src/app/app.component.ts 2:0-48 35:31-44
# ./src/app/app.server.module.ts 2:0-47 13:20-32
# ./src/main.server.ts 3:0-58 3:0-58
# ./server.ts 32:0-52 40:15-30 44:0-34 44:0-34
my package.json file:
{
"name": "admin-panel",
"version": "0.0.0",
"license": "MIT",
"angular-cli": {},
"scripts": {
"start": "DEBUG=jobsaf-website:* nodemon --inspect --trace-warnings --legacy-watch --trace-warnings ./bin/www",
"seed": "node ./seeds/static-tables.js",
"test-jobsaf": "mocha --timeout 10000",
"rm-web": "rm -rf ./public/web/*",
"ng": "node ./node_modules/#angular/cli/bin/ng serve --host 0.0.0.0",
"ng:build": "node --max_old_space_size=5048 ./node_modules/#angular/cli/bin/ng build --configuration production --aot",
"build:server:prod": "node --max_old_space_size=4048 ./node_modules/#angular/cli/bin/ng run jobsaf-website:server:prod && webpack --config webpack.server.config.js",
"build:browser:prod": "node --max_old_space_size=4048 ./node_modules/#angular/cli/bin/ng build --configuration production --aot --vendor-chunk --deleteOutputPath=true --buildOptimizer --progress=true",
"build:server:staging": "node --max_old_space_size=4048 ./node_modules/#angular/cli/bin/ng run jobsaf-website:server:staging && webpack --config webpack.server.config.js",
"build:browser:staging": "node --max_old_space_size=4048 ./node_modules/#angular/cli/bin/ng build --configuration production --configuration=staging --aot --vendor-chunk --deleteOutputPath=true --buildOptimizer",
"build:stats": "node --max_old_space_size=3192 node_modules/#angular/cli/bin/ng build --configuration production --aot --vendor-chunk --deleteOutputPath=true --buildOptimizer --progress=true --configuration production --stats-json",
"build:prod": "npm run rm-web && npm run build:server:prod && npm run build:browser:prod",
"build:staging": "npm run rm-web && npm run build:server:staging && npm run build:browser:staging",
"server": "node local.js",
"file:migration": "APP_FILE_MIGRATION=true node ./migration/file-migration.js",
"test_env": "set NODE_ENV=test",
"jest": "jest --detectOpenHandles --watchAll --config ./jest.config.js",
"coverage": "jest -i --coverage",
"jest:ci": "jest --detectOpenHandles --forceExit --config ./jest.config.js",
"test": "npm run test_env && npm run jest",
"test:ci": "npm run test_env && npm run seed && npm run jest:ci",
"dev:ssr": "ng run jobsaf-website:serve-ssr",
"serve:ssr": "node public/web/server/main.js",
"build:ssr": "ng build --configuration production && ng run jobsaf-website:server:prod",
"prerender": "ng run jobsaf-website:prerender",
"postinstall": "ngcc"
},
"private": true,
"napa": {
"jquery.flot.spline": "miloszfalinski/jquery.flot.spline",
"ika.jvectormap": "kakirigi/ika.jvectormap"
},
"dependencies": {
"#angular/animations": "^13.0.2",
"#angular/common": "^13.0.2",
"#angular/compiler": "^13.0.2",
"#angular/compiler-cli": "^13.0.2",
"#angular/core": "^13.0.2",
"#angular/forms": "^13.0.2",
"#angular/material": "^13.0.2",
"#angular/platform-browser": "^13.0.2",
"#angular/platform-browser-dynamic": "^13.0.2",
"#angular/platform-server": "^13.0.2",
"#angular/pwa": "^13.0.3",
"#angular/router": "^13.0.2",
"#angular/service-worker": "^13.0.2",
"#fortawesome/angular-fontawesome": "^0.10.1",
"#fortawesome/fontawesome-svg-core": "^1.2.36",
"#fortawesome/free-brands-svg-icons": "^5.15.4",
"#fortawesome/free-solid-svg-icons": "^5.15.4",
"#fullcalendar/core": "^5.10.1",
"#hapi/joi": "^15.1.0",
"#ng-select/ng-select": "^8.1.1",
"#nguniversal/common": "^13.0.1",
"#nguniversal/express-engine": "^13.0.1",
"#ngx-loading-bar/core": "^5.1.2",
"#ngxs/store": "^3.7.3-dev.master-1e7127b",
"#schematics/angular": "^13.0.3",
"#sindresorhus/slugify": "^1.1.0",
"#trademe/ng-defer-load": "^8.2.1",
"#types/jquery": "^3.5.8",
"angular-archwizard": "^7.0.0",
"angular2-uuid": "^1.1.1",
"apicache": "^1.6.3",
"archiver": "^5.3.0",
"aws-sdk": "^2.1031.0",
"bluebird": "^3.7.2",
"bootstrap": "5.1.3",
"compression": "^1.7.4",
"compromise": "^13.11.4",
"cookie-parser": "^1.4.6",
"core-js": "3.19.1",
"cors": "~2.8.5",
"debug": "^4.3.2",
"dotenv": "^10.0.0",
"easyimage": "^3.1.1",
"ejs": "^3.1.6",
"exceljs": "^4.3.0",
"express": "^4.17.1",
"express-jwt": "^6.1.0",
"express-mongo-sanitize": "^2.1.0",
"express-rate-limit": "^5.5.1",
"express-useragent": "^1.0.15",
"express-validator": "^6.13.0",
"feed": "^4.2.2",
"file-saver": "^2.0.5",
"firebase-admin": "^10.0.0",
"font-awesome": "^4.7.0",
"generate-password": "^1.7.0",
"google-auth-library": "^7.10.2",
"hammerjs": "^2.0.8",
"helmet": "^4.6.0",
"html-pdf": "^3.0.1",
"http-status": "^1.5.0",
"intl-tel-input": "^17.0.13",
"izitoast": "1.4.0",
"joi-objectid": "^4.0.2",
"jquery": "^3.6.0",
"jsonwebtoken": "^8.5.1",
"jwt-decode": "^3.1.2",
"keyword-extractor": "0.0.20",
"kickbox": "^2.0.4",
"libphonenumber-js": "^1.9.43",
"localstorage-polyfill": "^1.0.1",
"lodash": "^4.17.21",
"lodash.uniq": "^4.5.0",
"md5": "^2.3.0",
"moment": "^2.29.1",
"mongoose": "5.8.11",
"mongoose-history": "^0.8.0",
"mongoose-unique-validator": "^2.0.3",
"mongoose-url-slugs": "^1.0.2",
"multer": "^1.4.3",
"multer-s3": "^2.10.0",
"multer-s3-transform": "^2.10.3",
"mysql": "^2.18.1",
"ng-recaptcha": "^9.0.0",
"ng2-file-upload": "^1.4.0",
"ngx-auth": "^5.4.0",
"ngx-bootstrap": "^6.1.0",
"ngx-facebook": "^3.0.0-0",
"ngx-img-cropper": "^11.0.0",
"ngx-infinite-scroll": "^10.0.1",
"ngx-moment": "^5.0.0",
"ngx-pagination": "^5.1.1",
"ngx-quill-editor": "^2.2.2",
"ngx-toastr": "^14.2.0",
"node-schedule": "^2.0.0",
"nodemailer": "^6.7.1",
"passport": "^0.5.0",
"passport-facebook-token": "^4.0.0",
"passport-google-id-token": "^0.4.7",
"passport-google-token": "^0.1.2",
"passport-linkedin-token": "^0.1.1",
"passport-local": "^1.0.0",
"pdf-to-text": "0.0.7",
"phantomjs-prebuilt": "^2.1.16",
"phone": "^3.1.10",
"phpass": "^0.1.1",
"rand-token": "^1.0.1",
"request": "^2.88.2",
"request-ip": "^2.1.3",
"rxjs": "^6.5.5",
"sharp": "^0.29.3",
"showdown": "^1.9.1",
"simple-line-icons": "^2.5.5",
"socket.io": "^4.3.2",
"socket.io-client": "^4.3.2",
"socket.io-redis": "^5.4.0",
"socketio-auth": "^0.1.1",
"textract": "^2.5.0",
"ts-loader": "9.2.6",
"underscore": "^1.13.1",
"unique-random-array": "^2.0.0",
"url": "^0.11.0",
"util": "^0.12.4",
"uuid": "^8.3.2",
"winston": "^3.3.3",
"xlsx": "^0.17.4",
"xss-clean": "^0.1.1",
"zone.js": "~0.11.4",
"zxcvbn": "^4.4.2"
},
"devDependencies": {
"#angular-devkit/build-angular": "~13.0.3",
"#angular/cli": "^13.0.3",
"#types/express": "^4.17.13",
"#types/hammerjs": "^2.0.40",
"#types/mocha": "^9.0.0",
"#types/node": "^16.11.7",
"#types/underscore": "^1.11.3",
"husky": "^7.0.0",
"jasmine-core": "~3.10.1",
"jasmine-spec-reporter": "~7.0.0",
"jest": "^27.3.1",
"karma": "^6.3.9",
"karma-chrome-launcher": "~3.1.0",
"karma-coverage-istanbul-reporter": "^3.0.3",
"karma-jasmine": "~4.0.1",
"karma-jasmine-html-reporter": "^1.7.0",
"lint-staged": "^12.0.2",
"mocha": "^9.1.3",
"ng-diff-match-patch": "^3.0.1",
"nodemon": "^2.0.15",
"protractor": "^7.0.0",
"supertest": "^6.1.6",
"tslib": "^2.3.1",
"tslint": "^6.1.3",
"typescript": "4.4.3",
"webpack": "^5.64.1",
"webpack-cli": "^4.9.1"
}
}
Any Idea
I just solve this issue by correcting the RxJS version to 7.4.0. I hope this can solve others issue as well.
My issues was resolved by adding it in the package.json
"overrides": {
"rxjs": "7.4.0"
},

Expo SDK 44 upgrade ERROR - App.js: [BABEL]: Unexpected token '.'

I have recently upgraded my app from SDK 40 to SDK 44 and came across this error App.js: [BABEL]: Unexpected token '.' (While processing: /Users/user/path/to/project/node_modules/babel-preset-expo/index.js)
Error Stack Trace:
App.js: [BABEL]: Unexpected token '.' (While processing: /Users/user/path/to/project/node_modules/babel-preset-expo/index.js)
/Users/user/path/to/project/node_modules/babel-preset-expo/index.js:48
...(options?.jsxRuntime !== 'classic' && {
^
SyntaxError: Unexpected token '.'
at wrapSafe (internal/modules/cjs/loader.js:931:16)
at Module._compile (internal/modules/cjs/loader.js:979:27)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1035:10)
at Module.load (internal/modules/cjs/loader.js:879:32)
at Function.Module._load (internal/modules/cjs/loader.js:724:14)
at Module.require (internal/modules/cjs/loader.js:903:19)
at require (internal/modules/cjs/helpers.js:74:18)
at loadCjsDefault (/Users/user/path/to/project/node_modules/#babel/core/lib/config/files/module-types.js:85:18)
at loadCjsOrMjsDefault (/Users/user/path/to/project/node_modules/#babel/core/lib/config/files/module-types.js:57:16)
Here is my babel.config.js:
return {
presets: ['babel-preset-expo', { jsxRuntime: 'automatic' }],
plugins: [
['inline-dotenv'],
['.....']
]
}
Here is my package.json:
{
"main": "node_modules/expo/AppEntry.js",
"scripts": {
"start": "expo start",
"android": "expo start --android",
"ios": "expo start --ios",
"web": "expo start --web",
"eject": "expo eject",
"test": "jest"
},
"jest": {
"preset": "jest-expo"
},
"dependencies": {
"#babel/plugin-transform-react-jsx": "^7.16.5",
"#react-native-async-storage/async-storage": "~1.15.0",
"#react-native-community/art": "^1.2.0",
"#react-native-community/datetimepicker": "4.0.0",
"#react-native-community/masked-view": "0.1.10",
"#react-native-community/netinfo": "7.1.3",
"#react-native-community/push-notification-ios": "^1.2.2",
"#react-native-community/slider": "4.1.12",
"#react-navigation/native": "^5.1.4",
"aws-amplify": "^3.3.1",
"aws-amplify-react-native": "^4.2.6",
"axios": "^0.19.2",
"expo": "^44.0.0",
"expo-app-loading": "~1.3.0",
"expo-barcode-scanner": "~11.2.0",
"expo-camera": "~12.1.0",
"expo-constants": "~13.0.0",
"expo-font": "~10.0.4",
"expo-linking": "~3.0.0",
"expo-mail-composer": "~11.1.0",
"expo-notifications": "~0.14.0",
"expo-permissions": "~13.1.0",
"expo-secure-store": "~11.1.0",
"expo-sqlite": "~10.1.0",
"expo-updates": "~0.11.2",
"expo-web-browser": "~10.1.0",
"file-saver": "^2.0.2",
"jsbarcode": "^3.11.3",
"link": "^0.1.5",
"metro-config": "^0.64.0",
"npm": "^8.3.0",
"qs": "^6.9.4",
"react": "17.0.1",
"react-dom": "17.0.1",
"react-native": "https://github.com/expo/react-native/archive/sdk-44.0.0.tar.gz",
"react-native-barcode-expo": "^1.1.1",
"react-native-elements": "^3.2.0",
"react-native-fs": "^2.16.6",
"react-native-gesture-handler": "~2.1.0",
"react-native-modal": "^11.5.6",
"react-native-modal-datetime-picker": "^8.6.0",
"react-native-paper": "^3.10.1",
"react-native-push-notification": "^3.5.2",
"react-native-reanimated": "~2.3.1",
"react-native-router-flux": "^4.2.0",
"react-native-safe-area-context": "3.3.2",
"react-native-screens": "~3.10.1",
"react-native-snap-carousel": "^3.9.1",
"react-native-svg": "12.1.1",
"react-native-web": "0.17.1",
"react-navigation-animated-switch": "^0.6.4",
"react-navigation-drawer": "^2.4.11",
"react-navigation-header-buttons": "^3.0.5",
"react-router-dom": "^6.0.0-alpha.3",
"yarn": "^1.22.17"
},
"devDependencies": {
"#babel/core": "^7.12.9",
"#babel/runtime": "^7.9.2",
"#react-native-community/eslint-config": "^0.0.7",
"babel-jest": "^25.1.0",
"babel-plugin-inline-dotenv": "^1.6.0",
"babel-preset-expo": "9.0.1",
"eslint": "^6.8.0",
"expo-cli": "^5.0.2",
"jest": "^26.6.3",
"jest-expo": "^44.0.0",
"metro-react-native-babel-preset": "^0.66.2",
"react-test-renderer": "^16.13.1"
},
"private": true
}
Any help will be greatly appreciated.
can you give your
package.json
node version
I think that's because of the babel issue / your node version, because it cannot transpile the optional chaining https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Optional_chaining
maybe tried using latest LTS node version? because as far as I know, the latest LTS node version already support optional chaining
Just to let you know, it's a bug in babel-preset-expo when you are using Node 12.
Optional chainning is not supported in node12 and can be easily replaced with extra checks
https://github.com/expo/expo/pull/15545
From what I can see, Expo SDK 44 is still in beta.
The Error Stack Trace reads that newer syntax (in this case the optional chaining operator ?.) isn't being transpiled by Babel which causes the failure.
Simply downgrading to the stable SDK 43 should solve all issues.
P.S: This error has been reported to Expo already by the beta testers.
If you use expo v44 you have to update babel-preset-expo dev dependency to v9.0.2:
"babel-preset-expo": "9.0.2",
Downgrading to SDK 43.0.0 worked fine for me:
expo update 43.0.0

React native project on android crashes as soon as you open the apk file

So I've been working on a React Native project, I'm on a Mac and when I run my apk file generated by the command ./gradlew assembleRelease and install it on my Google Pixel 4a I try to open the app and it instantly crashes and closes. However, when I run it in the emulator via command react-native run-android it works as expected. During the build, installation and even opening the app on my actual device it never gives a single error. Nothing has changed to my knowledge since the last time I ran the build command and it was working before so I'm lost and confused as to why this is happening. This also my first react-native project so maybe being a noob I'm missing something very obvious. Also iOS has absolutely no issues, any feedback or tips would be greatly appreciated. Thanks
My build.gradle file:
buildscript {
ext {
googlePlayServicesLocationVersion = "17.0.0" // Or higher.
buildToolsVersion = "29.0.3"
minSdkVersion = 21
compileSdkVersion = 30
targetSdkVersion = 30
ndkVersion = "20.1.5948944"
appCompatVersion = "1.1.0"
}
repositories {
google()
jcenter()
}
dependencies {
classpath("com.android.tools.build:gradle:4.1.0")
classpath 'com.google.gms:google-services:4.3.4'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
mavenLocal()
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url("$rootDir/../node_modules/react-native/android")
}
maven {
// Android JSC is installed from npm
url("$rootDir/../node_modules/jsc-android/dist")
}
maven {
// react-native-background-fetch
url("${project(':react-native-background-fetch').projectDir}/libs")
}
maven {
// Required for react-native-background-geolocation
url("${project(':react-native-background-geolocation').projectDir}/libs")
}
maven {
// Required for zoho chat widget
url("https://maven.zohodl.com/")
}
maven {
// Required for react-native-background-fetch
url("${project(':react-native-background-fetch').projectDir}/libs")
}
maven {
url 'https://api.mapbox.com/downloads/v2/releases/maven'
authentication {
basic(BasicAuthentication)
}
credentials {
// Do not change the username below.
// This should always be `mapbox` (not your username).
username = "mapbox"
// Use the secret token you stored in gradle.properties as the password
password = project.properties['MAPBOX_DOWNLOADS_TOKEN'] ?: ""
}
}
google()
jcenter()
maven { url 'https://www.jitpack.io' }
}
}
package.json
{
"name": "NAME",
"version": "1.2.8",
"private": true,
"scripts": {
"android": "react-native run-android",
"ios": "react-native run-ios",
"start": "react-native start",
"test": "jest",
"lint": "eslint .",
"build:ios": "react-native bundle --entry-file='index.js' --bundle-output='./ios/main.jsbundle' --dev=false --platform='ios'"
},
"dependencies": {
"#homee/react-native-mapbox-navigation": "^1.0.5",
"#react-native-async-storage/async-storage": "^1.15.5",
"#react-native-community/checkbox": "^0.5.8",
"#react-native-firebase/app": "11.5.0",
"#react-native-firebase/auth": "11.5.0",
"#react-native-firebase/firestore": "^11.5.0",
"#react-native-picker/picker": "^1.9.12",
"#react-navigation/bottom-tabs": "^6.0.0-next.2",
"#react-navigation/drawer": "^6.0.0-next.2",
"#react-navigation/native": "^6.0.0-next.1",
"#react-navigation/stack": "^6.0.0-next.6",
"axios": "^0.21.1",
"expo-web-browser": "^9.0.0",
"firebase": "^7.24.0",
"firebase-tools": "^8.16.2",
"mobx": "^6.1.8",
"mobx-react-lite": "^3.2.0",
"mobx-state-tree": "^5.0.1",
"moment": "^2.29.1",
"mst-persist": "^0.1.3",
"react": "17.0.1",
"react-native": "0.64.0",
"react-native-background-fetch": "^4.0.1",
"react-native-background-geolocation": "^4.0.1",
"react-native-datepicker": "^1.7.2",
"react-native-dropdown-picker": "^4.0.2",
"react-native-gesture-handler": "^1.10.3",
"react-native-modalize": "^2.0.8",
"react-native-paper": "^4.7.2",
"react-native-portalize": "^1.0.7",
"react-native-reanimated": "^2.0.0",
"react-native-safe-area-context": "^3.2.0",
"react-native-screens": "^2.18.1",
"react-native-unimodules": "^0.12.0",
"react-native-vector-icons": "^8.1.0",
"react-native-webview": "^11.3.1",
"react-native-zohosalesiq-mobilisten": "^2.0.0",
"styled-components": "^5.2.1"
},
"devDependencies": {
"#babel/core": "^7.12.9",
"#babel/runtime": "^7.14.0",
"#react-native-community/eslint-config": "^2.0.0",
"#types/jest": "^26.0.20",
"#types/react": "^17.0.3",
"#types/react-native": "^0.63.51",
"#types/react-test-renderer": "^17.0.1",
"babel-jest": "^26.6.3",
"eslint": "7.14.0",
"jest": "^26.6.3",
"metro-react-native-babel-preset": "^0.64.0",
"mobx-flipper": "^1.1.2",
"react-native-flipper": "^0.81.0",
"react-test-renderer": "17.0.1",
"typescript": "^4.2.3"
},
"jest": {
"preset": "react-native"
},
"prettier": {
"arrowParens": "always",
"printWidth": 100,
"semi": true,
"singleQuote": true,
"trailingComma": "all"
}
}

ReactNative: babelHelpers.typeof is not a function

On an existing project, that have worked fine over many months and which is already in the AppStores for both iOS and Android, we've got now a break on development with this error:
babelHelpers.typeof is not a function
All what we've done was to try to upgrade an RN-0.26-based Application to a newer version. But even after a rollback the error remains.
We cleared watchman, resetted the packager multiple times. Nothing helped here.
Our package.json looks like this:
{
"version": "0.0.1",
"private": true,
"scripts": {
"reset": "rm -rf node_modules/ && npm cache clear && watchman watch-del-all && npm i",
"start": "node node_modules/react-native/local-cli/cli.js start --reset-cache",
"testflight": "fastlane beta",
"android-device": "adb reverse tcp:8081 tcp:8081 && react-native run-android",
"lint": "jslint **.js",
"test": "mocha test/",
"generate-apk": "cd android && ./gradlew assembleRelease && open ./app/build/outputs/apk/",
"install-apk": "cd android && ./gradlew installRelease",
},
"devDependencies": {
"jshint": "latest",
"mocha": "latest",
"eslint": "^2.3.0",
"eslint-config-standard": "^5.1.0",
"eslint-config-standard-react": "^2.3.0",
"eslint-plugin-promise": "^1.1.0",
"eslint-plugin-react": "^4.1.0",
"eslint-plugin-react-native": "^1.0.0",
"eslint-plugin-standard": "^1.3.2"
},
"dependencies": {
"apsl-react-native-button": "^2.5.0",
"babel-preset-es2015": "^6.9.0",
"babel-preset-react": "^6.11.1",
"es6-promisify": "^4.1.0",
"fetch-stuff": "^1.0.1",
"iap-receipt-validator": "^1.0.2",
"immutable": "^3.8.1",
"js-sha256": "^0.3.0",
"keymirror": "^0.1.1",
"lodash.difference": "^4.3.0",
"lodash.find": "^4.4.0",
"lodash.partialright": "^4.1.4",
"lodash.remove": "^4.5.0",
"lodash.shuffle": "^4.0.0",
"lodash.uniq": "^4.3.0",
"moment": "^2.14.1",
"normalizr": "^2.1.0",
"react": "15.0.2",
"react-native": "0.26.2",
"react-native-animatable": "^0.6.1",
"react-native-app-intro": "^1.0.2",
"react-native-billing": "^1.3.0",
"react-native-code-push": "^1.12.2-beta",
"react-native-code-push-saga": "^1.0.0",
"react-native-console-panel": "0.0.9",
"react-native-debug-stylesheet": "^0.1.1",
"react-native-drawer": "file:./custom_modules/react-native-drawer",
"react-native-extra-dimensions-android": "^0.17.0",
"react-native-fabric": "^0.2.3",
"react-native-fetch-blob": "^0.4.2",
"react-native-fs": "^1.4.0",
"react-native-gifted-spinner": "0.0.4",
"react-native-google-analytics-bridge": "^2.1.0",
"react-native-htmlview": "^0.5.0",
"react-native-i18n": "0.0.8",
"react-native-image-progress": "^0.5.0",
"react-native-in-app-utils": "^4.0.0",
"react-native-keyboard-aware-scroll-view": "^0.1.0",
"react-native-navbar": "^1.5.0",
"react-native-router-flux": "^3.30.0",
"react-native-search-bar": "^2.11.0",
"react-native-side-menu": "^0.19.0",
"react-native-simple-store": "^1.0.1",
"react-native-sound": "^0.8.3",
"react-native-sqlite-storage": "^2.1.6",
"react-native-swiper": "^1.4.4",
"react-native-vector-icons": "^2.0.2",
"react-redux": "^4.4.5",
"react-timer-mixin": "^0.13.3",
"redux": "^3.5.2",
"redux-form": "^6.0.0-alpha.15",
"redux-logger": "^2.6.1",
"redux-saga": "^0.10.4",
"redux-thunk": "^2.1.0",
"reselect": "^2.5.1",
"rn-viewpager": "^1.1.2",
"rnpm": "^1.7.0",
"tween-functions": "^1.2.0"
}
}
Can anyone help?
The issue happens because either your project (via a custom .babelrc) or one of your dependencies is relying on a es2015 preset that doesn't work with React Native. The reason for that is because it includes transform-typeof-symbol which calls babelHelpers.typeof that is not bundled with React Native.
If you have a custom babelrc - the solution is simple, just remove this preset.
Afterwards, restart packager w/o cache and you should be set.
Note: It maybe one of your dependencies that uses that preset - in such case, there's nothing you can do but try forking it and removing the preset yourself.
A part solution to this is using babel-preset-react-native-stage-0
https://www.npmjs.com/package/babel-preset-react-native-stage-0
There is a PR here to fix this in the react-native codebase: enter link description here

Categories