ligi / IPFSDroid

Android App for the InterPlanetary File System(IPFS)
GNU General Public License v3.0
304 stars 73 forks source link

CRASH: val exec = Runtime.getRuntime().exec(command, env) #14

Closed arranlomas closed 7 years ago

arranlomas commented 7 years ago

java.io.IOException: Cannot run program "/data/user/0/my.package/files/ipfsbin": error=13, Permission denied

what permission is required? i have included the following:

i am calling the download function and then directly following it with the run function

I am using the IPFSDaemon (https://github.com/ligi/IPFSDroid/blob/master/app/src/main/java/org/ligi/ipfsdroid/IPFSDaemon.kt) and trying to use it with java

my code is (in onCreate of my MainActivity):

IPFSDaemon ipfsDaemon = new IPFSDaemon(this); if (ipfsDaemon.isReady()){ ipfsDaemon.run("daemon"); //start daemon } else{ ipfsDaemon.download(this) ; ipfsDaemon.run("daemon"); < --- CRASH HERE! //download daemon then run }

the crash is on ipfsDaemon.run("daemon"); in the else block. it crashes immediatly, seemingly not enough to download and init the binary.

What would be the process to download and init ipfs in the onCreate of an activity. The IPFS daemon is exactly the same as the one in the link.

ligi commented 7 years ago

The download takes a while - this is what you need to do:

1) download 2) wait for download to finish 3) run when ready