Status Update
Comments
jb...@google.com <jb...@google.com> #2
// Write the file
OutputStream outputStream = getContentResolver().openOutputStream(currentUri);
OutputStreamWriter outputStreamWriter = new OutputStreamWriter(outputStream );
Actually the problem seems to be with ParcelFileDescriptor.AutoCloseOutputStream . I can get the code above to work fine if I don't use getContentResolver().openOutputStream(currentUri) , which returns a ParcelFileDescriptor.AutoCloseOutputStream .
If I use:
// Write the file
FileOutputStream fos = new FileOutputStream(new File(getFilesDir(), "out.txt"));
OutputStreamWriter outputStreamWriter = new OutputStreamWriter(fos);
it WORKS correctly on any API level.
But as I am using external storage and have to use the ContentProvider given when I get access to the storage via a chooser, all I have to deal with is a content Uri and not a file name nor file handle. I have to go through the getContentResolver methods.
Note that:
// Write the file
ParcelFileDescriptor pfd = getContentResolver().openFileDescriptor(currentUri, "w");
FileDescriptor fd = pfd.getFileDescriptor();
FileOutputStream fos = new FileOutputStream(fd);
OutputStreamWriter outputStreamWriter = new OutputStreamWriter(fos);
Does not work either. Somewhere in the ParcelFile system things are going wrong.
zi...@gmail.com <zi...@gmail.com> #3
Thank you for reporting this issue. We just need a few things for us to further investigate this issue:
Please fill out each question and comment, thank you.
-
Have you observed this bug on Pixel devices as well?
-
Android Build Version (go to Settings > About Device > Build Number (hold down to copy))
-
Android Device Model:
-
If possible, capture the issue in a screen recording (desktop and/or phone capture).
-
Upload the full bug report file after the issue has occurred. Steps followed here:
https://developer.android.com/studio/debug/bug-report -
Please provide a simple sample project (exported zip Android Studio file) that reproduces the issue. This gives us the closest test environment to yours and allows us to inspect the code/structure used which will help analyze your issue.
-
Steps to reproduce issue specific to the provided sample project: [Be as specific as possible]
- 1
- 2
- 3
-
Expected Results:
-
Observed Results:
Note: Please upload to google drive and share the folder to
The more information we have, the more accurately our product and engineering team can solve the issue. Thank you so much for your time and for your cooperation.
jb...@google.com <jb...@google.com>
ap...@google.com <ap...@google.com> #4
<Android Build Version ?> My friend's phone is on Android 10. Emulators with API 29 and API 30 had the problem. My own phone and API 26 and API 28 emulators did not. Project compile SDK is API 30, tools version is 29.0.3.
<Android Device Model ?> My friend's device is a Samsung Galaxy S-10, model SM-G973U.
<If possible, capture the issue in a screen recording (desktop and/or phone capture).> Irrelevant.
<Upload the full bug report file after the issue has occurred> Irrelevant since this was run via emulator.
<Steps to reproduce issue specific to the provided sample project>
1. Copy testCopy.csv from the assets directory onto the phone somewhere or into an API 29 or greater emulator.
2. Start the app , click and choose menu "Open Table..."
3. Choose file "testCopy.csv" with the file chooser.
4. Check the current contents of testCopy.csv now. It is corrupted.
<Expected Results>
delimiter ,
debug true
Name,Pet,Email,Phone,Audio,Notes,Web
125,100,160,100,100,100,150
12
40
fullname,image,email,phone,audio,note,url
arreter[1],Clipboard01.jpg,lriehl@comcast.net,360-742-3631,sound1407360340825148972.aac,note1.txt,<Name>#
Audrey Oakes,Clipboard04.jpg,oakesa@comcast.net,253-639-3558,sound421577012195097098.aac,note3.html#58,Amazon#
Norm Oakes,Clipboard04.jpg,oakesn@comcast.net,253-639-3558,sound421577012195097098.aac,note2.html#3,
<Observed Results>
delimiter ,
debug true
Name,Pet,Email,Phone,Audio,Notes,Web
125,100,160,100,100,100,150
12
40
fullname,image,email,phone,audio,note,url
arreter[1],Clipboard01.jpg,lriehl@comcast.net,360-742-3631,sound1407360340825148972.aac,note1.txt,<Name>#
Audrey Oakes,Clipboard04.jpg,oakesa@comcast.net,253-639-3558,sound421577012195097098.aac,note3.html#58,Amazon#
Norm Oakes,Clipboard04.jpg,oakesn@comcast.net,253-639-3558,sound421577012195097098.aac,note2.html#3,
The error is that "
Sample project is at
jb...@google.com <jb...@google.com> #5
Thank you for providing your update. We just need a few things for us to further investigate this issue:
-
When attempting to reproduce the issue following your provided steps, the view is empty after selecting "Open table..." and choosing the provided .csv - where exactly are you observing the output text from the csv file? Thanks for your clarity.
-
Pixel 4 Emulator API 30: debug build variant
zi...@gmail.com <zi...@gmail.com> #6
4. Check the current contents of testCopy.csv now. It is corrupted.
na...@google.com <na...@google.com> #7
na...@google.com <na...@google.com> #8
Thank you so much for the updates:
- Just to confirm, you are taking the csv file, that is now within the phone, and transferring it outside the phone to view it after having opened it within your sample app using "Open table..."
Description
Component used: Navigation
Version used: 2.7.5
Devices/Android versions reproduced on: Emulator Pixel 6a API 33 arm64
Hello! It seems that with the newest update (2.7.5)
setGraph
no longer works in our specific case. I’m wondering if it is related to theequals
change[1]. For our graphif (_graph != graph)
insidepublic open fun setGraph(graph: NavGraph, startDestinationArgs: Bundle?)
returns true on2.7.4
but false on2.7.5
. The line withnodes.valueIterator().asSequence().all { it == nodes.get(it.id) }
looks suspicious. Shouldn’t it check nodes from theother
graph?[1]https://android.googlesource.com/platform/frameworks/support/+/d22366d59a46aa16aa79d1d691cd5cb55f56c378%5E%21/#F1