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

StackOverflow https://stackoverflow.com/questions/22403922

質問

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?

役に立ちましたか?

解決

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" />

他のヒント

Of course you cannot write to a file called

 /app.properties

as that would be located in the top-level or root directory of the device, to which application code will never have write access.

See the Saving Files section of the developer docs to learn about valid places to store a file, and which do and do not require additional attainable permissions.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top