-
Notifications
You must be signed in to change notification settings - Fork 6.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ParcelFileDescriptor image loading is broken pre 4.1.1_r1 #157
Comments
It's worth testing this, the framework claims that #close() was added in API level 1. I wonder if there is a weird device specific bug? It's possible something about not having the interface but having the method is messing with things? I should add a Gallery sample app, I've written parts of it before but never committed. |
Java doesn't support duck-typing. Having the method is not enough to call it through the interface. It should jave failed much earlier with a |
Right it doesn't support duck typing, what I meant was it seems conceptually like nothing should be broken, the method in question has existed forever. If adding a new interface that covered an existing method broke code on old platforms that would be a problem? I have both real devices and emulators. I've tested on a couple versions of Android using emulators and so far I can't reproduce, I'll keep trying and try real devices tomorrow. |
It's not trivial to get the exception stack trace. The only visible repro I could do is not showing an image. Here's an app which displays the stack trace for me, even on 2.3.7:
Also this would fail compiling with target < 4.1.1:
|
Argh I'm sorry I should have looked at the code before responding. I was assuming it was calling |
My friend complained that image chosen from Gallery didn't show up in my app on GT-I9000 (2.3.6):
I debugged on emulator API 10 / 2.3.7.
There's nothing in the logs, it just keeps skipping a line when I'm stepping and it's like I pressed Resume on debugger. It luckily breaks consistently and when I did "Run > Force Step into" I got into the
IncompatibleClassChangeError
constructor. Thennew Exception().printStackTrace()
in Evaluate helped (added corresponding lines for top 3):At
data.close()
data
is declared asT data
(<T extends Closeable>
) and in memory we have:So it's trying to make a virtual call to
close()
through theCloseable
interface:The
Closeable
interface toParcelFileDescriptor
was added in this commit and it has the tag4.1.1_r1
.So I suspect the following versions are broken (not tested):
The text was updated successfully, but these errors were encountered: