android mediaRecorder.setAudioSource failed

Add this two permission on manifest  [java] <uses-permission android:name="android.permission.RECORD_AUDIO" /> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> [/java] And make sure that permissions are granted. For marshmallow and later…