인프런 커뮤니티 질문&답변

문태부님의 프로필 이미지
문태부

작성한 질문수

윤재성의 Java 기반 Android 9.0(pie) App 개발 심화 2단계

파일 입출력

외부 저장소 쓰기 할때 안됩니다.

작성

·

176

0

2019-09-04 17:58:48.616 767-767/kr.co.cashq.fileinputoutput W/System.err: java.io.FileNotFoundException: /storage/emulated/0/Android/data/kr.co.cashq.fileinputoutput/sd_file.dat: open failed: ENOENT (No such file or directory)

2019-09-04 17:58:48.616 767-767/kr.co.cashq.fileinputoutput W/System.err:     at libcore.io.IoBridge.open(IoBridge.java:496)

2019-09-04 17:58:48.616 767-767/kr.co.cashq.fileinputoutput W/System.err:     at java.io.FileOutputStream.<init>(FileOutputStream.java:235)

2019-09-04 17:58:48.616 767-767/kr.co.cashq.fileinputoutput W/System.err:     at java.io.FileOutputStream.<init>(FileOutputStream.java:125)

2019-09-04 17:58:48.616 767-767/kr.co.cashq.fileinputoutput W/System.err:     at kr.co.cashq.fileinputoutput.MainActivity.btn3Method(MainActivity.java:124)

2019-09-04 17:58:48.616 767-767/kr.co.cashq.fileinputoutput W/System.err:     at java.lang.reflect.Method.invoke(Native Method)

2019-09-04 17:58:48.616 767-767/kr.co.cashq.fileinputoutput W/System.err:     at androidx.appcompat.app.AppCompatViewInflater$DeclaredOnClickListener.onClick(AppCompatViewInflater.java:385)

2019-09-04 17:58:48.616 767-767/kr.co.cashq.fileinputoutput W/System.err:     at android.view.View.performClick(View.java:7140)

2019-09-04 17:58:48.617 767-767/kr.co.cashq.fileinputoutput W/System.err:     at android.view.View.performClickInternal(View.java:7117)

2019-09-04 17:58:48.617 767-767/kr.co.cashq.fileinputoutput W/System.err:     at android.view.View.access$3500(View.java:801)

2019-09-04 17:58:48.617 767-767/kr.co.cashq.fileinputoutput W/System.err:     at android.view.View$PerformClick.run(View.java:27351)

2019-09-04 17:58:48.617 767-767/kr.co.cashq.fileinputoutput W/System.err:     at android.os.Handler.handleCallback(Handler.java:883)

2019-09-04 17:58:48.617 767-767/kr.co.cashq.fileinputoutput W/System.err:     at android.os.Handler.dispatchMessage(Handler.java:100)

2019-09-04 17:58:48.617 767-767/kr.co.cashq.fileinputoutput W/System.err:     at android.os.Looper.loop(Looper.java:214)

2019-09-04 17:58:48.617 767-767/kr.co.cashq.fileinputoutput W/System.err:     at android.app.ActivityThread.main(ActivityThread.java:7356)

2019-09-04 17:58:48.617 767-767/kr.co.cashq.fileinputoutput W/System.err:     at java.lang.reflect.Method.invoke(Native Method)

2019-09-04 17:58:48.617 767-767/kr.co.cashq.fileinputoutput W/System.err:     at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)

2019-09-04 17:58:48.617 767-767/kr.co.cashq.fileinputoutput W/System.err:     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)

2019-09-04 17:58:48.617 767-767/kr.co.cashq.fileinputoutput W/System.err: Caused by: android.system.ErrnoException: open failed: ENOENT (No such file or directory)

2019-09-04 17:58:48.617 767-767/kr.co.cashq.fileinputoutput W/System.err:     at libcore.io.Linux.open(Native Method)

2019-09-04 17:58:48.618 767-767/kr.co.cashq.fileinputoutput W/System.err:     at libcore.io.ForwardingOs.open(ForwardingOs.java:167)

2019-09-04 17:58:48.618 767-767/kr.co.cashq.fileinputoutput W/System.err:     at libcore.io.BlockGuardOs.open(BlockGuardOs.java:252)

2019-09-04 17:58:48.618 767-767/kr.co.cashq.fileinputoutput W/System.err:     at libcore.io.ForwardingOs.open(ForwardingOs.java:167)

2019-09-04 17:58:48.618 767-767/kr.co.cashq.fileinputoutput W/System.err:     at android.app.ActivityThread$AndroidOs.open(ActivityThread.java:7255)

2019-09-04 17:58:48.618 767-767/kr.co.cashq.fileinputoutput W/System.err:     at libcore.io.IoBridge.open(IoBridge.java:482)

2019-09-04 17:58:48.618 767-767/kr.co.cashq.fileinputoutput W/System.err: ... 16 more

 

위와 같이 파일을 쓸 수 없다고 하네요. 뭘 잘못 한거죠?

답변 1

문태부님의 프로필 이미지
문태부

작성한 질문수

질문하기