Cosmic-Ide / Cosmic-IDE

A next-gen Ide for JVM development on Android
GNU General Public License v3.0
502 stars 58 forks source link

[Bug]: Add External read and write permission #418

Closed Tanzin01 closed 1 year ago

Tanzin01 commented 1 year ago

What happened?

A bug happened!

Cant use java i/o

Version

SNAPSHOT

What android version are you using?

None

Relevant log output

FATAL EXCEPTION: DefaultDispatcher-worker-3
Process: org.cosmicide.rewrite, PID: 11638
java.lang.reflect.InvocationTargetException
    at java.lang.reflect.Method.invoke(Native Method)
    at org.cosmicide.rewrite.fragment.ProjectOutputFragment$runClass$1.invokeSuspend(ProjectOutputFragment.kt:180)
    at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
    at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
    at kotlinx.coroutines.internal.LimitedDispatcher$Worker.run(LimitedDispatcher.kt:115)
    at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:100)
    at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:584)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:793)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:697)
    at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:684)
    Suppressed: kotlinx.coroutines.internal.DiagnosticCoroutineContextException: [StandaloneCoroutine{Cancelling}@c9859af, Dispatchers.IO]
Caused by: java.io.FileNotFoundException: /storage/emulated/0/telegram.xml: open failed: EACCES (Permission denied)
    at libcore.io.IoBridge.open(IoBridge.java:574)
    at java.io.FileInputStream.<init>(FileInputStream.java:160)
    at my.mk.Main.main(Main.kt:10)
    ... 10 more
Caused by: android.system.ErrnoException: open failed: EACCES (Permission denied)
    at libcore.io.Linux.open(Native Method)
    at libcore.io.ForwardingOs.open(ForwardingOs.java:563)
    at libcore.io.BlockGuardOs.open(BlockGuardOs.java:274)
    at libcore.io.ForwardingOs.open(ForwardingOs.java:563)
    at android.app.ActivityThread$AndroidOs.open(ActivityThread.java:8619)
    at libcore.io.IoBridge.open(IoBridge.java:560)
    ... 12 more

Code of Conduct

PranavPurwar commented 1 year ago

Hey, if you use Java I/O operations outside the IDE accessible folders, you can provide the permission to manager storage like this

https://github.com/Cosmic-Ide/Cosmic-Ide/assets/75154889/8962a212-b97d-412c-844c-3c670ca8a2f5

Then restarting the IDE should do the trick!

PranavPurwar commented 1 year ago

@SoulForeverInPeace Which app version are you using? And what is your android version?

PranavPurwar commented 1 year ago

@SoulForeverInPeace An in-app setting to configure it has been added