I have created a Mac application written in electron-vue.
It requires keyboard access and screen recording access.
Ideally, when I give permission it should start working immediately.
But my app sometimes work after restarting.
Sometimes, It keeps asking for permission after every restart even though we have given the permission.
I am not able to understand what is being done wrong.
Can you please help?
My package.json.
"name": "pramod-dektop-creator",
"version": "0.0.1",
"description": "pramod-desktop-creator",
"author": "Pramod <pramod#xyz.com>",
"scripts": {
"build": "node .electron-vue/build.js && electron-builder",
"build:clean": "cross-env BUILD_TARGET=clean node .electron-vue/build.js",
"build:dir": "npm run build:clean && node .electron-vue/build.js && electron-builder --dir",
"build:web": "cross-env BUILD_TARGET=web node .electron-vue/build.js",
"dev": "node .electron-vue/dev-runner.js",
"pack": "npm run pack:main && npm run pack:renderer",
"pack:main": "cross-env NODE_ENV=production webpack --progress --colors --config .electron-vue/webpack.main.config.js",
"pack:renderer": "cross-env NODE_ENV=production webpack --progress --colors --config .electron-vue/webpack.renderer.config.js",
"postinstall": "electron-builder install-app-deps",
"rebuild": "electron-rebuild -f -w sqlite3"
},
"main": "./dist/electron/main.js",
"build": {
"afterSign": "notarize.js",
"asar": true,
"productName": "pramod-dektop-creator",
"appId": "org.pramod.desktop-creator",
"protocols": {
"name": "pramod-dektop-creator",
"schemes": [
"pramod"
]
},
"directories": {
"output": "build"
},
"dmg": {
"sign": false,
"contents": [
{
"x": 410,
"y": 150,
"type": "link",
"path": "/Applications"
},
{
"x": 130,
"y": 150,
"type": "file"
}
]
},
"mac": {
"icon": "build/icons/icon.icns",
"gatekeeperAssess": false,
"entitlements": "info.plist",
"entitlementsInherit": "info.plist",
"hardenedRuntime": true
},
"win": {
"icon": "build/icons/icon.ico"
}
},
"iohook": {
"targets": [
"node-72",
"electron-70"
],
"platforms": [
"win32",
"darwin",
"linux"
],
"arches": [
"x64",
"ia32"
]
},
"license": "",
}
Please check whether you have given permissions to correct application.
How?
Go to Security & Privacy settings.
Right click on your application and select the option.
It will take you to the application for which permission is given.
Cross check whether it is the correct application you are giving access to.
For me, installed application was different than what I gave permission to.
I deleted duplicate application and gave permissions again. After that it started working.
May or may not solve your issue but worth a try.
Related
for years I was using bash as my daily terminal. Today I wanted to give a chance to Windows Terminal but I faced path issue right away.
I'm using NX monorepo in my project wihich is based on on react and strapi, develop commands are working fine with bash but when I run nx run cms:develop with Windows Terminal all I get is
/mnt/d/projects/[project_name]/apps/cms/node_modules/.bin/strapi: 12: node: not found
As you can see, there is /mnt at the begining of path and I don't know why/how it's added and what are the steps to get it working "the right way"
part of workspace.json
{
"$schema": "./node_modules/nx/schemas/workspace-schema.json",
"version": 2,
"projects": {
"cms": "apps/cms"
}
}
project.json located in D:[project_name]/apps/cms
{
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"projectType": "application",
"sourceRoot": "apps/cms/src",
"targets": {
"serve": {
"executor": "#nx-extend/strapi:serve",
"options": {}
},
"build": {
"executor": "#nx-extend/strapi:build",
"outputs": ["{options.outputPath}"],
"options": {
"outputPath": "dist/apps/cms"
},
"configurations": {
"production": {
"production": true
}
}
}
},
"tags": []
}
Thank for your help in advance
I'm having some issues with a CRUD desktop application I developed with the help of a freelancer. It's an electron-forge build that works seamlessly on Windows 10, and works on MacOS initially when accessing the out folder, the strange thing happens when:
I use npm run publish to zip the Mac/Darwin instance
I manually package.zip the results of npm run make
When I do this, and unzip the file to run, the SQLite integration fails completely. The app appears to be working upon start, but no changes can be made to the DB objects, nor can new objects be made.
The freelancer who put together the DB integration said he was not able to solve this issue, but it's impossible to put apps in marketplaces without zipping the application for delivery. I can post code if necessary, I just don't even know what aspect of the code would be relevant, and feel like there has to be something I can install/put in my package.json that might solve this, but I'm just not sure.
Here is my package.json file in case that is helpful:
{
"name": "C",
"productName": "C",
"version": "1.0.2",
"description": "My Electron application description",
"main": "src/index.js",
"scripts": {
"start": "cross-env NODE_ENV=development electron-forge start",
"package": "electron-forge package",
"make": "cross-env NODE_ENV=production electron-forge make",
"publish": "electron-forge publish",
"lint": "echo \"No linting configured\""
},
"keywords": [],
"author": {
"name": "A",
"email": "xxx#gmail.com"
},
"license": "NA",
"config": {
"forge": {
"packagerConfig": {
"icon": "src/images/n.ico"
},
"makers": [
{
"name": "#electron-forge/maker-squirrel",
"config": {
"name": "C"
}
},
{
"name": "#electron-forge/maker-zip",
"platforms": [
"darwin"
]
},
{
"name": "#electron-forge/maker-deb",
"config": {}
},
{
"name": "#electron-forge/maker-rpm",
"config": {}
}
]
}
},
"dependencies": {
"axios": "^0.21.1",
"bootstrap": "^4.6.0",
"cross-env": "^7.0.3",
"ebay-oauth-nodejs-client": "^1.2.1",
"electron-better-ipc": "^1.1.1",
"electron-squirrel-startup": "^1.0.0",
"electron-store": "^7.0.2",
"jquery": "^3.6.0",
"json-csv": "^3.0.6",
"sequelize": "^6.5.0",
"sqlite3": "^5.0.0"
},
"devDependencies": {
"#electron-forge/cli": "^6.0.0-beta.54",
"#electron-forge/maker-deb": "^6.0.0-beta.54",
"#electron-forge/maker-rpm": "^6.0.0-beta.54",
"#electron-forge/maker-squirrel": "^6.0.0-beta.54",
"#electron-forge/maker-zip": "^6.0.0-beta.54",
"electron": "10.1.5"
}
}
I found that by simply creating a DMG target (see https://www.electronforge.io/config/makers/dmg) that I did not need to worry about unzipping process. I believe DMG is the ideal approach for packaging Mac OS apps that have something like a SQLite database integration within.
First off, I'm new to react-native so please excuse my missing knowledge regarding troubleshooting.
I have built a basic app using Expo, which runs perfectly fine when I run expo start and scan the QR code to run it on my physical device.
I then ran expo build:android in my terminal and selected apk to create an apk file. It installs, but when I try to open the app on my phone, it crashes straight away. I'm not sure why this happens, or how to troubleshoot it.
Some steps I have taken:
Reinstalled expo-cli
Reinstalled react-native
Ran npm-update
Manually downgraded my sdkVersion to 37.0.0 in my app.json file (as suggested by online forums)
Here is my app.json file:
{
"expo": {
"name": "FactApp",
"slug": "FactApp",
"sdkVersion": "37.0.0",
"platforms": [
"ios",
"android",
"web"
],
"version": "1.0.0",
"orientation": "portrait",
"icon": "./assets/icon.png",
"splash": {
"image": "./assets/splash.png",
"resizeMode": "contain",
"backgroundColor": "#ffffff"
},
"android": {
"package": "com.kmdevops.factapp",
"versionCode": 2,
"config": {
"googleMobileAdsAppId": "ca-app-pub-7529073010403742/8555991419"
}
},
"updates": {
"fallbackToCacheTimeout": 0
},
"assetBundlePatterns": [
"**/*"
],
"ios": {
"supportsTablet": true,
"bundleIdentifier": "com.yourcompany.yourappname",
"buildNumber": "1.0.0"
},
"description": ""
}
}
And here is my package.json file:
{
"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"
},
"dependencies": {
"#react-native-community/masked-view": "0.1.6",
"#react-navigation/native": "^5.5.1",
"expo": "^37.0.12",
"expo-ads-admob": "~8.1.0",
"expo-linear-gradient": "~8.1.0",
"react": "~16.9.0",
"react-dom": "~16.9.0",
"react-native": "https://github.com/expo/react-native/archive/sdk-37.0.1.tar.gz",
"react-native-gesture-handler": "~1.6.0",
"react-native-reanimated": "~1.7.0",
"react-native-safe-area-context": "0.7.3",
"react-native-screens": "~2.2.0",
"react-native-web": "~0.11.7",
"react-navigation": "^4.3.9",
"react-navigation-stack": "^2.7.0",
"react-navigator": "0.0.0-0"
},
"devDependencies": {
"babel-preset-expo": "~8.1.0",
"#babel/core": "^7.8.6"
},
"private": true
}
Any help would be greatly appreciated!
So I created a fresh new app with expo-cli and the resulting APK crashed so I figure it's an issue with expo. I used react-native cli to create an apk for this app and it works with no issues
Building the .dmg works and running the .dmg installer works. When I open the installed app, the app's icon appears in the Mac tool bar for a second and then disappears. An error window then appears that says "App quit unexpectedly."
The app installs and functions perfectly on Windows machines with .exe that Electron-builder had built. I am confused as to how the .dmg is not functioning and working the same way. Is my package.json missing something or incorrect?
I have also attempted to build a .pkg, but the same error occurs.
How I build the file:
Run react-scripts build
Run electron-builder
My pacakge.json:
{
"name": "data-entry",
"packageName": "Data Entry App",
"version": "1.0.1",
"license": "MIT",
"description": "An app to quickly enter survey data.",
"private": true,
"author": "xxx",
"homepage": "./",
"main": "src/start.js",
"productName": "Data Entry App",
"nsis": {
"createDesktopShortcut": "always",
"oneClick": false,
"perMachine": false,
"allowToChangeInstallationDirectory": true
},
"repository": {
"type": "git",
"url": "xxx"
},
"build": {
"files": [
"app/**/*",
"node_modules/**/*",
"package.json"
],
"appId": "com.myapp.DataEntry",
"publish": {
"provider": "github",
"repo": "xxx",
"owner": "xxx"
},
"npmRebuild": false,
"directories": {
"buildResources": "assets"
},
"mac": {
"target": "dmg"
},
"win": {
"target": "nsis"
}
},
"dependencies": {
"#material-ui/core": "^4.9.1",
"#material-ui/icons": "^4.5.1",
"#material-ui/lab": "^4.0.0-alpha.41",
"electron-is-dev": "^1.1.0",
"electron-json-storage": "^4.1.8",
"electron-log": "^4.0.6",
"electron-store": "^5.1.0",
"electron-updater": "^4.2.0",
"firebase": "^7.8.1",
"grpc": "^1.23.3",
"http2": "^3.3.7",
"node": "^10.9.0",
"node-pre-gyp": "^0.12.0",
"notistack": "^0.9.7",
"react": "^16.11.0",
"react-csv": "^1.1.2",
"react-dom": "^16.11.0",
"react-scripts": "3.2.0",
"react-with-firebase-auth": "^1.3.0"
},
"scripts": {
"start": "react-scripts start",
"electron": "electron .",
"pack": "electron-builder --dir",
"dist": "electron-builder",
"react-build": "react-scripts build",
"dist-all": "electron-builder"
},
"eslintConfig": {
"extends": "react-app"
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
},
"devDependencies": {
"electron": "^7.1.8",
"electron-builder": "^20.44.4"
}
}
I was running an Electron project, and everything worked just fine. But now when I run any of the scripts in my package.json (including npm start), it just escapes a line and doesn't do anything.
My package.json:
{
"name": "interclip-desktop",
"version": "0.0.7",
"description": "Interclip for desktop",
"repository": "https://github.com/aperta-principium/Interclip-desktop",
"main": "main.js",
"scripts": {
"start": "electron .",
"package-mac": "electron-packager . --overwrite --asar=true --platform=darwin --arch=x64 --icon=assets/icons/mac/icon.icns --prune=true --out=release-builds",
"package-win": "electron-packager . Interclip --overwrite --platform=win32 --arch=ia32 --icon=assets/icons/win/icon.ico --prune=true --out=release-builds --version-string.CompanyName=CE --version-string.FileDescription=CE --version-string.ProductName=\"Interclip\"",
"package-linux": "electron-packager . Interclip --overwrite --asar=true --platform=linux --arch=x64 --icon=assets/icons/png/icon.png --prune=true --out=release-builds",
"win-install": "node installers/windows/createinstaller.js",
"postinstall": "electron-builder install-app-deps",
"build": "electron-builder --linux",
"release": "electron-builder --linux --publish always"
},
"keywords": [
"Desktop",
"Interclip"
],
"author": "Filip Troníček",
"license": "MIT",
"devDependencies": {
"electron": "^7.1.2",
"electron-builder": "^22.1.0",
"electron-installer-dmg": "^3.0.0",
"electron-packager": "^14.1.1",
"electron-reload": "^1.5.0",
"electron-winstaller": "^4.0.0"
},
"dependencies": {
"axios": "^0.19.0",
"mousetrap": "^1.6.3"
},
"build": {
"appId": "com.aperta-principium.interclip",
"productName": "Interclip",
"mac": {
"category": "public.app-category.utilities"
},
"dmg": {
"icon": false
},
"linux": {
"target": [
"AppImage"
],
"category": "Utility"
}
}
}
I tried updating NPM, didn't work. When I tried in different projects, also doesn't work.
Thanks in advance
npm has a ignore-scripts configuration key. It's expected value is a Boolean and it's set to false by default.
Perhaps it has inadvertently been set to true.
To get/set the ignore-scripts configuration you can utilize the npm-config command:
Check its current setting by running:
npm config get ignore-scripts
If the aforementioned command returns true then reset it to false by running:
npm config set ignore-scripts false
If you are using an integrated terminal (such as the VsCode integrated terminal) try running your npm "run dev' command from your PowerShell (or cmd) terminal. This error arises as a result of your integrated terminal not recognizing your command (especially if you created your app with a git bash terminal).
Try this, and I hope it helps someone cause it always works for me. Cheers!!!