Skip to content
This repository was archived by the owner on Nov 18, 2024. It is now read-only.

Conversation

@deakjahn
Copy link
Contributor

The two items we discussed in #68.

Thinking about it, even if using the key works as you suggested, I'd still modify that cache allocation. A simple check and avoids a strange error that's not obvious at first sight.

@espresso3389
Copy link
Owner

espresso3389 commented Jan 17, 2022

@deakjahn
Aside from the original issue, the PR upgrades targetSdkVersion to 31. I'm not sure whether it's OK for everyone or not; SDK 31 has many breaking changes and sometime it breaks things like BLE and splashscreen.

Do you think how important the SDK changes is?

Copy link
Owner

@espresso3389 espresso3389 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure whether example should have targetSdkVersion 31 or not but the changes are reasonable.

@espresso3389 espresso3389 merged commit f294763 into espresso3389:master Jan 17, 2022
@deakjahn
Copy link
Contributor Author

deakjahn commented Jan 17, 2022

Yep, I mentioned that in the review comment above. I don't think it's important to change the SDK but simply, it didn't compile here without the change. I don't know why (it complained about some incompatibilities that some dependent packages are already on a newer SDK) ... I should have left it out from the commit, actually. :-)

@espresso3389
Copy link
Owner

OK, anyway, I merged the PR. I'll release a new version soon.

@deakjahn
Copy link
Contributor Author

deakjahn commented Jan 17, 2022

Thanks. I started to create my own layouts and I can see some zooming issues now but I don't yet know if it's my error. Basically, when I change to a new PDF, I call controller.goToPage(pageNumber: 1) to make sure it doesn't get stuck on a non-existing page (if the first PDF had three pages, we were on the third, but the new one only has two). Jumping to the page changes the zoom, sometimes just like I wanted it, sometimes smaller.

@espresso3389
Copy link
Owner

1.0.20 is released!

@deakjahn
Copy link
Contributor Author

Yep, I got the Kotlin errors back. I'll copy some of them to see what might be different at your end:

e: Incompatible classes were found in dependencies. Remove them from the classpath or use '-Xskip-metadata-version-check' to suppress errors
e: .gradle/caches/transforms-3/0d64d5ad66f017e06ac265767a913ba4/transformed/jetified-kotlin-stdlib-jdk7-1.6.10.jar!/META-INF/kotlin-stdlib-jdk7.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.6.0, expected version is 1.4.0.
e: .gradle/caches/transforms-3/291849b43d73afe58bebff41f4579b4b/transformed/jetified-kotlin-stdlib-common-1.6.10.jar!/META-INF/kotlin-stdlib-common.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.6.0, expected version is 1.4.0.
e: .gradle/caches/transforms-3/812cefd60c93c07d26443ae2beafad7e/transformed/jetified-kotlin-stdlib-1.6.10.jar!/META-INF/kotlin-stdlib.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.6.0, expected version is 1.4.0.
e: E:\Android\flutter\.pub-cache\hosted\pub.dartlang.org\pdf_render-1.0.20\android\src\main\kotlin\jp\espresso3389\pdf_render\PdfRenderPlugin.kt: (38, 10): Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.6.0, expected version is 1.4.0.
The class is loaded from .gradle/caches/transforms-3/812cefd60c93c07d26443ae2beafad7e/transformed/jetified-kotlin-stdlib-1.6.10.jar!/kotlin/Unit.class

This is why I needed to change Kotlin version. Maybe because my own app is in a different one?

@deakjahn
Copy link
Contributor Author

Forget it. My bad, my Kotlin version in my own app was old. Sorry.

@deakjahn
Copy link
Contributor Author

Two page spreads. No gaps horizontally, gap vertically. Beautiful :-)

Screenshot_20220117_133620

@deakjahn
Copy link
Contributor Author

deakjahn commented Jan 17, 2022

@espresso3389

Yes, it is. On Android. I can't get any display on iOS (Simulator). I've just updated to Monterey and Xcode 13 because of another package and compilation problems. Do you happen to have any feedback if this causes issues?

I get completely blank pages but correct layout and page decoration shadow boxes, so the PDF is read, just some display problem.

Now I have the error message as well: "Attempted to composite external textures using the software back end." Am I to suspect that I can't really test this on simulator, just on a real device (that I don't have)?

@espresso3389
Copy link
Owner

@deakjahn

Attempted to composite external textures using the software back end.

pdf_render uses Flutter's Texture that is realized by Metal API on iOS.
And, based on Apple's document, Xcode 11 adds iOS simulator Metal support.

So the cause is not Xcode 13. We should check other things.

Anyway, please open another issue to discuss such issues.

@espresso3389
Copy link
Owner

@deakjahn
According to this, iOS simulator uses Metal backend if >= iOS13, >= Catalina.

@deakjahn
Copy link
Contributor Author

@espresso3389 Fair enough, but I won't. I realized the reason: I run my Xcode on a macOS in a VM. So, sadly, it won't work. Not worth to start an issue for it. :-)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants