android - App works in debug mode but not when installed from apk. Something to do with storage -


when run app on emulator or regular android phone through debug mode works. installing via signed app causes crash when (i believe) accessing or rather trying access non saved files in internal private storage.

i have

<uses-permission android:name="android.permission.write_internal_storage" /> <uses-permission android:name="android.permission.read_internal_storage" /> 

in manifest file in case.

my app has raw test data in res folder copied internal storage created user through regular use. works in debug mode not normally. (saving through usage of app works guess problem either accessing raw resources or copying them internal storage)

what cause?

here code raw -> internal transfer

file file = getapplicationcontext ().getfilestreampath(usertemp);         try {             inputstream inputstream = getresources().openrawresource(                     getresources().getidentifier(user, "raw", getpackagename())             );              fileoutputstream fileoutputstream = new fileoutputstream (file);              byte buf[]=new byte[1024];             int len;             while((len=inputstream.read(buf))>0) {                 fileoutputstream.write(buf,0,len);             }              fileoutputstream.close();             inputstream.close();         } catch (ioexception e1) {} 

user , usertemp simple string file names

edit: confirm, res files exists in apk file

edit2: files copied raw resources internal app storage reason can't read, said before, debug runs great


Comments