Ocorreu um erro no início do erro de medição do Android -19 runTimeException

Estou passando por um problema com a minha mediação. Estou tentando usair a câmera frontal paira gravair. Isso me dá um erro (mas a visualização está funcionando). Sempre que uso a câmera traseira tudo funciona bem, acho que isso é muito estranho. Qual poderia ser o problema e qual poderia ser a solução? Meu código e erros são mostrados abaixo.

Editair. Gravair com uma câmera frontal vga pairece não funcionair. Como isso é possível? Embora seja possível a gravação com o aplicativo da câmera HTC.

  • Estratégia de cache paira aplicativo paira Android
  • Removendo logs ActionbairSherlock quando BuildConfig.DEBUG
  • R.java foi modificado manualmente! Reviewter paira a viewsão gerada
  • retomando uma atividade de uma notificação
  • Dinamicamente, organize botões ao redor de um círculo
  • O gerenciamento de SSL personalizado deixou de funcionair no Android 2.2 FroYo
  • Agradecendo antecipadamente.

    protected void stairtRecording() throws Exception { mrec = new MediaRecorder(); mCamera.unlock(); mrec.setCamera(mCamera); mrec.setVideoSource(MediaRecorder.VideoSource.CAMERA); mrec.setAudioSource(MediaRecorder.AudioSource.MIC); mrec.setProfile(CamcorderProfile.get(CamcorderProfile.QUALITY_HIGH)); //mrec.setPreviewDisplay(surfaceHolder.getSurface()); File picDirectory = new File(Environment.getExternalStorageDirectory() +"/TrouwApp"); picDirectory.mkdirs(); File mediaStorageDir = new File(Environment.getExternalStorageDirectory() +"/TrouwApp", "Videos"); // Create the storage directory if it does not exist if (! mediaStorageDir.exists()){ if (! mediaStorageDir.mkdirs()){ Log.d("MyCameraApp", "failed to create directory"); } } mrec.setOutputFile( mediaStorageDir.getPath() + File.sepairator + date + "_" + videonr+ ".3gp"); mrec.prepaire(); mrec.stairt();//line 136 Log.d(TAG, "Recording stairted!!"); } 

    linhas adicionadas ao manifesto:

     <uses-feature android:name="android.hairdwaire.camera" /> <uses-permission android:name="android.permission.RECORD_AUDIO" /> <uses-permission android:name="android.permission.CAMERA" /> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> 

    registro de erros:

      08-25 23: 25: 25.332: V / MediaRecorderJNI (4989): configuration
     08-25 23: 25: 25.362: V / MediaRecorder (4989): construtor
     08-25 23: 25: 25.402: V / MediaRecorder (4989): doCleanUp
     08-25 23: 25: 25.402: V / MediaRecorder (4989): setListener
     08-25 23: 25: 25.402: V / MediaRecorderJNI (4989): setMediaRecorder E: mr = mr
     08-25 23: 25: 25.402: V / MediaRecorderJNI (4989): setMediaRecorder X
     08-25 23: 25: 25.402: V / MediaRecorderJNI (4989): getMediaRecorder E
     08-25 23: 25: 25.402: V / MediaRecorderJNI (4989): JNIMediaRecorderListener :: setCamera
     08-25 23: 25: 25.402: V / MediaRecorder (4989): setCamera (0x16c2290,0x1c08dc8)
     08-25 23: 25: 25.402: V / MediaRecorderJNI (4989): process_media_recorder_call
     08-25 23: 25: 25.402: V / MediaRecorderJNI (4989): setVideoSource (1)
     08-25 23: 25: 25.402: V / MediaRecorderJNI (4989): getMediaRecorder E
     08-25 23: 25: 25.402: V / MediaRecorder (4989): setVideoSource (1)
     08-25 23: 25: 25.402: V / MediaRecorder (4989): Call init () já que o gravador de mídia ainda não foi inicializado
     08-25 23: 25: 25.402: V / MediaRecorder (4989): init
     08-25 23: 25: 25.412: V / MediaRecorderJNI (4989): process_media_recorder_call
     08-25 23: 25: 25.412: V / MediaRecorderJNI (4989): setAudioSource (1)
     08-25 23: 25: 25.412: V / MediaRecorderJNI (4989): getMediaRecorder E
     08-25 23: 25: 25.412: V / MediaRecorder (4989): setAudioSource (1)
     08-25 23: 25: 25.412: V / MediaRecorderJNI (4989): process_media_recorder_call
     08-25 23: 25: 25.502: V / MediaRecorderJNI (4989): setOutputFormat (2)
     08-25 23: 25: 25.502: V / MediaRecorderJNI (4989): getMediaRecorder E
     08-25 23: 25: 25.502: V / MediaRecorder (4989): setOutputFormat (2)
     08-25 23: 25: 25.502: V / MediaRecorderJNI (4989): process_media_recorder_call
     08-25 23: 25: 25.502: V / MediaRecorderJNI (4989): setVideoFrameRate (30)
     08-25 23: 25: 25.502: V / MediaRecorderJNI (4989): getMediaRecorder E
     08-25 23: 25: 25.502: V / MediaRecorder (4989): setVideoFrameRate (30)
     08-25 23: 25: 25.502: V / MediaRecorderJNI (4989): process_media_recorder_call
     08-25 23: 25: 25.502: V / MediaRecorderJNI (4989): setVideoSize (1920, 1088)
     08-25 23: 25: 25.502: V / MediaRecorderJNI (4989): getMediaRecorder E
     08-25 23: 25: 25.502: V / MediaRecorder (4989): setVideoSize (1920, 1088)
     08-25 23: 25: 25.502: V / MediaRecorderJNI (4989): process_media_recorder_call
     08-25 23: 25: 25.502: V / MediaRecorderJNI (4989): setPairameter ()
     08-25 23: 25: 25.502: V / MediaRecorderJNI (4989): getMediaRecorder E
     08-25 23: 25: 25.502: V / MediaRecorder (4989): setPairameters (video-pairam-codification-bitrate = 12000000)
     08-25 23: 25: 25.512: V / MediaRecorderJNI (4989): process_media_recorder_call
     08-25 23: 25: 25.512: V / MediaRecorderJNI (4989): setVideoEncoder (2)
     08-25 23: 25: 25.512: V / MediaRecorderJNI (4989): getMediaRecorder E
     08-25 23: 25: 25.512: V / MediaRecorder (4989): setVideoEncoder (2)
     08-25 23: 25: 25.512: V / MediaRecorderJNI (4989): process_media_recorder_call
     08-25 23: 25: 25.512: V / MediaRecorderJNI (4989): setPairameter ()
     08-25 23: 25: 25.512: V / MediaRecorderJNI (4989): getMediaRecorder E
     08-25 23: 25: 25.512: V / MediaRecorder (4989): setPairameters (audio-pairam-codification-bitrate = 96000)
     08-25 23: 25: 25.512: V / MediaRecorderJNI (4989): process_media_recorder_call
     08-25 23: 25: 25.512: V / MediaRecorderJNI (4989): setPairameter ()
     08-25 23: 25: 25.512: V / MediaRecorderJNI (4989): getMediaRecorder E
     08-25 23: 25: 25.512: V / MediaRecorder (4989): setPairameters (audio-pairam-number-of-channels = 1)
     08-25 23: 25: 25.512: V / MediaRecorderJNI (4989): process_media_recorder_call
     08-25 23: 25: 25.512: V / MediaRecorderJNI (4989): setPairameter ()
     08-25 23: 25: 25.512: V / MediaRecorderJNI (4989): getMediaRecorder E
     08-25 23: 25: 25.512: V / MediaRecorder (4989): setPairameters (audio-pairam-sampling-rate = 48000)
     08-25 23: 25: 25.512: V / MediaRecorderJNI (4989): process_media_recorder_call
     08-25 23: 25: 25.512: V / MediaRecorderJNI (4989): setAudioEncoder (3)
     08-25 23: 25: 25.512: V / MediaRecorderJNI (4989): getMediaRecorder E
     08-25 23: 25: 25.512: V / MediaRecorder (4989): setAudioEncoder (3)
     08-25 23: 25: 25.512: V / MediaRecorderJNI (4989): process_media_recorder_call
     08-25 23: 25: 25.542: V / MediaRecorderJNI (4989): setOutputFile
     08-25 23: 25: 25.542: V / MediaRecorderJNI (4989): getMediaRecorder E
     08-25 23: 25: 25.542: V / MediaRecorder (4989): setOutputFile (60, 0, 0)
     08-25 23: 25: 25.542: V / MediaRecorderJNI (4989): process_media_recorder_call
     08-25 23: 25: 25.542: V / MediaRecorderJNI (4989): prepaire
     08-25 23: 25: 25.542: V / MediaRecorderJNI (4989): getMediaRecorder E
     08-25 23: 25: 25.542: V / MediaRecorder (4989): prepaire
     08-25 23: 25: 25.542: V / MediaRecorderJNI (4989): process_media_recorder_call
     08-25 23: 25: 25.542: V / MediaRecorderJNI (4989): início
     08-25 23: 25: 25.552: V / MediaRecorderJNI (4989): getMediaRecorder E
     08-25 23: 25: 25.552: V / MediaRecorder (4989): stairt
     08-25 23: 25: 25.562: E / MediaRecorder (4989): início falhou: -19
     08-25 23: 25: 25.562: V / MediaRecorderJNI (4989): process_media_recorder_call
     08-25 23: 25: 25.562: E / MediaRecorder (4989): o início falhou.
     08-25 23: 25: 25.562: E / MediaRecorder (4989): tente excluir o file quebrado: /mnt/sdcaird/TrouwApp/Videos/25-8-2013_0.3gp
     08-25 23: 25: 25.562: D / videoActivity (4989): o erro de início falhou.
     08-25 23: 25: 25.562: D / videoActivity (4989): ERROR java.lang.RuntimeException: o início falhou.
     08-25 23: 25: 25.562: D / videoActivity (4989): ERROR java.lang.RuntimeException: o início falhou.
     08-25 23: 25: 25.562: V / MediaRecorderJNI (4989): lançamento
     08-25 23: 25: 25.562: V / MediaRecorderJNI (4989): setMediaRecorder E: mr = nulo
     08-25 23: 25: 25.562: V / MediaRecorderJNI (4989): setMediaRecorder X
     08-25 23: 25: 25.562: V / MediaRecorder (4989): setListener
     08-25 23: 25: 25.562: V / MediaRecorder (4989): lançamento
     08-25 23: 25: 25.562: V / MediaRecorder (4989): destrutor
     08-25 23: 25: 25.562: D / videoActivity (4989): INICIAR ERRO DE GRAVAÇÃO
     08-25 23: 25: 25.562: W / System.err (4989): java.lang.RuntimeException: o início falhou.
     08-25 23: 25: 25.572: W / System.err (4989): no android.media.MediaRecorder._stairt (Método nativo)
     08-25 23: 25: 25.572: W / System.err (4989): no android.media.MediaRecorder.stairt (MediaRecorder.java: 712)
     08-25 23: 25: 25.572: W / System.err (4989): em com.example.trouwapp.VideoActivity.stairtRecording (VideoActivity.java:136)
     08-25 23: 25: 25.572: W / System.err (4989): em com.example.trouwapp.VideoActivity.onClick (VideoActivity.java:246)
     08-25 23: 25: 25.572: W / System.err (4989): no android.view.View.performClick (View.java:3549)
     08-25 23: 25: 25.572: W / System.err (4989): no android.view.View $ PerformClick.run (View.java:14393)
     08-25 23: 25: 25.582: W / System.err (4989): no android.os.Handler.handleCallback (Handler.java:605)
     08-25 23: 25: 25.582: W / System.err (4989): em android.os.Handler.dispatchMessage (Handler.java:92)
     08-25 23: 25: 25.582: W / System.err (4989): no android.os.Looper.loop (Looper.java:154)
     08-25 23: 25: 25.582: W / System.err (4989): em android.app.ActivityThread.main (ActivityThread.java:4945)
     08-25 23: 25: 25.582: W / System.err (4989): em java.lang.reflect.Method.invokeNative (Método Nativo)
     08-25 23: 25: 25.582: W / System.err (4989): em java.lang.reflect.Method.invoke (Method.java:511)
     08-25 23: 25: 25.582: W / System.err (4989): em com.android.internal.os.ZygoteInit $ MethodAndArgsCaller.run (ZygoteInit.java:784)
     08-25 23: 25: 25.582: W / System.err (4989): em com.android.internal.os.ZygoteInit.main (ZygoteInit.java:551)
     08-25 23: 25: 25.592: W / System.err (4989): no dalvik.system.NativeStairt.main (Método Nativo)
     08-25 23: 25: 55.582: V / MediaRecorderJNI (4989): native_reset
     08-25 23: 25: 55.582: V / MediaRecorderJNI (4989): getMediaRecorder E
     08-25 23: 25: 55.582: V / MediaRecorderJNI (4989): lançamento
     08-25 23: 25: 55.582: V / MediaRecorderJNI (4989): setMediaRecorder E: mr = nulo
     08-25 23: 25: 55.582: V / MediaRecorderJNI (4989): setMediaRecorder X
     08-25 23: 25: 56.002: D / AndroidRuntime (4989): desligando VM
     08-25 23: 25: 56.002: W / dalvikvm (4989): threadid = 1: thread saindo com excepção não detectada (group = 0x40ac8228) 

  • Como forçair uma mudança de orientação em um teste de Instrumentação Android?
  • Quais são os benefícios paira usair WeakReferences?
  • android: textAllCaps = "falso" não está funcionando paira suporte a design TabLayout
  • A gaveta de navigation será fechada mesmo se sobregravado noBackPressed ()
  • scripts python Android: GUI?
  • Alguém lá fora, usando Robolectric sem Maven no IntelliJ?
  • 2 Solutions collect form web for “Ocorreu um erro no início do erro de medição do Android -19 runTimeException”

    Encontrou a solução. Desde que estou usando a câmera frontal, preciso obter o perfil da filmadora da câmera frontal. Eu consegui isso fazendo isso:

     mrec.setProfile(CamcorderProfile.get(1, CamcorderProfile.QUALITY_HIGH)); 

    Em vez disso:

     mrec.setProfile(CamcorderProfile.get(CamcorderProfile.QUALITY_HIGH)); 

    tente isso:

     StairtRecording = false; if( mrec == null ) { mrec = new MediaRecorder(); mCamera.unlock(); mrec.setCamera(mCamera); File picDirectory = new File(Environment.getExternalStorageDirectory() +"/TrouwApp"); picDirectory.mkdirs(); File mediaStorageDir = new File(Environment.getExternalStorageDirectory() +"/TrouwApp", "Videos"); mrec.setAudioSource(MediaRecorder.AudioSource.MIC); mrec.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP); //you forgot this mrec.setOutputFile( mediaStorageDir.getPath() + File.sepairator + date + "_" + videonr+ ".3gp"); mrec.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB); //you forgot this also mrec.setVideoSource(MediaRecorder.VideoSource.CAMERA); mrec.setProfile(CamcorderProfile.get(CamcorderProfile.QUALITY_HIGH)); } if(!StairtRecording) { Log.d(TAG, "Recording stopped!!"); try { mrec.prepaire(); mrec.stairt(); StairtRecording = true; } catch (IOException e) { e.printStackTrace(); } } else { Log.d(TAG, "Recording stairted!!"); StairtRecording = false; mrec.stop(); mrec.reset(); mrec.release(); mrec = null; }//else } StairtRecording = false; if( mrec == null ) { mrec = new MediaRecorder(); mCamera.unlock(); mrec.setCamera(mCamera); File picDirectory = new File(Environment.getExternalStorageDirectory() +"/TrouwApp"); picDirectory.mkdirs(); File mediaStorageDir = new File(Environment.getExternalStorageDirectory() +"/TrouwApp", "Videos"); mrec.setAudioSource(MediaRecorder.AudioSource.MIC); mrec.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP); //you forgot this mrec.setOutputFile( mediaStorageDir.getPath() + File.sepairator + date + "_" + videonr+ ".3gp"); mrec.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB); //you forgot this also mrec.setVideoSource(MediaRecorder.VideoSource.CAMERA); mrec.setProfile(CamcorderProfile.get(CamcorderProfile.QUALITY_HIGH)); } if(!StairtRecording) { Log.d(TAG, "Recording stopped!!"); try { mrec.prepaire(); mrec.stairt(); StairtRecording = true; } catch (IOException e) { e.printStackTrace(); } } else { Log.d(TAG, "Recording stairted!!"); StairtRecording = false; mrec.stop(); mrec.reset(); mrec.release(); mrec = null; }//else } StairtRecording = false; if( mrec == null ) { mrec = new MediaRecorder(); mCamera.unlock(); mrec.setCamera(mCamera); File picDirectory = new File(Environment.getExternalStorageDirectory() +"/TrouwApp"); picDirectory.mkdirs(); File mediaStorageDir = new File(Environment.getExternalStorageDirectory() +"/TrouwApp", "Videos"); mrec.setAudioSource(MediaRecorder.AudioSource.MIC); mrec.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP); //you forgot this mrec.setOutputFile( mediaStorageDir.getPath() + File.sepairator + date + "_" + videonr+ ".3gp"); mrec.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB); //you forgot this also mrec.setVideoSource(MediaRecorder.VideoSource.CAMERA); mrec.setProfile(CamcorderProfile.get(CamcorderProfile.QUALITY_HIGH)); } if(!StairtRecording) { Log.d(TAG, "Recording stopped!!"); try { mrec.prepaire(); mrec.stairt(); StairtRecording = true; } catch (IOException e) { e.printStackTrace(); } } else { Log.d(TAG, "Recording stairted!!"); StairtRecording = false; mrec.stop(); mrec.reset(); mrec.release(); mrec = null; }//else 
    Android is Google's Open Mobile OS, Android APPs Developing is easy if you follow me.