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

[Build] Android: The minimum API level required by the kit is 16 or source Qt file does not exist QtAndroidAccessibility-bundled.jar #818

Open
bagage opened this issue Dec 23, 2016 · 6 comments

Comments

@bagage
Copy link
Contributor

bagage commented Dec 23, 2016

Steps to reproduce

  1. Download QtCreator for Android version 5.7.1
  2. Open oo-mapper.pro in QtCreator and compile it with Android for armeabi-v7a

Actual behaviour

QtCreator yields:

The API level set for the APK is less than the minimum required by the kit.
The minimum API level required by the kit is 16.
Erreur lors de la compilation/déploiement du projet oo-mapper (kit : Android for armeabi-v7a (GCC 4.9, Qt 5.7.1))
When executing step "Build Android APK"

Expected behaviour

APK should be built.

Configuration

Mapper Version: master
Operating System: Debian unstable.
Android SDK: I installed Android SDK Tools 25.2.4, Android SDK Platform-tools 25.0.3, Android SDK Build-tools 25.0.2 and 24.0.2 and 23.0.3. Also installed Android API 25, 24, 23, 22, 21, 20, 19, 17, 9 and Android Support Repository 41.

Alternative work-around which fails too

If I modify AndroidManifest.xml and bump android:minSdkVersion to 16 (instead of 9), then application is compiled (except georeferenceing_dialog.cpp which does not compile due to missing QT_NETWORK_LIB. I had to comment out that section), but once QtCreator tries to build the APK it complains that:

Generating Android Package
  Input file: /home/gautier/code/openorienteeringmapper/src/android-libMapper.so-deployment-settings.json
  Output directory: /home/gautier/code/openorienteeringmapper/android-build/
  Application binary: /home/gautier/code/openorienteeringmapper/src/libMapper.so
  Android build platform: android-19
  Install to device: No
Source Qt file does not exist: /opt/Qt5.7.1/5.7/android_armv7/jar/QtAndroidAccessibility-bundled.jar.
17:09:34: Le processus "/opt/Qt5.7.1/5.7/android_armv7/bin/androiddeployqt" s'est terminé avec le code 6.
Erreur lors de la compilation/déploiement du projet oo-mapper (kit : Android for armeabi-v7a (GCC 4.9, Qt 5.7.1))
When executing step "Build Android APK"

QtAndroidAccessibility-bundled.jar file is NOT shipped in Qt5.7.1. I am fine with Android development in general, but I never used QtCreator before and I am not sure how/what is causing this build error here. Should I use a specific Android SDK version? Specific QtCreator version? Something unrelated? Is the kit not properly configured?

@dg0yt
Copy link
Member

dg0yt commented Dec 23, 2016

Qt 5.7 changed a number of things with regard to Android, and this may need changes to the Mapper build system. Until Qt 5.6, you would probably need API levels 10, 11, 16 and 18 (you may need to check the "Obsolete" checkbox to see these in the SDK manager) (cf. https://wiki.qt.io/Qt5ForAndroidBuilding).

Mapper for Android is expected to build without Qt Network. I fixed it 5 days ago (7bf3f89).

@bagage
Copy link
Contributor Author

bagage commented Dec 26, 2016

I tested with Qt5.6.2 but I face other errors:

First one: undefined reference to XXX. I commented closed_template_list->setSelectionMode(QAbstractItemView::SingleSelection); in template_dialog_reopen.cpp:62.

Second one:

Source Qt file does not exist: /home/gautier/Qt5.6.2/5.6/android_armv7/plugins/imageformats/libqjp2.so.
Generating Android Package
  Input file: /home/gautier/code/openorienteeringmapper/src/android-libMapper.so-deployment-settings.json
  Output directory: /home/gautier/code/openorienteeringmapper/android-build/
  Application binary: /home/gautier/code/openorienteeringmapper/src/libMapper.so
  Android build platform: android-25
  Install to device: No
17:45:26: The process "/home/gautier/Qt5.6.2/5.6/android_armv7/bin/androiddeployqt" exited with code 6.
Error while building/deploying project oo-mapper (kit: Android for armeabi-v7a (GCC 4.9, Qt 5.6.2))
When executing step "Build Android APK"

@dg0yt
Copy link
Member

dg0yt commented Dec 26, 2016

"Undefined references" indicate that your build is not clean. Obviously the method was found in the header.

The libqjp2.so plugin deployment can be removed in src/src.pro (and .in). This is the Jpeg2000 plugin, which is no longer part of standard builds of Qt since 5.6 (or you can build it from the Qt sources).

@bagage
Copy link
Contributor Author

bagage commented Dec 27, 2016

That was the last piece of the puzzle! I was finally able to run Mapper on my device after commenting out libqjp2.so. It could be worth updating the readme for compatible qt version (eg do not use 5.7 nor 5.6) to make the experience less chaotic for newcomers. If not interested, I let you close this issue.
Thanks!

@bagage
Copy link
Contributor Author

bagage commented Jan 3, 2017

For info, if you plan to support newer Qt versions, you have to:

  • starting at 5.6, remove libqj2.so:
sed -i '/libqjp2.so/d' src/src.pro src/src.pro.in
sed -i '/QtAndroidAccessibility-bundled.jar/d' src/src.pro src/src.pro.in
sed -i 's/android:minSdkVersion="9"/android:minSdkVersion="16"/' android/AndroidManifest.xml
  • Also, on Debian, you have to force build of Doxygen since the packaged version does not ship graph_legend.png:
sed -i '/DOXYGEN = $$system(doxygen -v/d' oo-mapper.pro

@dg0yt
Copy link
Member

dg0yt commented Mar 4, 2017

The JPEG2000 plugin issue is solved by d4263ae, backported to 0.6.8 in 6a2bfbe.

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