Called: java.lang.IllegalStateException: startRecording () caused by an uninitialized audio record

I get an error like start recording (), called uninitialized audio recording in Android version 2.3.4 (LG), its performance in Android 2.2, but an error in android 2.3.

+6
source share
2 answers

Also, make sure this permission is set in your AndroidManifest.xml:

<uses-permission android:name="android.permission.RECORD_AUDIO" />

+16
source

I answer this question too late. Maybe my answer will help other developers in the future. Starting with Android 6.0 Marshmallow, the application will not receive permission during installation. The application must ask the user for permission at runtime. The permission request dialog does not start automatically. The developer must manually call it after checking for permissions or not. In the above case, the developer must request permission android.permission.RECORD_AUDIO at runtime. And also for android.permission.WRITE_EXTERNAL_STORAGE , if you save the record to external storage. Also add as

 <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /> <!--Audio Record Permission--> <uses-permission android:name="android.permission.RECORD_AUDIO" /> 

Hope this helps some developers.

0
source

Source: https://habr.com/ru/post/923014/


All Articles