0

For the last 2 days I've been trying to simply get Google play game services Integrated into my game. I've followed the instructions here...

https://github.com/playgameservices/android-basic-samples/blob/master/README.md

...many many times. I have been trying to get it to build with Gradle but for now, I'll just focus on Eclipse building until that works. I've imported BaseGameUtils project into my workspace as an Android library project. My game android project has two Android library dependencies: google-play-services_lib and BaseGameUtils. Everything in Eclipse is showing without any errors. When I build and run on a real device, I see an error that says -

[2014-10-27 20:39:25 - BaseGameUtils] Could not find BaseGameUtils.apk!

I don't know why it's even looking for BaseGameUtils.apk since it should be an Android library. That said, I'm not sure how an Android library is really handled so maybe it should be a .apk. In any case, I couldn't find any information on this bug and the error message doesn't give me much to work with. I've tried adjusting things in the Build Path but no luck. I did have to remove some redundant dependencies in my Build Path earlier since I was getting some kind of duplicate DEX error but I'm not sure that's related in any way to this. I am desperate for help, anyone have any idea?

Barodapride
  • 3,475
  • 4
  • 25
  • 36

2 Answers2

0

Can you try this? It has to do with conflicting methods of specifying that a project is a library.

I found the source of the problem!

It turns out that "with the new library feature, you don't specify the Android projects you depend on in the Java Build Path section of the Properties. You do it in the Android section of the Properties".

So all I had to do is go the Application Project's Properties, hit the Projects tab, select my own library project and click the Remove button. That's it. No more problem.

In Eclipse Java EE select the project Properties, then select Project References, then check the FacebookSDK (see screen capture) From: Android Eclipse - Could not find *.apk

If that doesn't help, you may want to double check that you selected "Is Library" in BaseGameUtils.

Also, when you hit "Run" in Eclipse, are you running your application and not BaseGameUtils?

Community
  • 1
  • 1
vman
  • 1,264
  • 11
  • 20
  • I tried that. It did remove the one random BaseGameUtils.apk could not be found but the stack trace still says it could not find GameHelper object (and other things from BaseGameUtils). I forgot to mention I could see this in the stack trace before. Thanks for the suggestion. – Barodapride Oct 28 '14 at 11:19
  • So are you now getting a ClassNotFoundException? Also, are you able to run their sample applications? – vman Oct 28 '14 at 15:46
0

Please would you check that BaseGameUtils has "is library" checked and that your application project DOES NOT have "is library" checked.

If this is correct, then please would you review the following in detail (especially as regards checking and unchecking "is library" ) :

Android Eclipse - Could not find *.apk

I presume that the DEX error related to two or more versions of the same lib. What is the specific GameHelper error ?

As a general point, I find it productive to get a sample project working first to ensure that I have got the environment working correctly before I start integrating game services into my own projects. If you have been changing the build path then it may be quicker to start from scratch and get a sample working. I have followed those instructions in the past and they are accurate.

Community
  • 1
  • 1
IanB
  • 3,489
  • 1
  • 20
  • 24
  • Thanks, I have checked the 'is library' multiple times on all projects in my workspace and they seem to be just fine. I will try to get the samples up and running. I wanted to avoid doing so because it seemed somewhat complicated to get them working due to having to register some stuff in the Google Play developer console. – Barodapride Oct 29 '14 at 00:00
  • The developer console work takes a while, but it will be worth it in the long run because you will know exactly what to do to make your own project work. If you give me the exact error you now have in your project I may be able to help. – IanB Oct 29 '14 at 00:06
  • I will get back to you on the exact error(s). I decided to revert back to a previous version I had with google-play-services and ads that was all working. One of my errors had to do with not knowing how to resolve AdView - which I thought was strange since I didn't touch the google-play-services_lib project. I will spend some time getting the samples to work and when I try to integrate BaseGameUtils into my project I will post here. – Barodapride Oct 29 '14 at 00:48
  • I have just installed the Type a Number game sample and it works beautifully. I will try to integrate BaseGameUtils into my project now. I'm not sure if this is the issue I was experiencing but I know I was running my .apk using the debug certificate while the project in Google play console is looking for my release certificate. That said, I believe my app should have still been able to boot up. – Barodapride Oct 29 '14 at 01:47
  • Good. Normally I link one app to each game in the developers console TWICE. In one I use the debug certificate and in the other I use the release certificate. The following may be overkill, but my next step was to add the Type A Number code into my own project and then once that works, modify it ! – IanB Oct 29 '14 at 10:12