Skip to content
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

container.xml couldn't be opened #11

Open
kebsont opened this issue Mar 21, 2020 · 24 comments
Open

container.xml couldn't be opened #11

kebsont opened this issue Mar 21, 2020 · 24 comments

Comments

@kebsont
Copy link

kebsont commented Mar 21, 2020

Hello, thanks for this plugin.
My problem is I can't open any epub file with it. I download it in the device, You can see here its path ( /Users/kebson/Library/Developer/CoreSimulator/Devices/24B449AE-9DA8-406B-BBDA-F9847D44211D/data/Containers/Data/Application/A53AE134-67FE-4630-9C4E-7C8F2D95D3F1/Documents/Epub_Format.pdf)

But when I try to open it, I got this error:
Screenshot 2020-03-21 at 21 49 35

I tried with different epub. But I always got the same error.

@kebsont kebsont changed the title container.xml not found container.xml couldn't be opened Mar 21, 2020
@451518849
Copy link
Owner

it can not read pdf! please, replace pdf file with epub.

@kebsont
Copy link
Author

kebsont commented Mar 22, 2020

Yes, It was an error from me.
But I tried epub with, and got the same error.
Here is the file: /Users/kebson/Library/Developer/CoreSimulator/Devices/24B449AE-9DA8-406B-BBDA-F9847D44211D/data/Containers/Data/Application/3111CC1B-3CDA-4F75-836C-673A1A4FD363/Documents/Epub_Format.epub

What I did is I took an epub url and download it locally, and tried to open it from the getApplicationDocumentsDirectory().

@451518849
Copy link
Owner

you can try epub file in example to confirm your epub file content is correct.

@kebsont
Copy link
Author

kebsont commented Mar 22, 2020

Yeah I've tried with that one too . I even cloned that repo to try for seeing if it's my epub which is corrupted but got the same error.

@451518849
Copy link
Owner

confused! can you show your code, let me see it.

@kebsont
Copy link
Author

kebsont commented Mar 22, 2020

child: Container(
                      height: mediaQuery.size.height - 30,
                      child: itemProvider.downloaded
                          ? GestureDetector(
                              onTap: () async {
                                itemProvider.getDownload().then((v) {
                                  if (v.isNotEmpty) {
                                    ItemModel dl = v[0];
                                    String itemPath = dl.fileUrl;
                                    EpubKitty.setConfig(
                                        "iosBook", "#32a852", "vertical", true);
                                    EpubKitty.open(itemPath);
                                    pageChannel.receiveBroadcastStream().listen((Object event) {
                                        print('page:$event');
                                      }, onError: null);

                                    
                                  }
                                });
                              },
                              child: ClipRRect(
                                borderRadius: BorderRadius.circular(24.0),
                                child: CachedNetworkImage(
                                  imageUrl:
                                      "imgUrlHere",
                                  placeholder: (context, img) => Center(
                                      child: CircularProgressIndicator()),
                                  errorWidget: (context, img, error) =>
                                      Image.asset(
                                    "assets/images/Diawartou.png",
                                    width: mediaQuery.size.width / 2,
                                    height: (mediaQuery.size.height - 2),
                                  ),
                                ),
                              ))

@451518849
Copy link
Owner

It seems no problem. then print the 'itemPath' and show it .

@kebsont
Copy link
Author

kebsont commented Mar 22, 2020

/Users/kebson/Library/Developer/CoreSimulator/Devices/24B449AE-9DA8-406B-BBDA-F9847D44211D/data/Containers/Data/Application/3111CC1B-3CDA-4F75-836C-673A1A4FD363/Documents/Epub_Format.epub

@451518849
Copy link
Owner

The path is also no problem. I suggest you to try in local first. Copy the Epub_Format.epub into Application/3111CC1B-3CDA-4F75-836C-673A1A4FD363/Library/Caches, and use following code to get path
Directory appDocDir = await getTemporaryDirectory();
then try open it.

@451518849
Copy link
Owner

If you can not open your epub , copy example/ios/3.epub to local cache with the same way above.

@kebsont
Copy link
Author

kebsont commented Mar 22, 2020

The same, it's not relative to the path or the file itself.
I've changed the directory to use this one /Users/kebson/Library/Developer/CoreSimulator/Devices/24B449AE-9DA8-406B-BBDA-F9847D44211D/data/Containers/Data/Application/1DDE1F0A-954F-4B6A-BC6B-335F582B7ABD/Library/Caches/Epub_Format.epub
and it doesn't work, same for the file

@451518849
Copy link
Owner

Ok,I will check it, give me a little time.

@kebsont
Copy link
Author

kebsont commented Mar 22, 2020

Okay thanks.
I'm waiting for ...

@451518849
Copy link
Owner

You use the example or plugin 0.1.5?

@kebsont
Copy link
Author

kebsont commented Mar 22, 2020

Yes I do.

@451518849
Copy link
Owner

You can try 0.1.0.

@kebsont
Copy link
Author

kebsont commented Mar 22, 2020

Ok

@kebsont
Copy link
Author

kebsont commented Mar 22, 2020

I got the same error

@451518849
Copy link
Owner

I found an error on 0.1.5 but not yours.

@kebsont
Copy link
Author

kebsont commented Mar 22, 2020

what is it ? not related with mine ?

@451518849
Copy link
Owner

Yeah, I found the page not show correctly and will cause a collapse, however, it can read book.

@kebsont
Copy link
Author

kebsont commented Mar 22, 2020

for me I can't even open the first page

@451518849
Copy link
Owner

I think it's either the wrong path or the file.

@kebsont
Copy link
Author

kebsont commented Mar 22, 2020

No, I'm sure it's not any of them. Because the file I can open it with an epub reader, I even use anothers epub file to test and the path I changed it twice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants