Java – Add the Google Play Services library to your Qt project

Add the Google Play Services library to your Qt project… here is a solution to the problem.

Add the Google Play Services library to your Qt project

I’m creating an Android app in Qt and I have to use Qt Android Extras to communicate with my java code. In my java file, I’m using the Google Play Services library.

I’ve done everything described here.Build passed, but when I tried to use something in this library, I got an error:

W/dalvikvm(28101): Unable to resolve superclass of Lcom/google/android/gms/common/api/g; (169)
W/dalvikvm(28101): Link of class 'Lcom/google/android/gms/common/api/g; ' failed
I/dalvikvm(28101): Could not find method com.google.android.gms.common.api.g.a, referenced from method com.google.android.gms.common.api.GoogleApiClient$Builder.gI
W/dalvikvm(28101): VFY: unable to resolve static method 3384: Lcom/google/android/gms/common/api/g;.a (Landroid/support/v4/app/FragmentActivity;)Lcom/google/android/gms/common/ api/g;

… Trust me, there’s more….

So the question is: how do I add the Google Play Services library to my Qt project?

Solution

Well, I successfully fixed this bug by including the android support library into my project by ANDROID_PACKAGE_SOURCE_DIR PROJECT_DIR copying it from android-sdk\extras\android\support\v4 to my project \libs folder.

Related Problems and Solutions