Android Question Google Map in debug mode failed ...

Yayou49

Active Member
Licensed User
Hi,

B4A Version: 5.80

I'm using a google map service.
Running my app on my phone is quite ok.
Trying to run the app in debug mode with an emulator fails:
"Please install Google Play Services."
I've done everything in Erel's tuto for V5.8, so I don't understand.

- I've enabled Google Maps Android API
- created a key
- installed the Android SDK "google play service"
- adding stuff to my manifest as following (with the good API key):
AddManifestText(
<uses-sdk android:minSdkVersion="5" android:targetSdkVersion="14"/>
<supports-screens android:largeScreens="true"
android:normalScreens="true"
android:smallScreens="true"
android:anyDensity="true"/>)
AddManifestText(<permission
android:name=".$PACKAGE$.permission.MAPS_RECEIVE"
android:protectionLevel="signature"/>
<uses-feature android:glEsVersion="0x00020000" android:required="true"/>)
AddApplicationText(<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="AIzaSyA0kIYq2_XXXXXXXXXXXXXXXXXXXXXXX"/>
<meta-data android:name="com.google.android.gms.version"
android:value="@Integer/google_play_services_version" />)
SetApplicationAttribute(android:icon, "@drawable/icon")
SetApplicationAttribute(android:label, "$LABEL$")
AddManifestText(
<uses-sdk android:minSdkVersion="4" android:targetSdkVersion="17"/>
<supports-screens android:largeScreens="true"
android:normalScreens="true"
android:smallScreens="true"
android:anyDensity="true"/>)
AddManifestText(<uses-feature android:name="android.hardware.telephony" android:required="false" />)
AddManifestText(<uses-feature android:name="android.hardware.camera" android:required="false" />)
AddManifestText(<uses-feature android:name="android.hardware.camera.autofocus" android:required="false" />)
AddManifestText(<uses-feature android:name="android.hardware.camera.flash" android:required="false" />)
AddManifestText(<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />)
AddPermission("android.permission.INTERNET")
AddPermission("android.permission.READ_PHONE_STATE")
AddPermission("android.permission.CAMERA")
AddPermission("android.permission.FLASHLIGHT")
AddPermission("android.hardware.camera")
SetApplicationAttribute(android:icon, "@drawable/icon")
SetApplicationAttribute(android:label, "$LABEL$")
- Add attributes to the main activity as describe:
#AdditionalRes: C:\android-sdk\extras\google\google-play-services\libproject\google-play-services_lib\res, com.google.android.gms
#ExcludeClasses: .games, .drive, .fitness, .wearable, .measurement, .cast, .auth, .nearby
#ExcludeClasses: .tagmanager, .analytics, .wallet, .plus, .vision, .gcm
- Add the Android-support-v4.jar and google-play-services.jar to my AddLib

But even with all those things, with my emulator, it doesn't work.
My emulator is:
Android 6.0
API level 23
Intel Atom(x86_64)

Does someone know what can be wrong ????

Thx in advance.
 

DonManfred

Expert
Licensed User
Longtime User
debug is mandatory.
yes. use a REAL Device! The Emulator is not reliable, it is f***** slow.

Edit: i can not see any problem in your code though i can not test as i do not have 5.8 anymore.
 
Upvote 0

eurojam

Well-Known Member
Licensed User
Longtime User
you should follow the tutorial for B4A 5.8+....your code uses google map like in B4A below 5.8
https://www.b4x.com/android/forum/threads/google-maps.63930/#post-404386
it should be somethink like this:
B4X:
#Region  Project Attributes
    #ApplicationLabel: GoogleMapDemo
    #VersionCode: 1
    #VersionName:
    'SupportedOrientations possible values: unspecified, landscape or portrait.
    #SupportedOrientations: portrait
    #CanInstallToExternalStorage: False
#End Region

#Region  Activity Attributes
    #FullScreen: False
    #IncludeTitle: True
#End Region

#AdditionalJar: com.google.android.gms:play-services-maps
 
Last edited:
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
Upvote 0
Top