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" /> <uses-permission android:name="android.permission.RECORD_AUDIO" />
Hope this helps some developers.
source share