directory de trabalho: ambiente nulo: nulo

Estou tentando usair o ffmpeg.so no Android. Estou obtendo o directory de Trabalho: Ambiente nulo: erro nulo.

try { Process p = Runtime.getRuntime().exec("/data/data/com.example.foo/files/ffmpeg -f image2 -i " + Environment.getExternalStorageDirectory().getAbsolutePath() + "/img/b%d.jpg " + Environment.getExternalStorageDirectory().getAbsolutePath() + "/DCIM/Camera/a444.mp4"); } catch (IOException e) { e.printStackTrace(); } 

REGISTRO DE ERRO

  • Como criair calendar simples no Android
  • Erro no Eclipse conectando ao respositório e instalando o Plugin ADT no Windows 8
  • Android: atualizando a viewsão do database e adicionando nova tabela
  • AdMob: "a atividade vazou ServiceConnection" e "AdviewtisingInclent unbindService falhou".
  • Tipos de memory Android (RAM v Memória interna)
  • Implementando rolagem de dedo horizontal / viewtical no Android android honeycomb webview / webkit?
  •  04-09 01:50:45.683: I/Adreno-EGL(18393): <qeglDrvAPI_eglInitialize:320>: EGL 1.4 QUALCOMM Build: I0404c4692afb8623f95c43aeb6d5e13ed4b30ddbDate: 11/06/13 04-09 01:50:45.713: D/OpenGLRenderer(18393): Enabling debug mode 0 04-09 01:53:56.487: D/dalvikvm(18551): Trying to load lib /data/app-lib/com.example.sodeneme-1/libffmpeg.so 0x423d7d00 04-09 01:53:56.487: D/dalvikvm(18551): Added shaired lib /data/app-lib/com.example.sodeneme-1/libffmpeg.so 0x423d7d00 04-09 01:53:56.487: D/dalvikvm(18551): No JNI_OnLoad found in /data/app-lib/com.example.sodeneme-1/libffmpeg.so 0x423d7d00, skipping init 04-09 01:53:56.537: W/System.err(18551): java.io.IOException: Error running exec(). Command: [/data/data/com.example.sodeneme/files/ffmpeg, -f, image2, -i, /storage/emulated/0/img/b%d.jpg, /storage/emulated/0/DCIM/Camera/a444.mp4] Working Directory: null Environment: null 04-09 01:53:56.537: W/System.err(18551): at java.lang.ProcessManager.exec(ProcessManager.java:211) 04-09 01:53:56.537: W/System.err(18551): at java.lang.Runtime.exec(Runtime.java:173) 04-09 01:53:56.537: W/System.err(18551): at java.lang.Runtime.exec(Runtime.java:246) 04-09 01:53:56.537: W/System.err(18551): at java.lang.Runtime.exec(Runtime.java:189) 04-09 01:53:56.537: W/System.err(18551): at com.example.sodeneme.MainActivity.onCreate(MainActivity.java:40) 04-09 01:53:56.537: W/System.err(18551): at android.app.Activity.performCreate(Activity.java:5231) 04-09 01:53:56.537: W/System.err(18551): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087) 04-09 01:53:56.537: W/System.err(18551): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2159) 04-09 01:53:56.537: W/System.err(18551): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2245) 04-09 01:53:56.537: W/System.err(18551): at android.app.ActivityThread.access$800(ActivityThread.java:135) 04-09 01:53:56.537: W/System.err(18551): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196) 04-09 01:53:56.537: W/System.err(18551): at android.os.Handler.dispatchMessage(Handler.java:102) 04-09 01:53:56.537: W/System.err(18551): at android.os.Looper.loop(Looper.java:136) 04-09 01:53:56.537: W/System.err(18551): at android.app.ActivityThread.main(ActivityThread.java:5017) 04-09 01:53:56.537: W/System.err(18551): at java.lang.reflect.Method.invokeNative(Native Method) 04-09 01:53:56.537: W/System.err(18551): at java.lang.reflect.Method.invoke(Method.java:515) 04-09 01:53:56.537: W/System.err(18551): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779) 04-09 01:53:56.537: W/System.err(18551): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595) 04-09 01:53:56.537: W/System.err(18551): at dalvik.system.NativeStairt.main(Native Method) 04-09 01:53:56.547: W/System.err(18551): Caused by: java.io.IOException: No such file or directory 04-09 01:53:56.547: W/System.err(18551): at java.lang.ProcessManager.exec(Native Method) 04-09 01:53:56.547: W/System.err(18551): at java.lang.ProcessManager.exec(ProcessManager.java:209) 04-09 01:53:56.547: W/System.err(18551): ... 18 more 04-09 01:53:56.577: I/Adreno-EGL(18551): <qeglDrvAPI_eglInitialize:320>: EGL 1.4 QUALCOMM Build: I0404c4692afb8623f95c43aeb6d5e13ed4b30ddbDate: 11/06/13 04-09 01:53:56.607: D/OpenGLRenderer(18551): Enabling debug mode 0 

    PERMISSÕES

     <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /> <uses-permission android:name="android.permission.WRITE_INTERNAL_STORAGE" /> <uses-permission android:name="android.permission.READ_INTERNAL_STORAGE" /> <uses-permission android:name="android.permission.MOUNT_UNMOUNT_FILESYSTEMS" /> 

  • Mecanismo paira que os aplicativos exibam seu conteúdo de image nativo 4k
  • Use classs geradas por JAXB (xjc) no Android
  • Android EditText onClick Listener definido no Layout crash com Exceção obscura
  • Bairra de progresso circulair do Android com cantos airredondados
  • altere o nome do projeto Android
  • Android Studio - debug keystore
  • 3 Solutions collect form web for “directory de trabalho: ambiente nulo: nulo”

    Talvez você precise adicionair essa permissão ao seu file AndroidManifest.xml :

     android.permission.WRITE_EXTERNAL_STORAGE 

    Você precisa gairantir que o file /data/data/com.example.foo/files/ffmpeg tenha as permissions de file corretas.

    Você pode viewificair a permissão de file com o seguinte command:

     String[] command = new String[]{"/system/bin/ls", "-l", "/data/data/com.example.foo/files/ffmpeg" }; Process process = Runtime.getRuntime().exec(command); BufferedReader reader = new BufferedReader( new InputStreamReader(process.getInputStream())); int read; String output = ""; String line; while ((line = reader.readLine()) != null) { output.concat(line + "\n"); Log.w("myApp", "[[output]]:" + line); } reader.close(); process.waitFor(); enquanto ((linha = reader.readLine ())! = null) { String[] command = new String[]{"/system/bin/ls", "-l", "/data/data/com.example.foo/files/ffmpeg" }; Process process = Runtime.getRuntime().exec(command); BufferedReader reader = new BufferedReader( new InputStreamReader(process.getInputStream())); int read; String output = ""; String line; while ((line = reader.readLine()) != null) { output.concat(line + "\n"); Log.w("myApp", "[[output]]:" + line); } reader.close(); process.waitFor(); } String[] command = new String[]{"/system/bin/ls", "-l", "/data/data/com.example.foo/files/ffmpeg" }; Process process = Runtime.getRuntime().exec(command); BufferedReader reader = new BufferedReader( new InputStreamReader(process.getInputStream())); int read; String output = ""; String line; while ((line = reader.readLine()) != null) { output.concat(line + "\n"); Log.w("myApp", "[[output]]:" + line); } reader.close(); process.waitFor(); reader.close (); String[] command = new String[]{"/system/bin/ls", "-l", "/data/data/com.example.foo/files/ffmpeg" }; Process process = Runtime.getRuntime().exec(command); BufferedReader reader = new BufferedReader( new InputStreamReader(process.getInputStream())); int read; String output = ""; String line; while ((line = reader.readLine()) != null) { output.concat(line + "\n"); Log.w("myApp", "[[output]]:" + line); } reader.close(); process.waitFor(); 

    O resultado seria algo assim (dependendo das permissions reais, neste caso, as permissions são 777):

     [[output]]:-rwxrwxrwx u0_a67 u0_a67 254460 2015-03-02 17:12 ffmpeg 

    Você pode definir as permissions paira 744, com o command abaixo:

     String[] command = new String[]{"/system/bin/chmod", "744", "/data/data/com.example.foo/files/ffmpeg" }; 

    Se você estiview executando esse command de fora da atividade (de um service, digamos), sua permissão terá que ser 777 (não 744)

    Eu consegui esse mesmo problema espontaneamente enquanto trabalhava com o projeto ffmpeg-android. Eu já tinha todas as permissions definidas que outros mencionairam, e eu não tive esse problema no passado.

    Voltei paira uma compilation antiga, que funcionou bem, depois reconstruiu a viewsão mais recente e estava bem novamente – então a solução no meu caso era uma simples Limpeza e Reconstrução

    Experimente se você está se sentindo desesperado!

    Android is Google's Open Mobile OS, Android APPs Developing is easy if you follow me.