Treessence
Treessence copied to clipboard
Crash
2022-03-15 13:50:28.187 20169-20169/com.vavaparty.app E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.vavaparty.app, PID: 20169
java.lang.RuntimeException: Unable to create application com.vavaparty.app.App: java.nio.file.FileSystemException: log.0.lck: Read-only file system
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6855)
at android.app.ActivityThread.access$1400(ActivityThread.java:246)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1955)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:236)
at android.app.ActivityThread.main(ActivityThread.java:7879)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:656)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:967)
Caused by: java.nio.file.FileSystemException: log.0.lck: Read-only file system
at sun.nio.fs.UnixFileSystemProvider.newFileChannel(UnixFileSystemProvider.java:177)
at java.nio.channels.FileChannel.open(FileChannel.java:287)
at java.nio.channels.FileChannel.open(FileChannel.java:335)
at java.util.logging.FileHandler.openFiles(FileHandler.java:460)
at java.util.logging.FileHandler.<init>(FileHandler.java:403)
at fr.bipi.tressence.file.FileLoggerTree$Builder.build(FileLoggerTree.kt:242)
at com.vavaparty.app.App.onCreate(App.kt:36)
at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1193)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6850)
at android.app.ActivityThread.access$1400(ActivityThread.java:246)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1955)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:236)
at android.app.ActivityThread.main(ActivityThread.java:7879)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:656)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:967)
@DanteAndroid No Storage permission issue I think, it could be an issue of API 29 or 30 https://developer.android.com/training/data-storage/manage-all-files#all-files-access
@luongvo Could you provide an api that can save file into app private directory (data/com.package/files)?
@luongvo have you fixed this?
@DanteAndroid @hmmmk what worked for me was adding the following line to the builder:
.withDir(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOCUMENTS))