Android Question Google Maps / Firebase Services

LorenzoTRANSFEREX

Member
Licensed User
Longtime User
Hi, I had an app build with B4a v4+ and using Google Maps 1.01 lib. Now I am recompiling this app with B4A v6.31 and SDKs updated and I found several errors.
I was reading all post that I found about this, and I trying to update to Google Maps v2, Integrating Firebase Services, etc.
Trying to compile using FusedLocationProvider lib the last error I get is:

Compiling generated Java code. Error
B4A line: 327
FusedLocationProvider1.RequestLocationUpdates(
javac 1.7.0_21
src\eventos\tfx\main.java:2073: error: package com.google.android.gms.location does not exist
_fusedlocationprovider1.RequestLocationUpdates((com.google.android.gms.location.LocationRequest)(_locationrequest1.getObject()));

and Manifest file:

AddManifestText(
<uses-sdk android:minSdkVersion="4" android:targetSdkVersion="14"/>
<supports-screens android:largeScreens="true"
android:normalScreens="true"
android:smallScreens="true"
android:anyDensity="true"/>)
SetApplicationAttribute(android:icon, "@drawable/icon")
SetApplicationAttribute(android:label, "$LABEL$")
AddApplicationText(<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="AIzaSyAN3efpuqJCM3wUaN6Q46OKp_xxxxxxxxx"/>
<meta-data android:name="com.google.android.gms.version"
android:value="@Integer/google_play_services_version"/>)
AddPermission(android.permission.ACCESS_FINE_LOCATION)

I don't know what could be the problem exactly. For example, trying to integrate the Firebase services (Is it needed now really?), in the step 3. "Download google-services.json and put it in the projects folder (folder of the b4a file).", I don't find the projects folder, like Additionals Libraries folder...

I only want use FusedLocationProvider lib and Google Maps...

Thanks

Lorenzo
 
Upvote 0
You don't need to integrate Firebase.
1. You do need to follow the exact steps from the tutorial (see the B4A v6+ button): https://www.b4x.com/android/forum/threads/google-maps.63930/
2. You need to add this line for FusedLocationProvider:
Code:
#AdditionalJar: com.google.android.gms:play-services-location
No need to modify the XML file.

3. Make sure that the two repositories are up two date (in Android SDK Manager).
 
Upvote 0
Great, with #AdditionalJar: com.google.android.gms:play-services-location FusedLocationProvider lib works now.
I see that I must use #AdditionalJar: com.google.android.gms:play-services-maps for use Google Maps lib.

Like I see, now I must fight with white screen Google maps problems.

Thanks, Erel!
 
Upvote 0
Back
Top