Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

The Google Play services resources were not found. Check your project configuration..

Discussion in 'Android' started by zezba9000, Oct 28, 2013.

  1. zezba9000

    zezba9000

    Joined:
    Sep 28, 2010
    Posts:
    983
    I'm trying to add GooglePlay Leaderboards and Achievements into my plugin, but keep getting the error:
    As far as I know iv'e done everything correctly. Added the "google-play-services_lib" project to my native Java eclipse project, added it as a "Reference", added the "google-play-services.jar" to that project and to the Unity plugins folder. I have also set "google-play-services.jar" to export its entries and can see in my "R.txt" file the entries are there.
     
  2. Extrawurst

    Extrawurst

    Joined:
    May 22, 2013
    Posts:
    43
    I have the same problem now. How did you resolve this ?
     
  3. zezba9000

    zezba9000

    Joined:
    Sep 28, 2010
    Posts:
    983
    I never figured it out. And after more research found that GooglePlayServices may not even work on some Android 2.3 devices... at least it looked that way. So I reverted back to using the normal AdMob framework. And I decided not to support there leaderboard systems for now as there are better options out there for Android like Scoreoid that will work out of the box on any device.

    The GooglePlay services libs seem to be in lala land right now... so I rly don't know whats up with it.
     
  4. TheValar

    TheValar

    Joined:
    Nov 12, 2012
    Posts:
    760
  5. Extrawurst

    Extrawurst

    Joined:
    May 22, 2013
    Posts:
    43
    Yeah I think so too. I have this running for me now and it seems to work just fine
     
  6. jvil

    jvil

    Joined:
    Jul 13, 2012
    Posts:
    263
    That's because the R.java class is regenerated by Unity once you compile your project, so all references to R class on Eclipse are lost.

    A quick fix could be copy these values to your Assets/Plugins/Android/res/values folder, then when Unity regenerate the R class will include the values. But, keep in mind the Google Play library is referencing their own R.class, you should make sure to reference the correct R class (your plugin) on the Google Play library or this will not work.
     
  7. salqadri

    salqadri

    Joined:
    Nov 1, 2013
    Posts:
    7
    Unfortunately, it is not harmless. If you run on a device with no google play services installed, then you'll have a problem because it needs to display an error dialog asking the user to download (or upgrade or enable depending on the situation) google play services. That dialog requires resources, and the logcat message is telling you that you don't have them. So be warned, your app will not work on older devices that do not have it preinstalled or do not have the latest version or do not have it enabled in their settings.

    I have not been able to find a good work around for this in Unity.
     
  8. g013

    g013

    Joined:
    Feb 15, 2014
    Posts:
    12
    Any news on resolving this issue ? I also have this problem. Thanks.
     
  9. KrayZLogic

    KrayZLogic

    Joined:
    Jun 19, 2013
    Posts:
    55
    This is how I do it with Eclipse.
    1. Start with your Eclipse plugin project. Go to properties -> android -> add library. Add the google-play-services-lib that you copied and imported from the sdk folder. Click apply.
    2. Make sure your plugin project is marked as a library.
    3. Drag the jar for your plugin only into the Plugins->Android folder in your Unity project. You'll also need to have your manifest file and a res->values->id.xml file in there with your app id. If you put the google-play-services-lib.jar in that folder, you'll get multiple dex files when you try to do a final build.
    4. Export your Unity project as an Eclipse project.
    5. Import the Unity project into your Eclipse workspace.
    6. Link the google-play-services-lib to this new project like you did in step 1.
    7. Build your apk in Eclipse

    I also put the google play services version number in the manifest instead of referencing a string value from the res folder. That was giving me errors. If you get some error about translations, go to Window -> Preferences -> Android -> Lint and change the translation error from fatal to warning. I think thats abou it. If you get multiple dex errors after all of this, try redoing your plugin with a fresh workspace.

    Also, I get the Google Play resources not found in logcat all the time on all of my devices. Everything still works fine.
     
    Last edited: Feb 15, 2014
  10. g013

    g013

    Joined:
    Feb 15, 2014
    Posts:
    12
    Thanks, this is working. I'm still having the print in logcat too though, which still seems rather problematic as salqadri pointed out. I don't get why it happens, if jvil could explain more in detail about the R.java file; isn't there one per project ? Following the steps to build in eclipse, shouldn't the google-play-services_lib's R.java be generated by eclipse, and not unity ? And then why wouldn't it find the resources then ? I'm rather lost with this R.java generation thing.

    Also, I don't understand the workaround of jvil. I've tried moving the res folder from Plugins/Android/google-play-services_lib/res to Plugins/Android/res, but that didn't solved the error message. How can I "make sure to reference the correct R class (your plugin) on the Google Play library" ?
     
  11. g013

    g013

    Joined:
    Feb 15, 2014
    Posts:
    12
    I've tried building with ant. Same result.
    I've unpacked the apk using apktool, and the google services ones are indeed inside.
    Anyone has the solution to this ?
     
  12. Anibal Hormeche

    Anibal Hormeche

    Joined:
    Jul 23, 2013
    Posts:
    4
    Thanks! I'm not too sure if I'm getting step 1 right, though... Is there a project included with NerdGPG? Or you created one from scratch, and manually imported the sources? Also, what do you mean with "Add the google-play-services-lib that you copied and imported from the sdk folder."? Did you drag the google-play-services.jar into the plugin project?

    Thanks in advance for any help, I'm also getting this error in my Android project :(
     
    Last edited: Apr 25, 2014
  13. MrMatthias

    MrMatthias

    Joined:
    Sep 18, 2012
    Posts:
    191
    Copy the library project at <android-sdk>/extras/google/google_play_services/libproject/google-play-services_lib/ to the Unity Plugins/Android folder. That's the simplest solution i have found.
     
  14. almo

    almo

    Joined:
    Jul 14, 2010
    Posts:
    83
    I am still getting this problem, and have google-play-services.jar in the Plugins/Android folder.
     
    Last edited: Mar 27, 2015
  15. almo

    almo

    Joined:
    Jul 14, 2010
    Posts:
    83
    Must copy res/values/version.xml from the google-play-services into your project, under Plugins/Android/res/values