Search code examples
androidfile-ioproperties-file

java.io.FileNotFoundException: /app.properties: open failed: EROFS (Read-only file system)


I would like to create file of format .properties in android app. Unfortunately, I am getting error java.io.FileNotFoundException: /app.properties: open failed: EROFS (Read-only file system) Any idea why?


Solution

  • try to use "android.permission.WRITE_INTERNAL_STORAGE" insert it to AndroidManifest.xml example's below:

    <?xml version="1.0" encoding="utf-8"?>
    <manifest xmlns:android="http://schemas.android.com/apk/res/android"
        package="com.megazy.android"
        android:versionCode="1"
        android:versionName="1.0" >
    
        <uses-sdk
            android:minSdkVersion="15"
            android:targetSdkVersion="17" />
    
        <uses-permission android:name="android.permission.INTERNET" />
        <uses-permission android:name="android.permission.WRITE_INTERNAL_STORAGE" />