Google Play Services component doesn't compile

I am having issue in running the Google Map.

It seems the error looks the same given in the link.

https://bugzilla.xamarin.com/show_bug.cgi?id=14910


/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets
(_CompileJava target) ->

obj/Debug/android/src/mono/com/google/android/gms/plus/PlusClient_OnPersonLoadedListenerImplementor.java(8,41):
javacerror : cannot find symbol
symbol : class OnPersonLoadedListener
location: class com.google.android.gms.plus.PlusClient
com.google.android.gms.plus.PlusClient.OnPersonLoadedListener

------------------------------------Please help in this issue------------------------------------------

Posts

  • Same issue as http://forums.xamarin.com/discussion/8252/build-error-after-avd-manager-software-updates#latest

    I've solved this problem with the given zip in https://bugzilla.xamarin.com/show_bug.cgi?id=14910
    Thus, rollback the google play services version 12 to 10.

  • TomOpgenorthTomOpgenorth CAXamarin Team Xamurai

    One other thing to be aware of when manually rolling back to an older version. The zip file containing Google Play services has everything in a directory name google-play-services. The SDK Manager installs everything to google_play_services, which is where the component is expecting to find the .jar file.

    So you may need to rename $ANDROID_HOME/extras/google/google-play-services to $ANDROID_HOME/extras/google/google_play_services (replacing the - with _).

  • chetansurichetansuri USMember

    Silly mistake :{

    Google map is deploying with no errors.
    But In Android Emulator(Target Android 4.0) - It is giving issue in Emulator "Unfortunately my app has stopped"

    I have attached the screenshot for the issue and project files.

  • TomOpgenorthTomOpgenorth CAXamarin Team Xamurai

    Sadly, Google Play services is only supported on emulators running the most recent Google API's (API 18 at this point in time). It's unsupported on an Android 4.0 emulator.

  • CheesebaronCheesebaron DKInsider, University mod

    Either use API 18 or try Genymotion. I use the latter with great results, it is lightning fast and has all the Google stuff built in.

  • chetansurichetansuri USMember

    I used API 18.

    The issue is "Unfortunately My app has stopped".

    The error log says:

    I have attached the error log text file.

  • chetansurichetansuri USMember

    Update :

    Two things i did in manifest file :

    1)Removed duplicate <application tag.
    2)Added ACCESS_NETWORK_STATE

    The app is running, but in a white screen is displaying.
    Changed the API key, still same.

  • TomOpgenorthTomOpgenorth CAXamarin Team Xamurai

    If you're getting the white screen, that typically means the component is working but you have a configuration error, for example:

    • Typo in the API key in your AndroidManifest.XML
    • Didn't whitelist the package name / keystore fingerprint
    • Didn't turn on Google Maps Android API v2 in the Google API console
    • Used the wrong keystore fingerprint when creating the API key
  • chetansurichetansuri USMember
    edited September 2013

    How can i check the second and the last one.

    ->Didn't whitelist the package name / keystore fingerprint
    ->Used the wrong keystore fingerprint when creating the API key

    where can i find the correct Keystore.

    I am using this path :

    c:\Users...\AppData\Local\Xamarin\Mono for Android\debug.keystore"

  • TomOpgenorthTomOpgenorth CAXamarin Team Xamurai
    edited September 2013

    @chetansuri: those two points can be frustrating to verify/double check because it's pretty easy to make a typo.

    Looks like you've got the correct path for the debug.keystore. One alternative way to get the SHA1 fingerprint of the signing certificate is this:

    1. Unzip your APK to a directory of your choosing, C:\Temp\MyAPK. There should be a directory C:\Temp\MyAPK\META-INF.
    2. Run keytool as followse: keytool -printcert -file C:\Temp\MyAPK\META-INF\ANDROIDD.RSA.

    You will see the SHA1 fingerprint in the console output.

    To verify the package name, you can find that AndroidManifest.xml. Xamarin.Android will generate on at PROJECT_DIRECTORY\obj\Debug\android\AndroidManifest.xml. When you add the package name in the Google API Console, enter it exactly like you see in AndroidManifest.xml.

  • chetansurichetansuri USMember

    Deleted the default.keystore and generated a new keystore and SHA1 and a new API key.
    Still white screen displays.

    Please take a look to the files, its taking too much time for to fix it off.

  • TomOpgenorthTomOpgenorth CAXamarin Team Xamurai

    Your AndroidManifest.XML looks fine. All I can say at this point is that your app seems to be properly configured. If you examine the logcat output while your app is running there might be some clues there.

    I just noticed back on this post that your running it in a emulator. Is this still the case?

    If so, I would strongly discourage you from using the emulator. If you must, then be aware that Google Maps Android API v2 is only supported on emulators running the most version of Android with the Google API's.

  • chetansurichetansuri USMember
    edited September 2013

    The issue has been resolved, with the Help of @Allie - Xamrin team.
    In AndroidManifest.xml file , change the code

    <uses-permission android:name="com.google.android.android.permission.READ_GSERVICES" />
    

    to

    <uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />

  • TomOpgenorthTomOpgenorth CAXamarin Team Xamurai

    Glad to hear. My old Mark 1 eyeball missed the .gsf. too.

  • chetansurichetansuri USMember

    Thanks,topgenorth
    for your support and continuous follow up.

  • AlexStlAlexStl USMember

    I have the same problem. But to describe the decision does not help.
    AndroidManifest:

    Error: cannot find symbol
    symbol : class OnPersonLoadedListener
    location: class com.google.android.gms.plus.PlusClient
    com.google.android.gms.plus.PlusClient.OnPersonLoadedListener
    (googleMapRWM)

  • TomOpgenorthTomOpgenorth CAXamarin Team Xamurai

    That error occurs because of a mismatch between the version of the Google Play Services client library that is installed and the version that the binding was originally compiled against.

    The latest version of the Google Play Services Component will download the appropriate version of the Google Play Services client library and bind to that. However, there still might be some "crud" hanging around from previous builds which can cause problems.

    Make sure you're using rev 13 of the Google Play Services component. Then try deleting all of the obj and bin folders from your projects and then compilingagain.

  • AlexStlAlexStl USMember
    edited January 2014

    Yes, I checked it

    I tried to delete a folders and compiling again, but the error still remains

    However, I downloaded the library and compiling sample "MapsAndLocationDemo":

    Errors again...

  • TomOpgenorthTomOpgenorth CAXamarin Team Xamurai
    edited January 2014

    Make sure you're using rev 13 of the Google Play Services component. Remove your old Xamarin.Android binding project (if any) from the solution). Then try deleting all of the obj and bin folders from your projects and then compile again.

    The new Google Play Service Component doesn't rely on or use the version of the Google Play Services client library that you install via the Android SDK manager.

  • AlexStlAlexStl USMember

    Apparently the problem in the library. I create a new project - all good. As soon as I connect to the reference GooglePlayServicesLib.dll - errors appear.
    If I connect version 13 - two errors (doesn't exist - look up)
    If I connect version 10 - cannot find symbol symbol

  • TomOpgenorthTomOpgenorth CAXamarin Team Xamurai

    The component will take care of setting the reference to GooglePlayServicesLib.dll for you, do don't have to do a thing.

    I just created a new project with the Component, and it compiled just fine. I've attached it in the hopes that you'll download it and maybe spot some difference in your solution that would account for the build errors.

    BTW, what version of Xamarin.Android are you using?

  • AlexStlAlexStl USMember
    edited January 2014

    Xamarin 4.2.2

    I compiled your project, and again two errors (doesn't exist).

    In your project have not changed anything, just run and compiled

  • TomOpgenorthTomOpgenorth CAXamarin Team Xamurai

    That's the version of Xamarin Studio (and is the most recent version). Can you click on the "Show Details" button in the About Xamarin Studio dialog to get the version of Xamarin.Android?

    Also, can post the complete build log from that sample project? That might have some clues in there.

  • AlexStlAlexStl USMember

    Excuse me, did not pay attention.
    Xamarin.Android Version: 4.8.2

    I attached build log file.
    In the file there are words in Russian, because it is the system language.

  • TomOpgenorthTomOpgenorth CAXamarin Team Xamurai

    (Unfortunately I don't understand Russian beyond "Da" and "Nyet", so the log file doesn't help me out that much)

    Ah, okay. You need to upgrade to Xamarin.Android 4.10 to use the component. If you can't upgrade to that, then you will have to manually bind Google Play Services. The Maps And Location Demo v2 is one such example.

  • AlexStlAlexStl USMember

    Realy, it helped me. Thank you so much!!!

    And finally, my app has no errors.. but initialisation MapFragment is exception.
    I thought what it my error, and found a video TUTORIAL. Did all the example and again exception. I attached two files in hope you can help me

Sign In or Register to comment.