stachenov / quazip

Qt/C++ wrapper over minizip
Other
582 stars 232 forks source link

QuaZip for Android [kit: Android_ARM64_v8a] (Qt 5.13.1) #123

Closed ahsnuet closed 3 years ago

ahsnuet commented 3 years ago

I want to use quazip in my android application. But the app crashes on startup.

I have compiled quazip in qt using the kit: Android for ARM64_v8a It has generated a library file named "libquazip.so".

The *.pro file of quazip [android part]:

android {
    headers.path=$$PREFIX/include/quazip
    headers.files=$$HEADERS
    target.path=$$PREFIX/lib/$${LIB_ARCH}
    INSTALLS += headers target
    LIBS += -lz
    OBJECTS_DIR=.obj
    MOC_DIR=.moc
}

*.pro file of my project [library inclusion].

INCLUDEPATH += $$PWD/include LIBS += -L$$PWD/lib LIBS += -lquazip -lz

The error log is available as an attachment:

errorLog.txt

stachenov commented 3 years ago

You really need to learn how to ask for help properly. First you ask a question that could have been easily answered simply by looking at the docs. Then you post a wall of text generated by some unknown process on a system that isn't even supported, without doing any research or even bothering to figure out the relevant parts of that wall of text.

ahsnuet commented 3 years ago

Firstly, I shouldn't have posted the error log, but if I don't then people usually ask for it. As they're not able to figure out the nature of the error. And there is no file attachment option otherwise I would have opted for that.

Secondly, thank you for such an impolite reply, I couldn't find any word for android regarding quazip but the following two links made me think perhaps it can work.

  1. https://stackoverflow.com/questions/63267130/qt-quazip-open-fail-1000
  2. https://forum.qt.io/topic/113644/cannot-find-library-path-permission-denied
stachenov commented 3 years ago

You miss the point.

You should post the error log. Because the reasons you stated.

But it isn't about posting the error log. It's about not posting anything else. It's your problem, so it's your responsibility to try to solve it. So you do it, google a lot, try various things, and then, if you fail, you ask for help by providing a brief description of the problem, of everything you tried to solve it, what results you got including relevant error logs or parts of them, what ideas you had and how they didn't work out.

If you instead just write “I tried X, got this error, help me plz”, now that's impolite. And I don't bother being polite with impolite people, that I admit.

I don't think I can help you anyway because I have literally zero Android development experience, unless one counts a couple of toy projects, and I never even knew Qt works under Android. But if you at least try to put some effort and describe your issue properly, then there's at least hope that someone may be eventually able to help you out. Otherwise, there's zero chance. Nobody will even read it.

BTW, there is an option to attach files. It says right below the text input area: “Attach files by dragging & dropping, selecting or pasting them”. And if you click it, a regular browse dialog opens. At least on desktop.

ahsnuet commented 3 years ago

I have got the point. Thanks for your words.

I have already tried to gave enough explanation of what I have attempted and it haven't produced results. [if you've read carefully]

As you've already responded to this question that quzip lack support for android. I guess this is what making this crash. Otherwise in Qt, apps are easy to port from desktop to android.

I am going to close this topic. Thanks

stachenov commented 3 years ago

You've provided your explanation in the edited issue, but forgot to mentioned the fact that you edited it (GitHub doesn't notify about edits for whatever reason). I only saw it now.

No, I don't thing it has anything to do with Android being unsupported. QuaZip is just code. It should work on whatever platform you manage to compile it for. It is some sort of linking error, I think. In the log you have removed (but probably shouldn't have) there was something about libquazip.so not being found. But I have absolutely no idea how Android looks for native libraries (first time I even hear about such thing!), so I can't help you here.

I don't think it has anything to do with QuaZip either. I think you've missed my point after all. This part: “...you do it, google a lot, try various things...”. The very first thing you should have tried is to make a small hello-world-like library using Qt, build it and try to use it in your app. If it works, and QuaZip doesn't, you should try to figure out how is your hello-world different from QuaZip, by, e. g., adding zlib dependency to it, and so on. That's what's called research, and that's what your issue lacks.

ahsnuet commented 3 years ago

You've provided your explanation in the edited issue, but forgot to mentioned the fact that you edited it (GitHub doesn't notify about edits for whatever reason). I only saw it now.

No, I don't thing it has anything to do with Android being unsupported. QuaZip is just code. It should work on whatever platform you manage to compile it for. It is some sort of linking error, I think. In the log you have removed (but probably shouldn't have) there was something about libquazip.so not being found. But I have absolutely no idea how Android looks for native libraries (first time I even hear about such thing!), so I can't help you here.

I don't think it has anything to do with QuaZip either. I think you've missed my point after all. This part: “...you do it, google a lot, try various things...”. The very first thing you should have tried is to make a small hello-world-like library using Qt, build it and try to use it in your app. If it works, and QuaZip doesn't, you should try to figure out how is your hello-world different from QuaZip, by, e. g., adding zlib dependency to it, and so on. That's what's called research, and that's what your issue lacks.

Yes, actually the first post was mistakenly posted (use of Enter + Ctrl for the new line as some apps support that). That is why I edited it.

actually, I have looked for possible solutions, there is very little information about deployment on android. But I have tried different variations that I have seen (possible ways of generating library by compiling quazip code, and addition of the library to project *.pro) but without luck.

And I have tried it first for desktop, it worked, and then I switched to the android part.

ahsnuet commented 3 years ago

The issue is solved: For the android kit, I haven't added the library in *.pro. Instead, I have used the source and header files of quazip.

QUAZIPCODEDIR = "D:/compression/zlib-quazip/quazip-0.7.3/quazip-0.7.3/quazip" INCLUDEPATH += $${QUAZIPCODEDIR} HEADERS += $${QUAZIPCODEDIR}/*.h SOURCES += $${QUAZIPCODEDIR}/*.cpp SOURCES += $${QUAZIPCODEDIR}/*.c