Hi all and Sorry in advance for asking this question, but after five days of searching on stackoverflow and doing google-engineering I still got no answer for my question:
I would like to include several *.jar files to my project that shall be used by my android app after Qt compiled it.
Here is my environment:
After googling for that problem, I tried almost everything, getting the same result each time: the .jars are not found for the android application or the build process did not work:
[javac] C:\workspaces\qt_android\build-GsQt-Android\android-build\src\com\gservice\MainActivity.java:14: error: package com.google.android.gms.common does not exist [javac] import com.google.android.gms.common.ConnectionResult; [javac] ^ [javac] C:\workspaces\qt_android\build-GsQt-Android\android-build\src\com\gservice\MainActivity.java:15: error: package com.google.android.gms.common.api does not exist [javac] import com.google.android.gms.common.api.GoogleApiClient; [javac] ^\MainActivity.java:15: error: package com.google.android.gms.common.api does not exist
and so on, for all of the eight jars that shall be included.
Here are the things I tried to include them:
OTHER_FILES += \ android/libs/google-api-client-1.19.0.jar \ android/libs/google-api-client-android-1.19.0.jar \ android/libs/google-api-services-gmail-v1-rev2-1.18.0-rc.jar \ android/libs/google-http-client-1.19.0.jar \ android/libs/google-http-client-android-1.19.0.jar \ android/libs/google-http-client-jackson-1.19.0.jar \ android/libs/google-oauth-client-1.19.0.jar \ android/libs/jackson-core-asl-1.9.13.jar \ android/libs/jsr305-1.3.9.jar \ android/AndroidManifest.xml \ android/src/com/gservice/MainActivity.java \
LIBS_INSTALL_PATH=/assets/libs
libraries.path=android/libs libraries.files += google-api-client-1.19.0.jar google-api-client-android-1.19.0.jar google-http-client-1.19.0.jar google-http-client-android-1.19.0.jar google-http-client-jackson-1.19.0.jar google-oauth-client-1.19.0.jar jackson-core-asl-1.9.13.jar jsr305-1.3.9.jar libraries.depends += FORCE INSTALLS += libraries
<RCC> <qresource prefix="/libs"> <file>android/libs/google-api-client-1.19.0.jar</file> <file>android/libs/google-api-client-android-1.19.0.jar</file> <file>android/libs/google-api-services-gmail-v1-rev2-1.18.0-rc.jar</file> <file>android/libs/google-http-client-1.19.0.jar</file> <file>android/libs/google-http-client-android-1.19.0.jar</file> <file>android/libs/google-http-client-jackson-1.19.0.jar</file> <file>android/libs/google-oauth-client-1.19.0.jar</file> <file>android/libs/jackson-core-asl-1.9.13.jar</file> <file>android/libs/jsr305-1.3.9.jar</file> </qresource> </RCC>
"rcc -binary google-api-client-1.19.0.jar -o google-api-client-1.19.0.rcc"
as additional parameter... I really do not know what to do next, all of my Android-configurations (JDK, SDK, NDK, Ant) are at the correct place and are accessable, JAVA_HOME var and ANT var are set.
Two scentences at the end: the code I want to include for Android is a Google+ authentication app I already created with the Android ADT and that works fine. I shall transfer that working components into the build environment of Qt.
Thanks in advance for reading that looooong description and for helping me getting that solved!
Loyd
SOLUTION:
There IS a way to include and use .jar Files with Android and Qt. And it is certainly the easiest way one can imagine:
That's it. No adaption of Project.pro or main.qrc needed and also no need to create a .properties file for android or similar.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With