Android Question GoogleApiClient.isConnected() expects type interface but finds type virtual

Gentry

Member
Licensed User
Longtime User
Any ideas what to check in the library and extras setup on B4a 6.00? I started getting this error when the app starts (it compiles fine). App compiled fine (on a new PC via project zip) then I added the FirebaseMessaging service (just dropped in the example) then it starts throwing this error:

B4X:
java.lang.IncompatibleClassChangeError: The method 'boolean com.google.android.gms.common.api.GoogleApiClient.isConnected()' was expected to be of type interface but instead was found to be of type virtual (declaration of 'uk.co.martinpearman.b4a.fusedlocationprovider.FusedLocationProviderWrapper' appears in /data/app/com.gsoft.project/base.apk)

Things that were checked/done.

1) the custom(stub) google-play-services.jar is in add-ons library directory (google play services is current V32)
2) Android Support Repository (v36) and Google Repository (v32) are installed in the SDK
3) Firebase Manifest entries are there.
4) FB Apikey in manifest is a match and B4A keystore is correct.
5) correct google-services.json is in the project root directory
6) SDK path pointing to Android-21 (also tried Android-23), Min target 14 Max 21 (or 23 if v23.jar)

The app had a functional firebase auth process, but this error is raised when a service using the fused location provider is started.

What else do I need to check, look for?

Thanks for looking,
Gentry
 

Gentry

Member
Licensed User
Longtime User
Sure.

B4X:
java.lang.IncompatibleClassChangeError: The method 'boolean com.google.android.gms.common.api.GoogleApiClient.isConnected()' was expected to be of type interface but instead was found to be of type virtual (declaration of 'uk.co.martinpearman.b4a.fusedlocationprovider.FusedLocationProviderWrapper' appears in /data/app/com.gsoft.Project-1/base.apk)
    at uk.co.martinpearman.b4a.fusedlocationprovider.FusedLocationProviderWrapper.IsConnected(FusedLocationProviderWrapper.java:168)
    at com.gsoft.Project.mmloc._service_start(mmloc.java:355)
    at java.lang.reflect.Method.invoke(Native Method)
    at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:703)
    at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:340)
    at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:247)
    at java.lang.reflect.Method.invoke(Native Method)
    at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:134)
    at anywheresoftware.b4a.BA.raiseEvent(BA.java:153)
    at com.gsoft.Project.mmloc.handleStart(mmloc.java:95)
    at com.gsoft.Project.mmloc.onStartCommand(mmloc.java:69)
    at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:3170)
    at android.app.ActivityThread.access$2200(ActivityThread.java:150)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1505)
    at android.os.Handler.dispatchMessage(Handler.java:102)
    at android.os.Looper.loop(Looper.java:168)
    at android.app.ActivityThread.main(ActivityThread.java:5845)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:797)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:687)
java.lang.RuntimeException: Unable to start service com.gsoft.Project.mmloc@498f6c2 with Intent { cmp=com.gsoft.Project/.mmloc }: java.lang.RuntimeException: java.lang.IncompatibleClassChangeError: The method 'boolean com.google.android.gms.common.api.GoogleApiClient.isConnected()' was expected to be of type interface but instead was found to be of type virtual (declaration of 'uk.co.martinpearman.b4a.fusedlocationprovider.FusedLocationProviderWrapper' appears in /data/app/com.gsoft.Project-1/base.apk)
    at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:3209)
    at android.app.ActivityThread.access$2200(ActivityThread.java:150)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1505)
    at android.os.Handler.dispatchMessage(Handler.java:102)
    at android.os.Looper.loop(Looper.java:168)
    at android.app.ActivityThread.main(ActivityThread.java:5845)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:797)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:687)
Caused by: java.lang.RuntimeException: java.lang.IncompatibleClassChangeError: The method 'boolean com.google.android.gms.common.api.GoogleApiClient.isConnected()' was expected to be of type interface but instead was found to be of type virtual (declaration of 'uk.co.martinpearman.b4a.fusedlocationprovider.FusedLocationProviderWrapper' appears in /data/app/com.gsoft.Project-1/base.apk)
    at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:165)
    at anywheresoftware.b4a.BA.raiseEvent(BA.java:153)
    at com.gsoft.Project.mmloc.handleStart(mmloc.java:95)
    at com.gsoft.Project.mmloc.onStartCommand(mmloc.java:69)
    at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:3170)
    ... 8 more
Caused by: java.lang.IncompatibleClassChangeError: The method 'boolean com.google.android.gms.common.api.GoogleApiClient.isConnected()' was expected to be of type interface but instead was found to be of type virtual (declaration of 'uk.co.martinpearman.b4a.fusedlocationprovider.FusedLocationProviderWrapper' appears in /data/app/com.gsoft.Project-1/base.apk)
    at uk.co.martinpearman.b4a.fusedlocationprovider.FusedLocationProviderWrapper.IsConnected(FusedLocationProviderWrapper.java:168)
    at com.gsoft.Project.mmloc._service_start(mmloc.java:355)
    at java.lang.reflect.Method.invoke(Native Method)
    at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:703)
    at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:340)
    at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:247)
    at java.lang.reflect.Method.invoke(Native Method)
    at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:134)
    ... 12 more

not sure how to get the 12 more....
 
Upvote 0

Gentry

Member
Licensed User
Longtime User
Yes, thank you. New Environment, one old library (at least one). Does B4a store the library version in the required library list?

Would be a cool feature to be able to pull updated libraries, like...

B4X:
git pull --recurse-submodules

I guess I should have zipped up the entire add-on directory to graft to the new environment.

Thanks again.
 
Upvote 0

Gentry

Member
Licensed User
Longtime User
Yes, resolved. I was musing about new features to help keep libraries current.

Thank you.
Gentry
 
Upvote 0
Top