Kivy: Permission Denied when subprocess run executable file on android - kivy

I have built c code as android executable file and tried to run it with kivy app using subprocess.run("main").
But it says PermissionError: [Errno 13] Permission denied: 'main'.
I tried to push and run it with adb on android emulator, it failed, Permission denied: 'main'.
So, adb shell > chmod +x main, then it works.
How to run an executable file with kivy python on android?
Thanks.

Related

react-native run-ios is having issues connecting to the iOS simulator

I'm having issues running my react-native app on the iOS Simulator. It runs fine on my Windows machine on the Android simulator, so I'm pretty sure it has nothing to do with my own code.
The issue seems to have something to do with permissions.
If I run react-native run-ios and the simulator as my user (not root), it seems to find the simulator fine, but I get an error during build:
2017-03-12 14:22:05.656 xcodebuild[2612:76143] couldn't read dependency graph from '/Users/jordan/src/anxiety-work-tracker/ios/build/Build/Intermediates/React.build/Debug-iphonesimulator/yoga.build/dgph': Permission denied
2017-03-12 14:22:05.677 xcodebuild[2612:76144] couldn't read dependency graph from '/Users/jordan/src/anxiety-work-tracker/ios/build/Build/Intermediates/React.build/Debug-iphonesimulator/jschelpers.build/dgph': Permission denied
2017-03-12 14:22:05.677 xcodebuild[2612:76143] unable to create temporary file at /Users/jordan/src/anxiety-work-tracker/ios/build/Build/Intermediates/React.build/Debug-iphonesimulator/yoga.build/dgph-1BUDub2D: Permission denied
2017-03-12 14:22:05.677 xcodebuild[2612:76144] unable to create temporary file at /Users/jordan/src/anxiety-work-tracker/ios/build/Build/Intermediates/React.build/Debug-iphonesimulator/jschelpers.build/dgph-pZNRO08O: Permission denied
2017-03-12 14:22:05.679 xcodebuild[2612:76144] DVTAssertions: Warning in /Library/Caches/com.apple.xbs/Sources/IDEXcode3ProjectSupport/IDEXcode3ProjectSupport-11758/Xcode3Core/LegacyProjects/Frameworks/DevToolsCore/DevToolsCore/BuildSystem/DependencyGraph/XCDependencyGraph.mm:688
Details: unable to write dependency graph: Permission denied
Object: <XCDependencyGraph>
Method: +loadOrCreateInBuildDirectory:withTargetBuildContext:withBasePath:
Thread: <NSThread: 0x7facda2f3090>{number = 9, name = (null)}
Please file a bug at http://bugreport.apple.com with this warning message and any useful information you can provide.
2017-03-12 14:22:05.679 xcodebuild[2612:76143] DVTAssertions: Warning in /Library/Caches/com.apple.xbs/Sources/IDEXcode3ProjectSupport/IDEXcode3ProjectSupport-11758/Xcode3Core/LegacyProjects/Frameworks/DevToolsCore/DevToolsCore/BuildSystem/DependencyGraph/XCDependencyGraph.mm:688
Details: unable to write dependency graph: Permission denied
Object: <XCDependencyGraph>
Method: +loadOrCreateInBuildDirectory:withTargetBuildContext:withBasePath:
Thread: <NSThread: 0x7facd9f73a90>{number = 8, name = (null)}
Please file a bug at http://bugreport.apple.com with this warning message and any useful information you can provide.
Build Preparation
Couldn't create workspace arena folder '/Users/jordan/src/anxiety-work-tracker/ios/build': Unable to write to info file '<DVTFilePath:0x7facd9e06ec0:'/Users/jordan/src/anxiety-work-tracker/ios/build/info.plist'>'.
Couldn't update module cache session file '/Users/jordan/src/anxiety-work-tracker/ios/build/ModuleCache/Session.modulevalidation': You don’t have permission to save the file “Session.modulevalidation” in the folder “ModuleCache”.
** BUILD FAILED **
The simulator then does load the app, but has an error saying that it couldn't load from the module cache.
If I run react-native run-ios as root and the Simluator as my user, it says that it can't find a running simulated device.
If I run both as root, I get the following when running react-native run-ios:
** BUILD SUCCEEDED **
Installing build/Build/Products/Debug-iphonesimulator/AnxietyWorkTracker.app
An error was encountered processing the command (domain=com.apple.CoreSimulator.SimError, code=163):
Unable to lookup service com.apple.CoreSimulator.host_support: 0x44e
Launching org.reactjs.native.example.AnxietyWorkTracker
An error was encountered processing the command (domain=com.apple.CoreSimulator.SimError, code=163):
Unable to lookup service com.apple.CoreSimulator.host_support: 0x44e
The simulator does not load anything.
Update
Per Rob's comment, I changed the permissions/owner on the directory.
sudo chown -R <username> <srcPath>
This allowed the build to succeed running as my non-root user. Running react-native run-ios however built, opened the Simulator, opened the app in the Simulator, and then produced this error:
I know I added this in an update to the OP, but I wanted this SO Question to be marked answered, since it has been.
Per Rob's comment, the issue was permissions on my source directory.
sudo chown -R <username> ~/src/<project-dir-name>

Permission denied when building a Cordova app with XCode

I'm trying to build a Cordova project that was created in a Windows computer, however i keep getting a Permission Denied (13) error for all the files.
I tried running chmod +x and chmod 777 on these files and on the copy-www-build-step.sh file but still the same error.
rsync: readlink: "Users/xxx/xxx/platforms/ios/www/cordova-js-src/exec.js" failed: Permission Denied (13)
rsync: readlink: "Users/xxx/xxx/platforms/ios/www/cordova-js-src/platform.js" failed: Permission Denied (13)
etc..
The same error apply to all the files, even the .css ones.
rsync: readlink: "Users/xxx/xxx/platforms/ios/www/css/style.css" failed: Permission Denied (13)
Even after executing: sudo chmod 777 platforms/ios/www/cordova-js-src/exec.js the problem remains.
What could cause this type of errors ?

ENOENT system.log while running ionic emulate ios

I am following this guide: http://ionicframework.com/getting-started/
Once I get to ionic emulate ios I get
Error: ENOENT: no such file or directory, stat '/Users/$USERNAME/Library/Logs/CoreSimulator/DCB9BBDE-FFEC-43CD-B88E-FFFB6CBF0045/system.log'
I tried what other people did to solve their problem, like
chown your $HOME to yourself
remove platforms folder
remove XCode and install again
But none of this solved my problem.
I am on OSX El Capitan, using node v4.3.1 installed with nave (might this be an issue?).
I've tried with a fresh new project and got this
ENOENT: no such file or directory, stat '/Users/$USER/Library/Logs/CoreSimulator/FF5BE4A0-C42E-4C35-884F-21EFC514A846/system.log'
Error code 1 for command: ios-sim with args: launch,/Users/$USER/workspace/myApp/platforms/ios/build/emulator/myApp.app,--devicetypeid,com.apple.CoreSimulator.SimDeviceType.iPhone-6,--stderr,/Users/$USER/workspace/myApp/platforms/ios/cordova/console.log,--stdout,/Users/$USER/workspace/myApp/platforms/ios/cordova/console.log,--exit
Error: /Users/$USER/workspace/myApp/platforms/ios/cordova/run: Command failed with exit code 2
Thank you in advance
Hi please see my answer to the following question:
ionic emulate ios (domain=com.apple.CoreSimulator.SimError, code=163)
After this, I tried:
sudo chown -R $USER:$GROUP ~/.npm sudo chown -R $USER:$GROUP ~/.config
in terminal and was able to run the app in a simulator

cant run ios simulator on cordova

On running the command
cordova emulate ios
I get an error, as below. I actually get rm: could not remove & permission denied errors so I use sudo. I was able to run this no problem, and then after a reboot - although nothing was changed - this function does not work. After build succeeded - deploying to emulator I get this error
An error was encountered processing the command (domain=com.apple.CoreSimulator.SimError, code=159):
Invalid device state
ENOENT: no such file or directory, stat '/Users/user/Library/Logs/CoreSimulator/8F3C9A0F-D432-49A4-84DA-D0480829884A/system.log'
Error code 1 for command: ios-sim with args: launch,/Users/user/helloworld/platforms/ios/build/emulator/helloworld.app,--devicetypeid,com.apple.CoreSimulator.SimDeviceType.iPhone-4s,--stderr,/Users/user/helloworld/platforms/ios/cordova/console.log,--stdout,/Users/user/helloworld/platforms/ios/cordova/console.log,--exit
Error: /Users/user/helloworld/platforms/ios/cordova/run: Command failed with exit code 2
at ChildProcess.whenDone (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:139:23)
at emitTwo (events.js:87:13)
at ChildProcess.emit (events.js:172:7)
at maybeClose (internal/child_process.js:818:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
I have reinstalled sudo npm install ios-sim -g and same error. How can I run it properly?
This happens due to the permissions on mac:
Here are the steps you can use to correct this issue:
Empty the 'platforms' folder in your Cordova project.
Re-run Cordova platform add ios, Cordova build ios, and Cordova emulate ios without sudo.
If you are on a Mac and are still getting a permissions error, make sure all the files in your user's home folder actually belong to that user by running sudo chown -R username /Users/username
Its happening when you don't have simulator configurations for the root user.
Following command worked for me
sudo npm install -g ios-sim
If it's not working you can try removing platforms as the root user and add it back as normal user.
This happens because xcode command line tools are not installed in your system
https://github.com/driftyco/ionic/issues/4657.
Do a xcode-select --install from your terminal and reboot the system should work fine.

How to get the permission in NDK

I am new to Android NDK and I have to use OpenCV in Android.
I tried to ran the NDK ahead , but these errors happened. Maybe I have no permission to use the file" /obj/local/armeabi/libopencv_contrib.a",How can I get the permission? And can the next error be OK when the first error is solved?
My workspace OS is Windows7.
$ NDK-build
SharedLibrary : libImgFun.so
D:/Android/android-ndk-r7b-windows/android-ndk-r7b/toolchains/arm-linux-androideabi-4.4.3/prebuilt/windows/bin/../lib/gcc/arm-linux-androideabi/4.4.3/../../../../arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/libopencv_contrib.a: No such file: Permission denied
collect2: ld returned 1 exit status
/cygdrive/d/Android/android-ndk-r7b-windows/android-ndk-r7b/build/core/build-binary.mk:314: recipe for target `obj/local/armeabi/libImgFun.so' failed
make: * [obj/local/armeabi/libImgFun.so] Error 1
I had the same problem on Windows 7. I was able to just use chmod to set the permissions manually, and then it worked. My best guess is that this is a bug with how Cygwin, Windows, and the build process interact.
Open a console window
> bash
> cd /cygdrive/<driveletter>/<wherever your project is>/obj/local/armeabi
> chmod 777 ./*

Resources