Looks like we have a problem with the GoogleMaps library...
At some point since the b4a GoogleMaps library was first created the Google Play Services library has been updated and is now an android 'library-project' and in order to use the GoogleMaps part of Google Play Services you are required to add a folder full of resources to your project.
Google Play Services assumes we're all developing using Eclipse, you add Google Play Services to your android Eclipse project as an 'library-project' and the folder of resources should automatically be added to your android project.
I was wondering why i couldn't see a 'My Location' button on a GoogleMap earlier, i'd enabled it with the code:
The unfiltered log shows:
I tried compiling without enabling the MyLocationButton and the log showed the same errors.
I've tried this now on 3 different devices: Galaxy S3(4.1.2), Galaxy Tab2(4.2.2) and an old HTC Desire S running a custom Jelly Bean ROM.
A Google search shows it's a common issue: https://www.google.co.uk/search?q=google+play+services+resource+not+found&ie=UTF-8&oe=UTF-8
Adding the resource folder from the android sdk to my project's res folder didn't solve anything.
(The resource folder location will be found at: \some_path_here\sdk\extras\google\google_play_services\libproject\google-play-services_lib\res)
The com.google.android.gms.R class is not being compiled with valid references to the required resources.
I've created b4a libraries from various android 'library-projects' in the past and worked around this problem by recreating the R class.
In the VitamioBundle library for example i created a class:
The VitamioBundle library-project source code is available - it's not a compiled .jar file - so getting VitamioBundle to use my class was no problem.
BUT Google Play Services is available as a compiled .jar only and i very much doubt we'd be able to reverse engineer it so that it uses a different R class to reference resources.
Has anyone updated their Google Play Services and found the MyLocationButton can no longer be enabled?
Is the MyLocationButton not being visible related to these missing resources?
I can see the zoom in and zoom out buttons and also the compass, why not the MyLocationButton?
Any ideas?
Martin.
At some point since the b4a GoogleMaps library was first created the Google Play Services library has been updated and is now an android 'library-project' and in order to use the GoogleMaps part of Google Play Services you are required to add a folder full of resources to your project.
Google Play Services assumes we're all developing using Eclipse, you add Google Play Services to your android Eclipse project as an 'library-project' and the folder of resources should automatically be added to your android project.
I was wondering why i couldn't see a 'My Location' button on a GoogleMap earlier, i'd enabled it with the code:
B4X:
GoogleMap1.GetUiSettings.MyLocationButtonEnabled=True
The unfiltered log shows:
** Activity (main) Create, isFirst = true **
VFY: unable to resolve static field 595 (common_google_play_services_unknown_issue) in Lcom/google/android/gms/R$string;
VFY: replacing opcode 0x60 at 0x0041
VFY: unable to resolve static field 595 (common_google_play_services_unknown_issue) in Lcom/google/android/gms/R$string;
VFY: replacing opcode 0x60 at 0x004e
VFY: unable to resolve static field 590 (common_google_play_services_install_title) in Lcom/google/android/gms/R$string;
VFY: replacing opcode 0x60 at 0x0059
VFY: unable to resolve static field 586 (common_google_play_services_enable_title) in Lcom/google/android/gms/R$string;
VFY: replacing opcode 0x60 at 0x0064
VFY: unable to resolve static field 600 (common_google_play_services_update_title) in Lcom/google/android/gms/R$string;
VFY: replacing opcode 0x60 at 0x006f
VFY: unable to resolve static field 597 (common_google_play_services_unsupported_title) in Lcom/google/android/gms/R$string;
VFY: replacing opcode 0x60 at 0x0081
VFY: unable to resolve static field 594 (common_google_play_services_network_error_title) in Lcom/google/android/gms/R$string;
VFY: replacing opcode 0x60 at 0x0093
VFY: unable to resolve static field 595 (common_google_play_services_unknown_issue) in Lcom/google/android/gms/R$string;
VFY: replacing opcode 0x60 at 0x00a5
VFY: unable to resolve static field 595 (common_google_play_services_unknown_issue) in Lcom/google/android/gms/R$string;
VFY: replacing opcode 0x60 at 0x00b7
VFY: unable to resolve static field 592 (common_google_play_services_invalid_account_title) in Lcom/google/android/gms/R$string;
VFY: replacing opcode 0x60 at 0x00c9
VFY: unable to resolve static field 595 (common_google_play_services_unknown_issue) in Lcom/google/android/gms/R$string;
VFY: replacing opcode 0x60 at 0x00dc
VFY: unable to resolve static field 587 (common_google_play_services_install_button) in Lcom/google/android/gms/R$string;
VFY: replacing opcode 0x60 at 0x000f
VFY: unable to resolve static field 584 (common_google_play_services_enable_button) in Lcom/google/android/gms/R$string;
VFY: replacing opcode 0x60 at 0x0016
VFY: unable to resolve static field 598 (common_google_play_services_update_button) in Lcom/google/android/gms/R$string;
VFY: replacing opcode 0x60 at 0x001d
VFY: unable to resolve static field 595 (common_google_play_services_unknown_issue) in Lcom/google/android/gms/R$string;
VFY: replacing opcode 0x60 at 0x0009
VFY: unable to resolve static field 589 (common_google_play_services_install_text_tablet) in Lcom/google/android/gms/R$string;
VFY: replacing opcode 0x60 at 0x001a
VFY: unable to resolve static field 588 (common_google_play_services_install_text_phone) in Lcom/google/android/gms/R$string;
VFY: replacing opcode 0x60 at 0x003a
VFY: unable to resolve static field 585 (common_google_play_services_enable_text) in Lcom/google/android/gms/R$string;
VFY: replacing opcode 0x60 at 0x0041
VFY: unable to resolve static field 599 (common_google_play_services_update_text) in Lcom/google/android/gms/R$string;
VFY: replacing opcode 0x60 at 0x0048
VFY: unable to resolve static field 596 (common_google_play_services_unsupported_text) in Lcom/google/android/gms/R$string;
VFY: replacing opcode 0x60 at 0x0068
VFY: unable to resolve static field 593 (common_google_play_services_network_error_text) in Lcom/google/android/gms/R$string;
VFY: replacing opcode 0x60 at 0x006f
VFY: unable to resolve static field 591 (common_google_play_services_invalid_account_text) in Lcom/google/android/gms/R$string;
VFY: replacing opcode 0x60 at 0x0076
VFY: unable to resolve static field 595 (common_google_play_services_unknown_issue) in Lcom/google/android/gms/R$string;
VFY: replacing opcode 0x60 at 0x000e
The Google Play services resources were not found. Check your project configuration to ensure that the resources are included.
Permission denied: checkComponentPermission() owningUid=10067
Permission denied: checkComponentPermission() owningUid=10067
** Activity (main) Resume **
The Google Play services resources were not found. Check your project configuration to ensure that the resources are included.
Displayed uk.co.martinpearman.b4a.googlemapdemo/.main: +1s69ms
The Google Play services resources were not found. Check your project configuration to ensure that the resources are included.
GC_EXPLICIT freed 231K, 55% free 3462K/7600K, paused 3ms+4ms, total 63ms
Successfully inserted location
I tried compiling without enabling the MyLocationButton and the log showed the same errors.
I've tried this now on 3 different devices: Galaxy S3(4.1.2), Galaxy Tab2(4.2.2) and an old HTC Desire S running a custom Jelly Bean ROM.
A Google search shows it's a common issue: https://www.google.co.uk/search?q=google+play+services+resource+not+found&ie=UTF-8&oe=UTF-8
Adding the resource folder from the android sdk to my project's res folder didn't solve anything.
(The resource folder location will be found at: \some_path_here\sdk\extras\google\google_play_services\libproject\google-play-services_lib\res)
The com.google.android.gms.R class is not being compiled with valid references to the required resources.
I've created b4a libraries from various android 'library-projects' in the past and worked around this problem by recreating the R class.
In the VitamioBundle library for example i created a class:
B4X:
package com.yixia.vitamio.library;
import anywheresoftware.b4a.BA;
import anywheresoftware.b4a.BA.Hide;
@Hide
public final class R {
@Hide
public static final class drawable {
public static int btn_check_holo_dark=BA.applicationContext.getResources().getIdentifier("btn_check_holo_dark", "drawable", BA.packageName);
public static int btn_check_off_disabled_focused_holo_dark=BA.applicationContext.getResources().getIdentifier("btn_check_off_disabled_focused_holo_dark", "drawable", BA.packageName);
public static int btn_check_off_disabled_holo_dark=BA.applicationContext.getResources().getIdentifier("btn_check_off_disabled_holo_dark", "drawable", BA.packageName);
public static int btn_check_off_focused_holo_dark=BA.applicationContext.getResources().getIdentifier("btn_check_off_focused_holo_dark", "drawable", BA.packageName);
}
}
The VitamioBundle library-project source code is available - it's not a compiled .jar file - so getting VitamioBundle to use my class was no problem.
BUT Google Play Services is available as a compiled .jar only and i very much doubt we'd be able to reverse engineer it so that it uses a different R class to reference resources.
Has anyone updated their Google Play Services and found the MyLocationButton can no longer be enabled?
Is the MyLocationButton not being visible related to these missing resources?
I can see the zoom in and zoom out buttons and also the compass, why not the MyLocationButton?
Any ideas?
Martin.