I am trying to uncompress a Zip file. Using the latest Qt 5.15 on an Android device.
QFile downloadedZipFile(VALID_ZIP_LOCATION);
QuaZip zip(&downloadedZipFile);
if (!zip.open(QuaZip::mdUnzip)) {
qDebug() << "error" << zip.getZipError();
}
If my file is above 2GB it am getting an error -1000.
Files below 2GB are working as expected.
I tried
zip.setZip64Enabled(true);
before opening the file without success.
I also tried to use the constructor
QuaZip zip(VALID_ZIP_LOCATION)
Upon accessing the zip later I also get the following error:
QuaZip::goToFirstFile(): ZIP is not open in mdUnzip mode
which makes sense, as it couldn't open the file in the first place.
Any help is appreciated, as I am struggling with this Problem for a few days already.
The problem is an unresolved QT-Bug. Where QFile::seek cannot exceed a limit above a 32Bit Integer.
https://bugreports.qt.io/browse/QTBUG-84033
After identifying the problem I could resolve this issue by implementing native code for unzipping files in java for android.
Since iPhones are only running on 64Bit systems the native implementation did not need to be ported to ObjC.
Related
I have been trying to build an android kernel for a certain device, the Huawei Vitria, they finally uploaded their kernel source about 2 months ago so I try to build it the normal way which fails so I fix the main errors I see and get the kernel to build finally but, then I notice one error while building. I look into this file and see that they are using a weird way of building I think instead of the normal defconfigs, using a generic defconfig then a configuration file to configure their devices ontop of that(they've done this before but not to this extent), which leads me to think I'm missing a command to select the device config ontop of the defconfig to set up the drivers, but don't know what command was used.
So might there be a way to find out the command by looking at these two files
https://raw.githubusercontent.com/KainXS/android_kernel_huawei_y301a2/jellybean/drivers/huawei/hsad/parse_product.pl
https://raw.githubusercontent.com/KainXS/android_kernel_huawei_y301a2/jellybean/drivers/huawei/hsad/parse_product_id.pl
thanks
I'm not sure how much help this is, but the first command seems to want to be called with a parameter of a path to an XML file.
./parse_product.pl /ab/cd/hw_xxy_configs.xml
PRODUCT: xxy
reads: '/ab/cd/hw_xxy_configs.xml'
It pulls out some data from that file and pastes it into a .c file which presumably goes into the build configuration.
So, you're looking for an XML file containing your product-name.
The second file calls the first repeatedly to generate a set of .c files. Now - this second script takes an XML file as an argument, but I'm afraid I can't tell what it might be called. The file looks like it should contain product names and board-ids if that is any help.
i developed my application in QT, i am trying to port for android. my application working fine in android with few issues. the main issue is, i am not able to play the audio file when i am trying to put the audio file play Code i am getting error
QSound::play(FilePath);
Error: : -1: error: error: cannot find -lQtMultimediaKit
D:\Projects\test\demo.cpp:996: error: undefined reference to 'QSound::play(QString const&)'
my config: QT 4.8,QT Creator 2.5.83 and necessitas and windows XP
i am able to include the QSound Header file and using intellisense to type the QSound::Play no issue while typing when i am getting error on compilation. so i tried to look into the source folder and i found QSound.h header also.
How to play the Audio file in Android using QT?
in may case it works properly with no errors
my code:
player->setMedia(QUrl("qrc:/new/prefix1/1.mp3"));
// ok it works on windows
//also works on android
Stumblend in this one while searching info, this looks useful: http://qt-project.org/doc/qt-5/qml-qtmultimedia-mediaplayer.html
While the support of Audio for Android in QT is there, it's a journey through hell with the current release. If you want it stable in the end you'll end-up searching for external libraries anyway Take a look here
this works for me
file .pro
QTPLUGIN += qtaudio_coreaudio
QT += androidextras
QT += widgets
QT += quickcontrols2
file in Resources:
player2->setMedia(QUrl("qrc:/new/prefix1/folder_x/file.mp3"));
player2->play();
I copied the sample of Google breakpad for Android and added it to my project. I had first a problem to get the minidumps (I was triggering SIGSEGV errors but nothing was written on my SD card). I finally managed to get some minidumps (I don't really know how but that's not my main problem).
My problem is that I can't dump the symbols of my native libraries, it says the following error message :
dump_syms.exe libcppinterface.so > libcppinterface.so.sym
loadDataForPdb and loadDataFromExe failed
Open failed
Thanks for your help
The Breakpad tools are not very cross-platform friendly. You need to build dump_syms on a Linux machine in order to get a dump_syms binary that can read ELF/DWARF and produce debug symbols from your Android binaries. The Windows dump_syms.exe is only used for dumping symbols from MSVC-produced PDB files.
I have a problem running openCV samples project (3 - 4). Everytime that I run the program, I found the problem "Unforunately OpenCV Manager has stopped" displays in my Android emulator.
The problem occurs everytime that I call
OpenCVLoader.initAsync(OpenCVLoader.OPENCV_VERSION_2_4_3, this, mLoaderCallback);
I followed this page
http://docs.opencv.org/doc/tutorials/introduction/android_binary_package/dev_with_OCV_on_Android.html
This is the Warning Message that I have
/Applications/eclipse-android/android-ndk-r8c/toolchains/arm-linux-androideabi-4.6/prebuilt/darwin-x86/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld:
warning: hidden symbol '__aeabi_atexit' in
./obj/local/armeabi-v7a/libgnustl_static.a(atexit_arm.o) is referenced
by DSO
/Applications/eclipse-android/OpenCV-2.4.3-android-sdk/sdk/native/jni/../libs/armeabi-v7a/libopencv_java.so
Logcat (from OpenCV sample4):
gralloc_goldfish, org.opencv.samples.tutorial4 Emulator without GPU
emulation detected.
Note:
I set java compliance level to 1.6 since I have some problem compiling OpenCV c++ file.
(followed this page: 'Must Override a Superclass Method' Errors after importing a project into Eclipse)
I install adb with both OpenCV_2.4.3_binary_pack_armv7a.apk and OpenCV_2.4.3_Manager_2.0_armeabi-v7a.apk
I used Samsung Galaxy S as my cellphone emulator
I run into the same problem:
hidden symbol '__aeabi_atexit' armeabi-v7a/libgnustl_static.a(atexit_arm.o) is referenced by DSO
I am using the opencv test in jni, with an application that worked before I have added it.
I have tried to change the ARMv7-A machine to armeabi in the "Application.mk'
I have also tried to add all the paths mentioned above to the Project -> Properties -> C/C++ General -> Path and Symbols.
It didn't work.
Thanks to my team leader, I have found the solution:
in Application.mk, You need to change the APP_STL := gnustl_static
to APP_STL := gnustl_shared. This is because the lib apparantly was compiled in shared instead of static.
In addition, add to the loadlibrary area the lib: System.loadLibrary("gnustl_shared");
This should be done in a static area, as followed:
static {
try{
System.loadLibrary("gnustl_shared");
//To do - add your static code
}
catch(UnsatisfiedLinkError e) {
Log.v(TAG, "Native code library failed to load.\n" + e);
}
catch(Exception e) {
Log.v(TAG, "Exception: " + e);
}
}
That's it! it solved my problem...
Hope it helped.
Inbal
Your problem might simply be emulator itself, try to get an actually device to test on.
There are a lot of things that emulator can't handle.
If you use Android 4.2 than change to 4.0.3 or to 4.1. There is a bug about that: http://code.opencv.org/issues/2537
I had problems this days running the two tutorials too.
On my machine I installed OpenCV 2.4.3, Android-sdk-21 and Android-ndk-r8c, Eclipse Juno. I perform my tests on an Asus Transformer tf101g running Android 4.0.3.
When I ran the tutorials it failed with a strange ClassNotFoundException. Checking the project properties I realized that the two projects look for headers in a wrong place. Go to Project -> Properties -> C/C++ General -> Path and Symbols. Here you can see the include directories used in the jni file.
The NDKROOT environment variable was not set in my system and I had to manually set it to point to the NDK root folder.
Then I had to change the stl include from
${NDKROOT}/sources/cxx-stl/gnu-libstdc++/include
to
${NDKROOT}/sources/cxx-stl/gnu-libstdc++/4.6/include
Hope this can help.
I too struggled with this for almost 4 hours, including downgrading target to 4.0.3 but did not work.
The solution was to download the latest openCV manager from google play to your device directly.
I got the same error and thought even though late,the solution might help for some in future.
The error "Unforunately OpenCV Manager has stopped" pops up if its version is not supported by the android device hardware(like armeabi-v7a (ARMv7-A + NEON) or Intel x86,etc). uninstall the current Manager and install the proper one.
Paste the following code before onCreate() Method:
static {
System.loadLibrary("opencv_java3");
}
it worked for me.
Need your guidance, I am writing one app in android with the help of native code which will communicate with CAN (Controller Area Network) port ; for that in my C code i used linux/can.h header file. and i am following "http://mobilepearls.com/labs/ndk-builder-in-eclipse/" this link to build my app. but one i set all thing i got bellow msg in eclipse console box
Compile thumb : can_port <= cansend.c
jni/cansend.c:14:23: fatal error: linux/can.h: No such file or directory
compilation terminated.
make: *** [obj/local/armeabi/objs/can_port/cansend.o] Error 1
One more thing, i am working on windows environment. But i don't think this may be cause.
It is correct that it is not a Windows/Linux problem. The simple problem is that compiler is unable to find the file can.h. Now, for your info, when the compiler starts compiling, it searches for its header files in the folder
C:\(path to NDK folder)\platforms\(android-version)\(arch)\usr\include\linux
Now, if there isn't a can.h there, the compiler will flag an error. So the best way is
Either copy can.h to the above path (not tested)
Modify your Makefile to path to the correct directory where this header file is kept
Hope this helps!