install the CameraPreview plugin, CameraPreview plugin is not installed - ios

I'm making an app using ionic and cordova.
I add CameraPreview Plugin to use it, but when i deploy to ios and test on iphone, it says
[Warning] Native: tried calling CameraPreview.startCamera, but the CameraPreview plugin is not installed. (vendor.js, line 1)
[Warning] Install the CameraPreview plugin: 'ionic cordova plugin add cordova-plugin-camera-preview' (vendor.js, line 1)
but in my pakage.json camera preview presents
"dependencies": {
"#angular/common": "4.1.3",
"#angular/compiler": "4.1.3",
"#angular/compiler-cli": "4.1.3",
"#angular/core": "4.1.3",
"#angular/forms": "4.1.3",
"#angular/http": "4.1.3",
"#angular/platform-browser": "4.1.3",
"#angular/platform-browser-dynamic": "4.1.3",
"#ionic-native/camera-preview": "^4.2.1",
"#ionic-native/core": "3.12.1",
"#ionic-native/splash-screen": "3.12.1",
"#ionic-native/status-bar": "3.12.1",
"#ionic/storage": "2.0.1",
"cordova-android": "^6.2.3",
"cordova-browser": "^4.1.0",
"cordova-ios": "^4.4.0",
"cordova-plugin-camera-preview": "git+https://github.com/cordova-plugin-camera-preview/cordova-plugin-camera-preview.git",
"cordova-plugin-console": "^1.0.5",
"cordova-plugin-device": "^1.1.4",
"cordova-plugin-splashscreen": "^4.0.3",
"cordova-plugin-statusbar": "^2.2.2",
"cordova-plugin-whitelist": "^1.3.1",
"ionic-angular": "3.5.3",
"ionic-plugin-keyboard": "^2.2.1",
"ionicons": "3.0.0",
"rxjs": "5.4.0",
"sw-toolbox": "3.6.0",
"zone.js": "0.8.12"
},
first, i typed
ionic cordova plugin add cordova-plugin-camera-preview
and to solve the problem, i removed it and installed
ionic cordova plugin add https://github.com/cordova-plugin-camera-preview/cordova-plugin-camera-preview.git
but still does not work.
i can't figure out the problem.
this is my info
cli packages:
#ionic/cli-utils : 1.6.0 (/Users/hbin/righthere/node_modules/ionic/node_modules/#ionic/cli-utils)
ionic (Ionic CLI) : 3.6.0 (/Users/hbin/righthere/node_modules/ionic)
global packages:
Cordova CLI : 7.0.1
local packages:
#ionic/app-scripts : 2.0.2
#ionic/cli-plugin-cordova : 1.4.1
#ionic/cli-plugin-ionic-angular : 1.3.2
Cordova Platforms : android 6.2.3 browser 4.1.0 ios 4.4.0
Ionic Framework : ionic-angular 3.5.3
System:
Node : v8.1.3
OS : macOS Sierra
Xcode : Xcode 8.3.3 Build version 8E3004b
ios-deploy : 1.9.1
npm : 5.0.3

Related

Installing hermes-engine (0.71.2) got stuck

I have created a new react native project and then install npm , run command bundle install and then then cd iOS pod install but it got stuck on
Installing React-perflogger (0.71.2)
Installing React-runtimeexecutor (0.71.2)
Installing ReactCommon (0.71.2)
Installing SocketRocket (0.6.0)
Installing TOCropViewController (2.6.1)
Installing Yoga (1.14.0)
Installing YogaKit (1.18.1)
Installing boost (1.76.0)
Installing fmt (6.2.1)
Installing glog (0.3.5)
Installing hermes-engine (0.71.2)
here is my package.json file
{
"name": "ApproverApp",
"version": "0.0.1",
"private": true,
"scripts": {
"android": "react-native run-android",
"ios": "react-native run-ios",
"lint": "eslint .",
"start": "react-native start",
"test": "jest"
},
"dependencies": {
"#react-native-async-storage/async-storage": "^1.16.1",
"#react-navigation/bottom-tabs": "^6.2.0",
"#react-navigation/drawer": "^6.5.5",
"#react-navigation/native": "^6.0.8",
"#react-navigation/native-stack": "^6.5.0",
"#reduxjs/toolkit": "^1.8.0",
"axios": "^0.26.1",
"css-to-react-native": "^3.0.0",
"lodash": "^4.17.21",
"mime": "^3.0.0",
"moment": "^2.29.1",
"native-base": "^3.3.7",
"react": "18.2.0",
"react-native": "0.71.2",
"react-native-calendars": "^1.1279.0",
"react-native-date-picker": "^4.2.0",
"react-native-dialog": "^9.2.1",
"react-native-document-picker": "^8.0.0",
"react-native-gesture-handler": "^2.3.0",
"react-native-image-crop-picker": "^0.37.3",
"react-native-modal": "^13.0.1",
"react-native-permissions": "^3.3.1",
"react-native-popup-menu": "^0.15.12",
"react-native-reanimated": "^2.4.1",
"react-native-responsive-fontsize": "^0.5.1",
"react-native-responsive-screen": "^1.4.2",
"react-native-safe-area-context": "^4.1.2",
"react-native-screens": "^3.13.1",
"react-native-size-matters": "^0.4.0",
"react-native-svg": "^12.3.0",
"react-native-svg-transformer": "^1.0.0",
"react-native-swipe-list-view": "^3.2.9",
"react-native-vector-icons": "^9.1.0",
"react-redux": "^7.2.6",
"redux": "^4.1.2",
"redux-persist": "^6.0.0",
"redux-thunk": "^2.4.1"
},
"devDependencies": {
"#babel/core": "^7.20.0",
"#babel/preset-env": "^7.20.0",
"#babel/runtime": "^7.20.0",
"#react-native-community/eslint-config": "^3.2.0",
"#tsconfig/react-native": "^2.0.2",
"#types/jest": "^29.2.1",
"#types/react": "^18.0.24",
"#types/react-test-renderer": "^18.0.0",
"babel-jest": "^29.2.1",
"eslint": "^8.19.0",
"jest": "^29.2.1",
"metro-react-native-babel-preset": "0.73.7",
"prettier": "^2.4.1",
"react-test-renderer": "18.2.0",
"typescript": "4.8.4"
},
"jest": {
"preset": "react-native"
}
}
I have managed to fix this problem by following the instructions in this comment.
So basically what you have to do:
Install the version of Ruby listed in the Gemfile and .ruby-version. You can use http://rbenv.org/ or https://rvm.io/ to install and use the version from the .ruby-version file. Here are the instructions for rbenv
Install correct version of CocoaPods using bundle install
Update the CocoaPods repo using bundle exec pod repo update
Install pods by cd-ing into the ios folder cd ios and then run bundle exec pod install
If you're using ARM-based chip try this: arch -arm64 npx react-native init ProjectName

Heroku build failed due to webpack CLI not installed - Rails 6

I have successfully deployed my app to production in Heroku in the past but this is the first time I have moved my rails assets to be delivered by webpack. Everything works great in development but when I try to deploy to Heroku I get the following error message:
remote: [4/4] Building fresh packages...
remote: Done in 39.56s.
remote: Compiling...
remote: Compilation failed:
remote: CLI for webpack must be installed.
remote: webpack-cli (https://github.com/webpack/webpack-cli)
remote:
remote: We will use "yarn" to install the CLI via "yarn add -D webpack-cli".
remote: Do you want to install 'webpack-cli' (yes/no):
remote:
remote: !
remote: ! Precompiling assets failed.
remote: !
remote: ! Push rejected, failed to compile Ruby app.
remote:
remote: ! Push failed
I have webpack-cli installed in my package so I am not sure why it is failing on the deployment to Heroku. I also have the nodejs heroku buildpack configured to build prior to the ruby heroku buildpack on the server.
I have ran yarn add -D webpack-cli on my local machine to ensure webpack-cli is installed.
Below is my package.json file:
{
"name": "appex",
"private": true,
"dependencies": {
"#popperjs/core": "^2.9.2",
"#rails/actioncable": "^6.0.0",
"#rails/activestorage": "^6.0.0",
"#rails/ujs": "^6.0.0",
"#rails/webpacker": "5.2.1",
"bootstrap": "^5.0.1",
"bootstrap-icons": "^1.5.0",
"file-loader": "^6.2.0",
"jquery": "^3.6.0",
"sass-loader": "^12.0.0",
"turbolinks": "^5.2.0"
},
"version": "0.1.0",
"devDependencies": {
"#babel/core": "^7.14.3",
"#babel/preset-env": "^7.14.2",
"babel-loader": "^8.2.2",
"css-loader": "^5.2.6",
"resolve-url-loader": "^4.0.0",
"style-loader": "^2.0.0",
"webpack": "^5.37.1",
"webpack-cli": "^4.7.2",
"webpack-dev-server": "^3.11.2"
}
}
Rails version 6.0.3.4 ruby version 2.6.3
Any help is appreciated!
Here is something maybe helpful
https://github.com/webpack/webpack/issues/7197

webpack: TypeError: validateOptions is not a function

Webpack throws my an error, i did no special changes. I use tailwindcss with rails6. normally the application.js is around 5mo.
I took a clean and stable repo to undo my last changes.
i did
-npm install
-npm upgrade
-remove /public/assets
Asset Size Chunks Chunk Names
js/application-aefb2dfb14879eac357f.js 5.06 KiB application [emitted] [immutable] application
js/application-aefb2dfb14879eac357f.js.map 3.53 KiB application [emitted] [dev] application
manifest.json 364 bytes [emitted]
Entrypoint application = js/application-aefb2dfb14879eac357f.js js/application-aefb2dfb14879eac357f.js.map
[./app/javascript/packs/application.js] 1.17 KiB {application} [built] [failed] [1 error]
ERROR in ./app/javascript/packs/application.js
Module build failed (from ./node_modules/babel-loader/lib/index.js):
TypeError: validateOptions is not a function
at Object.<anonymous> (/mnt/882A716B2A7156E2/0-Projets/15-BSwebsite/bswebsite/node_modules/babel-loader/lib/index.js:71:5)
at Generator.next (<anonymous>)
at asyncGeneratorStep (/mnt/882A716B2A7156E2/0-Projets/15-BSwebsite/bswebsite/node_modules/babel-loader/lib/index.js:3:103)
at _next (/mnt/882A716B2A7156E2/0-Projets/15-BSwebsite/bswebsite/node_modules/babel-loader/lib/index.js:5:194)
at /mnt/882A716B2A7156E2/0-Projets/15-BSwebsite/bswebsite/node_modules/babel-loader/lib/index.js:5:364
at new Promise (<anonymous>)
at Object.<anonymous> (/mnt/882A716B2A7156E2/0-Projets/15-BSwebsite/bswebsite/node_modules/babel-loader/lib/index.js:5:97)
at Object._loader (/mnt/882A716B2A7156E2/0-Projets/15-BSwebsite/bswebsite/node_modules/babel-loader/lib/index.js:235:18)
at Object.loader (/mnt/882A716B2A7156E2/0-Projets/15-BSwebsite/bswebsite/node_modules/babel-loader/lib/index.js:64:18)
at Object.<anonymous> (/mnt/882A716B2A7156E2/0-Projets/15-BSwebsite/bswebsite/node_modules/babel-loader/lib/index.js:59:12)
package.json
{
"name": "bswebsite",
"private": true,
"dependencies": {
"#rails/actioncable": "^6.0.0",
"#rails/activestorage": "^6.0.0",
"#rails/ujs": "^6.0.0",
"#rails/webpacker": "rails/webpacker#b6c2180",
"#tailwindcss/aspect-ratio": "^0.2.0",
"#tailwindcss/forms": "^0.3.2",
"#tailwindcss/typography": "^0.4.0",
"autoprefixer": "^10.2.5",
"postcss": "^8.2.10",
"tailwindcss": "^2.1.1",
"tailwindcss-debug-screens": "^2.0.0",
"turbolinks": "^5.2.0"
},
"version": "0.1.0",
"devDependencies": {
"webpack-dev-server": "^3.11.2"
}
}
pack/application.js
import Rails from "#rails/ujs"
import Turbolinks from "turbolinks"
import * as ActiveStorage from "#rails/activestorage"
import "channels"
require("stylesheets/application.scss")
Rails.start()
Turbolinks.start()
ActiveStorage.start()
There are many things involved I am not sure as I can't reproduce this error locally so Just giving some gueses.
Check which version of webpacker in your Gemfile please change as following
gem "webpacker", github: "rails/webpacker", ref: 'b6c2180'
Also check what global version install of webpacker sometime it can conflict.
npm uninstall webpack -g
yarn remove #rails/webpacker
Now install
yarn add rails/webpacker#b6c2180

Error watching file for changes: EMFILE {"code":"EMFILE","errno":"EMFILE","syscall":"Error watching file for changes:","filename": null}?

Error watching file for changes:
EMFILE {"code":"EMFILE","errno":"EMFILE","syscall":"Error watching
file for changes:","filename": null}?
"dependencies": {
"react": "16.0.0-alpha.12",
"react-native": "0.47.1",
"react-native-router-flux": "^4.0.0-beta.16",
"react-redux": "^5.0.5",
"redux": "^3.7.2",
"redux-thunk": "^2.2.0"
}
You need to install watchman through brew:
brew install watchman
If you are getting the error as Error watching file for changes: EMFILE
Run these commands to resolve this problem:
brew uninstall --force watchman
brew link automake
brew install --HEAD watchman

Updating angular version

I want to update my angular version from 1.4.9 to 1.5.6. While executing bower install angular#1.5.6 --save I am getting ECONFLICT Unable to find suitable version for angular.
Here is the trace:
$ bower install angular#1.5.6 --save
bower angular#1.5.6 cached https://github.com/angular/bower-angular.git#1.5.6
bower angular#1.5.6 validate 1.5.6 against https://github.com/angular/bower-angular.git#1.5.6
bower angular#1.4.8 cached https://github.com/angular/bower-angular.git#1.4.8
bower angular#1.4.8 validate 1.4.8 against https://github.com/angular/bower-angular.git#1.4.8
bower angular#>=1.3.0 cached https://github.com/angular/bower-angular.git#1.5.6
bower angular#>=1.3.0 validate 1.5.6 against https://github.com/angular/bower-angular.git#>=1.3.0
bower angular#1.4.10 cached https://github.com/angular/bower-angular.git#1.4.10
bower angular#1.4.10 validate 1.4.10 against https://github.com/angular/bower-angular.git#1.4.10
bower angular#1.5.5 cached https://github.com/angular/bower-angular.git#1.5.5
bower angular#1.5.5 validate 1.5.5 against https://github.com/angular/bower-angular.git#1.5.5
bower angular#>=1.2.26 <1.6 cached https://github.com/angular/bower-angular.git#1.5.6
bower angular#>=1.2.26 <1.6 validate 1.5.6 against https://github.com/angular/bower-angular.git#>=1.2.26 <1.6
bower angular#* cached https://github.com/angular/bower-angular.git#1.5.6
bower angular#* validate 1.5.6 against https://github.com/angular/bower-angular.git#*
bower angular#^1.3.0 || >1.4.0-beta.0 cached https://github.com/angular/bower-angular.git#1.5.6
bower angular#^1.3.0 || >1.4.0-beta.0 validate 1.5.6 against https://github.com/angular/bower-angular.git#^1.3.0 || >1.4.0-beta.0
bower angular#~1.x cached https://github.com/angular/bower-angular.git#1.5.6
bower angular#~1.x validate 1.5.6 against https://github.com/angular/bower-angular.git#~1.x
bower angular#~1.3.13 cached https://github.com/angular/bower-angular.git#1.3.20
bower angular#~1.3.13 validate 1.3.20 against https://github.com/angular/bower-angular.git#~1.3.13
bower angular#>1.2.0 cached https://github.com/angular/bower-angular.git#1.5.6
bower angular#>1.2.0 validate 1.5.6 against https://github.com/angular/bower-angular.git#>1.2.0
bower angular#>=1.3.x cached https://github.com/angular/bower-angular.git#1.5.6
bower angular#>=1.3.x validate 1.5.6 against https://github.com/angular/bower-angular.git#>=1.3.x
bower ECONFLICT Unable to find suitable version for angular
my bower file is:
{
"name": "myAppName",
"version": "0.0.0",
"dependencies": {
"angular": "1.4.9",
"angular-animate": "~1.4.9",
"angular-bootstrap": " 0.13.4",
"angular-cookies": "1.4.8",
"angular-datatables": "~0.5.1",
"angular-filter": "~0.5.8",
"angular-material": "~0.11.4",
"angular-resource": "^1.4.9",
"angular-route": "^1.4.8",
"angular-sanitize": "^1.4.9",
"angular-touch": "^1.4.9",
"angular-translate": "^2.9.0",
"angular-translate-loader-static-files": "~2.8.1",
"angular-ui-date": "~0.0.11",
"bootstrap": "^3.2.0",
"components-font-awesome": "^4.4.0",
"datatables": "~1.10.10",
"jquery": "^2.1.4",
"md-chips": "~0.2.4",
"ngprogress": "^1.1.2",
"textAngular": "~1.4.6",
"underscore": "^1.8.3",
"moment": "^2.13.0"
},
"devDependencies": {
"angular-mocks": "^1.4.9",
"textAngular": "~1.4.6",
"md-chips": "~0.2.4"
},
"appPath": "app",
"moduleName": "myModuleName",
"resolutions": {
"angular-sanitize": "^1.4.9",
"angular": "1.4.9",
"angular-translate": "^2.9.0"
},
"overrides": {
"jquery": {
"main": "dist/jquery.js"
},
"md-chips": "~0.2.4"
}
}
bower install angular#latest --save -F
-F = --force-latest: Force latest version on conflict
bower install will install the latest stable version of angular.

Resources