Hello, I am trying to run a native executable from inside an android java application. The native executable exists in my assets. At start of activity, I copy it from assets to my application cache dir. then I use ProcessBuilder to run it.
here is a code snippet private void startEngine(File executableFile) throws IOException { ProcessBuilder processBuilder = new ProcessBuilder (executableFile.getPath()).directory(executableFile.getParentFile()); Process process = processBuilder.start(); } I get an IOException when I try to run this code and here is a snippet of the stacktrace java.io.IOException: Error running exec(). Commands: [/data/data/ <my.package.name>/cache/<my_executable_file>] Working Directory: /data/ data/<my.package.name>/cache Environment: [LD_LIBRARY_PATH=/system/ lib, ANDROID_ROOT=/system, ANDROID_ASSETS=/system/app, ANDROID_SOCKET_zygote=10, PATH=/sbin:/system/sbin:/system/bin:/system/ xbin, EXTERNAL_STORAGE=/sdcard, ANDROID_DATA=/data, ANDROID_PROPERTY_WORKSPACE=9,32768, BOOTCLASSPATH=/system/framework/ core.jar:/system/framework/ext.jar:/system/framework/framework.jar:/ system/framework/android.policy.jar:/system/framework/services.jar, ANDROID_BOOTLOGO=1] at java.lang.ProcessManager.exec(ProcessManager.java:196) at java.lang.Runtime.exec(Runtime.java:225) at java.lang.ProcessBuilder.start(ProcessBuilder.java:219) at <my.package.name>.engine.EngineInterface.startEngine(....) ........................... ........................... Caused by: java.io.IOException: Permission denied at java.lang.ProcessManager.exec(Native Method) at java.lang.ProcessManager.exec(ProcessManager.java:194) ... 18 more I tried to run "chmod 777" on the file and on cache directory containing it and I ensured permissions are granted using adb shell. but I still get this permission exception. Can anyone help? thanks in advance -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en