What is causing this project to fail on Macbook Pro when It runs just fine on windows 10 - nativescript

I have a nativescript application in windows that deploys to the emulator just fine, but when I git clone onto the MacBook Pro and run the same process, I get:
new-host:nativescript jbaird$ tns run android
Searching for devices...
Starting Android emulator with image Nexus_5X_API_26
Waiting for emulator device initialization...
Executing before-liveSync hook from /Users/jbaird/Documents/development/gr8dates/Nativescript/hooks/before-liveSync/nativescript-angular-sync.js
Executing before-prepare hook from /Users/jbaird/Documents/development/gr8dates/Nativescript/hooks/before-prepare/nativescript-dev-typescript.js
Found peer TypeScript 2.4.2
Preparing project...
Project successfully prepared (Android)
Building project...
Unable to apply changes on device: emulator-5554. Error is: spawn EACCES.
Executing after-watch hook from /Users/jbaird/Documents/development/gr8dates/Nativescript/hooks/after-watch/nativescript-dev-typescript.js
Any ideas? Thanks in advance.

The error is a permission error. Therefore, all you need to do is give access to the the folder you are running your apps from. The process involves you to copy and paste the command below into your terminal.
sudo chmod -R a+rwx /AppFolder
The command is an administrator command, therefore, you may have to insert your system password.
PS: Definitely, you hit enter and there will be a prompt for you to insert your password.
Let me know if you have any challenges with this solution!

emulator-5554. Error is: spawn EACCES.emulator-5554. Error is: spawn EACCES.
Seems a permission error. You could solve it by:
sudo,
Or, by giving +x permision to your hooks folder?

Related

Azure functions throwing error when trying to debug on MacOS

Trying to debug an Azure functions project.
On the mac clicking F5 and starting the debug.
And the output is this :
[2021-07-25T08:47:57.429Z] Cannot create directory for shared memory usage: /dev/shm/AzureFunctions
[2021-07-25T08:47:57.434Z] System.IO.FileSystem: Access to the path '/dev/shm/AzureFunctions' is denied. Operation not permitted.
Value cannot be null. (Parameter 'provider')
Has anybody encountered this before and know how to fix this ?
I tried running visual studio code with administrator permissions like this :
sudo open ./Visual\ Studio\ Code.app
Also tried to mkdir the /dev/shm directory but it just keeps giving this error.
What should I do ?
Solution was adding --verbose mode and see the logs. The problem was that azure didn't support node version 15. Downgraded nodejs to version 13.12.0 and it worked.
Step 1: Downgrade nodejs to 14.x
https://nodejs.org/download/release/v14.19.0/
Step 2: run in verbose mode
Open terminal, change to api folder, and enter the below command
func start --verbose

How can I resolve a package installation error in Julia on Windows?

I have just started using Julia on a Windows 10 machine, and I have been trying to install some very basic packages. When I use the Pkg.add() command, however, the command window returns the following error:
ERROR: SystemError: opening file C:\Users\username\.julia\environments\v1.0\Project.toml: Permission denied
The error message pops up even when using the Administrator mode. Any advice or tips would be appreciated! Thanks!
Delete .julia folder or set a new location for the JULIA_DEPOT_PATH.
Once done use a non-administrator account (the one you normally work with) to reinstall packages.

Running Electron with Linux on Windows

I'm trying to get an electron forge app running on my Windows 10 machine via Linux on windows (using the new built-in windows bash functionality).
When running electron-forge start I am getting back the error message:
[1484:1126/222326.466455:FATAL:setuid_sandbox_host.cc(157)] The SUID sandbox helper binary was found, but is not configured correctly. Rather than run without sandboxing I'm aborting now. You need to make sure that /mnt/c/.../node_modules/electron/dist/chrome-sandbox is owned by root and has mode 4755.
From some searching, this thread on the electron Github makes it pretty clear that this is somewhat by design and the way to get around it is to run chmod as a root user post-installing all of the dependencies.
I attempted to do this and the command looked like it had worked (no error on running the chmod to 4755), but that didn't fix running electron-forge start - I still got the same error message. I looked into that a bit and it seems that this has to do with what files the linux subsystem are allowed to control permissions for per this Microsoft thread.
Is there some other trick to getting electron forge to work with bash on Windows?
I found that running the electron-forge init from Windows powershell into a native Windows directory allowed me to subsequently use npm start in my-app (for example) in WSL. So ultimately what I ran was
powershell npx create-electron-app my-app
(I have alias powershell="/mnt/c/windows/system32/WindowsPowerShell/v1.0/powershell.exe" in my .bashrc file)

W/PackageManager: Not granting permission android.permission.CAMERA to package <my package name> because it was previously installed without

I cannot get rid of this error:
W/PackageManager: Not granting permission android.permission.CAMERA to package because it was previously installed without
This error is preventing me from accessing the camera from my app. I tried uninstalling the apk with adb uninstall and I get:
Failure [DELETE_FAILED_INTERNAL_ERROR]
I then tried changing the package name to install a new apk. I still get the same error in the new app. Any suggestions would be appreciated.
Try with rebooting AT device because
Dangerous permissions requested by apps are not granted until the next device reboot.This includes new app installs and new elements in existing apps.
see AT Release Note
Also, You can install application with granting permission using adb command line as below
adb install -g yourapk.apk
If you have rebooted and the Permissions issue(s) still exist, do the following steps:
Reboot
Connect via adb: adb connect Android.local:5555
Uninstall the apk: adb uninstall (you package name)
reboot
install your apk
reboot
Happy Coding!

Running ios-sim with Jenkins

I'm trying to start my app from the command line using ios-sim but this is what I get:
Started by user User
Building in workspace /Users/Shared/Jenkins/Home/jobs/UI Testing/workspace
[workspace] $ /bin/sh -xe /var/folders/h4/ws64t3bx2nnds4pg3345xrr000009c/T/hudson6341279754557259451.sh
+ /Users/myUser/Desktop/ios-sim launch /Users/Shared/Jenkins/Home/jobs/Project_Monkey_Build/workspace/build/Debug-iphonesimulator/ProjectMonkey.app
[DEBUG] Could not start simulator session: Error Domain=DTiPhoneSimulatorErrorDomain Code=5
"Operation failed with underlying error 4294956486." UserInfo=0x1001b1760
{NSLocalizedDescription=Operation failed with underlying error 4294956486.,
NSUnderlyingError=0x1001a3390 "The operation couldn’t be completed. (OSStatus error -10810.)"}
It looks like a permission problem as I can run the same command from terminal and it works fine. I've also tried to give full 777 permission to ios-sim and the MonkeyTalk directory,but still nothing.
Any idea?
It might be related to the Jenkins process not having a "display". Try running Jenkins as a user logged in to the desktop, then run the ios-sim again.
Unload Jenkins from launchd:
sudo launchctl unload /Library/LaunchDaemons/org.jenkins-ci.plist
Then run Jenkins from a terminal:
sudo su jenkins -c "JENKINS_HOME=/Users/Shared/Jenkins/Home /Library/Application\ Support/Jenkins/jenkins-runner.sh"
If this works, you can make Jenkins always run as a logged in user by moving the launchd job config file from /Library/LaunchDaemons/org.jenkins-ci.plist to ~/Library/LaunchAgents/org.jenkins-ci.plist
I know this post was from a while ago, and not sure if anyone is checking it, but I also ran into this issue recently and it turned out that there was a duplicate app already in the iphone simulator creating an issue and not letting the new app run.
I reset the simulator and it then worked. I then added the applescript to reset the simulator each time before running ios-sim. this script can be found here...
How can I reset the iOS Simulator from the command line?
Scroll down the answer that has 13 up votes next to it, not the one that was checked marked.
Hope this helps someone in the future..
It looks like the only workaround it's to run the command as super user:
sudo /Users/myUser/Desktop/ios-sim launch /Users/Shared/Jenkins/Home/jobs/Project_Monkey_Build/workspace/build/Debug-iphonesimulator/ProjectMonkey.app
I was also facing the same problem and found that jenkins user is not correctly set up to run test case on simulator. Follow instruction given on below website:
http://pivotallabs.com/ios-ci-jenkins/
see the section "SETTING UP THE JENKINS USER".
hope it will work for you as well.

Resources