Not able to save file in Sdcard when using 'uses-sdk' in manifest
<p>I am creating an app to record voice, when I try to store file in sdcard with </p>

<pre><code>&lt;uses-sdk android:minSdkVersion="8"
</code></pre>

<p>it gives me error "No such file or directory", but when I comment out the "uses-sdk" part from manifest, it is working fine. I am not sure what is the actual problem, but it seems like it is due to setting sdk-version in manifest.
I also tried increasing/decreasing minSdkVersion, but still same error.</p>

<p>Below is the error log.</p>

<pre><code> 11-28 15:53:54.887: W/System.err(5935): java.io.FileNotFoundException: /mnt/sdcard/Recorder/voicemail.3gp (No such file or directory)
11-28 15:53:54.897: W/System.err(5935):     at org.apache.harmony.luni.platform.OSFileSystem.open(Native Method)
11-28 15:53:54.897: W/System.err(5935):     at dalvik.system.BlockGuard$WrappedFileSystem.open(BlockGuard.java:232)
11-28 15:53:54.897: W/System.err(5935):     at java.io.FileOutputStream.&lt;init&gt;(FileOutputStream.java:94)
11-28 15:53:54.897: W/System.err(5935):     at java.io.FileOutputStream.&lt;init&gt;(FileOutputStream.java:165)
11-28 15:53:54.897: W/System.err(5935):     at java.io.FileOutputStream.&lt;init&gt;(FileOutputStream.java:144)
11-28 15:53:54.897: W/System.err(5935):     at android.media.MediaRecorder.prepare(MediaRecorder.java:540)
11-28 15:53:54.897: W/System.err(5935):     at com.abc.SendVoiceMailFragment.startRecording(SendVoiceMailFragment.java:96)
11-28 15:53:54.897: W/System.err(5935):     at com.abc.SendVoiceMailFragment.access$0(SendVoiceMailFragment.java:84)
11-28 15:53:54.897: W/System.err(5935):     at com.abc.SendVoiceMailFragment$3.onClick(SendVoiceMailFragment.java:59)
11-28 15:53:54.897: W/System.err(5935):     at android.view.View.performClick(View.java:2532)
11-28 15:53:54.897: W/System.err(5935):     at android.view.View$PerformClick.run(View.java:9293)
11-28 15:53:54.897: W/System.err(5935):     at android.os.Handler.handleCallback(Handler.java:587)
11-28 15:53:54.897: W/System.err(5935):     at android.os.Handler.dispatchMessage(Handler.java:92)
11-28 15:53:54.897: W/System.err(5935):     at android.os.Looper.loop(Looper.java:150)
11-28 15:53:54.897: W/System.err(5935):     at android.app.ActivityThread.main(ActivityThread.java:4277)
11-28 15:53:54.897: W/System.err(5935):     at java.lang.reflect.Method.invokeNative(Native Method)
11-28 15:53:54.897: W/System.err(5935):     at java.lang.reflect.Method.invoke(Method.java:507)
11-28 15:53:54.897: W/System.err(5935):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
11-28 15:53:54.897: W/System.err(5935):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
11-28 15:53:54.897: W/System.err(5935):     at dalvik.system.NativeStart.main(Native Method)
</code></pre>

<p><strong>EDIT</strong>
Here is my manifest file</p>

<pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    package="com.abc"
    android:versionCode="1"
    android:versionName="1.0" &gt;

    &lt;uses-sdk android:minSdkVersion="8" /&gt; 

    &lt;uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" &gt;
    &lt;/uses-permission&gt;
    &lt;uses-permission
        android:name="android.permission.INTERNET"
        android:protectionLevel="normal" &gt;
    &lt;/uses-permission&gt;
    &lt;uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" &gt;
    &lt;/uses-permission&gt;
    &lt;uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" &gt;
    &lt;/uses-permission&gt;
    &lt;uses-permission android:name="android.permission.ACCESS_WIFI_STATE" &gt;
    &lt;/uses-permission&gt;
    &lt;uses-permission android:name="android.permission.GET_ACCOUNTS" &gt;
    &lt;/uses-permission&gt;
    &lt;uses-permission android:name="android.permission.USE_CREDENTIALS" &gt;
    &lt;/uses-permission&gt;
    &lt;uses-permission android:name="android.permission.MANAGE_ACCOUNTS" &gt;
    &lt;/uses-permission&gt;
    &lt;uses-permission android:name="android.permission.AUTHENTICATE_ACCOUNTS" &gt;
    &lt;/uses-permission&gt;
    &lt;uses-permission android:name="android.permission.CAMERA" &gt;
    &lt;/uses-permission&gt;
    &lt;uses-permission android:name="android.permission.SEND_SMS" &gt;
    &lt;/uses-permission&gt;
    &lt;uses-permission android:name="android.permission.RECORD_AUDIO" &gt;
    &lt;/uses-permission&gt;
    &lt;uses-permission android:name="androd.permission.WRITE_EXTERNAL_STORAGE" /&gt;

    &lt;supports-screens
        android:anyDensity="true"
        android:largeScreens="false"
        android:normalScreens="true"
        android:smallScreens="true" /&gt;

    &lt;application
        android:debuggable="true"
        android:icon="@drawable/icon"
        android:label="@string/app_name"
        android:theme="@style/tab_name" &gt;
        &lt;activity
            android:name=".SplashScreen"
            android:icon="@drawable/icon"
            android:label="@string/app_name"
            android:screenOrientation="portrait"
            android:theme="@android:style/Theme.NoTitleBar" &gt;
            &lt;intent-filter&gt;
                &lt;action android:name="android.intent.action.MAIN" /&gt;

                &lt;category android:name="android.intent.category.LAUNCHER" /&gt;
            &lt;/intent-filter&gt;
        &lt;/activity&gt;
    &lt;/application&gt;    
&lt;/manifest&gt;
</code></pre>

<p><strong>My code to create file</strong></p>

<pre><code>private String getFilename(){
        String filepath = Environment.getExternalStorageDirectory().getPath();
        File file = new File(filepath,AUDIO_RECORDER_FOLDER);

        if(!file.exists()){
            file.mkdirs();
        }

        return (file.getAbsolutePath() + "/" + AUDIO_FILE_NAME + ".3gp");
    }
</code></pre>
