Android Question FusedLocationProvider error NoClassDefFound

DickD

Active Member
Licensed User
I am trying out FusedLocationProvider. I've written this very simple sample program below which I think pretty carefully follows the instructions and sample code in the Android Library. However, I always get the following error: "java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/gms/location/LocationListener;"

I have added the following lines to the manifest file:
#AdditionalJar: com.google.android.gms:play-services-location
AddPermission(android.permission.ACCESS_FINE_LOCATION)
AddApplicationText(<meta-data
android:name="com.google.android.gms.version"
android:value="@Integer/google_play_services_version" />)

I am using B4A 6.5, Google Play Services 11.9.75. I installed v1.10 of the FLP library.

B4X:
Sub Process Globals
 Private FLP As FusedLocationProvider
end sub

Activity_Start(FirstTime As Boolean)
FLP.Initialize("FLP")
FLP.Connect
end sub

Sub FLP_ConnectionFailed(ConnectionResult1 As Int)
 Log("Connection failed")
End Sub

Sub FLP_ConnectionSuccess()
 Log("Connection success")
 FLP.GetLastKnownLocation
End Sub

Sub FLP_LocationChanged(Location1 As Location)
 Log("Location Changed: " & Location1)
End Sub
 
Top