SonarSystems / Cocos-Helper

Cocos2d-x external framework helper.
MIT License
120 stars 48 forks source link

Build error Google play services #32

Closed AlexanderBykin closed 8 years ago

AlexanderBykin commented 8 years ago

Hi.

First of all, thank you for your work that you do for Cocos2d-x community, i am really appreciate it. I have a problem with building my project with usage GooglePlayServices, i setup it correctly as you described at the video, but i need to notice you, i am also used SDKBOX from cocos2dx team.

i try to build project with command: cocos compile -p android here is error output:

    [javac] Compiling 11 source files to /proj.android/bin/classes
    [javac] /proj.android/src/sonar/systems/frameworks/GooglePlayServices/GooglePlayServicesGameHelper.java:32: error: package com.google.android.gms.appstate does not exist
    [javac] import com.google.android.gms.appstate.AppStateManager;
    [javac]                                       ^
    [javac] /proj.android/src/sonar/systems/frameworks/GooglePlayServices/GooglePlayServicesGameHelper.java:307: error: cannot find symbol
    [javac]             builder.addApi(AppStateManager.API);
    [javac]                            ^
    [javac]   symbol:   variable AppStateManager
    [javac]   location: class GooglePlayServicesGameHelper
    [javac] /proj.android/src/sonar/systems/frameworks/GooglePlayServices/GooglePlayServicesGameHelper.java:308: error: cannot find symbol
    [javac]             builder.addScope(AppStateManager.SCOPE_APP_STATE);
    [javac]                              ^
    [javac]   symbol:   variable AppStateManager
    [javac]   location: class GooglePlayServicesGameHelper
    [javac] 3 errors

can you please help me with that? forgot about my environment: ndk r10e, gps v.27, cocos2dx 3.8.1 Thanks.

OscarLeif commented 8 years ago

Ok seems that you're using the lastest version of Google play services. The AppStateManager is no longer used. I send the commit to @SonarSystems I hope with this the problem can be solved. If you want to fix in your project right now Replace GooglePlayServicesGameHelper.java You can use this: https://github.com/OscarLeif/Cocos-Helper/blob/master/External%20Cocos%20Helper%20Android%20Frameworks/Frameworks/GooglePlayServices/GooglePlayServicesGameHelper.java

AlexanderBykin commented 8 years ago

@OscarLeif thanks for reply i will try it.

AlexanderBykin commented 8 years ago

@OscarLeif yes it is work, thank you!

OscarLeif commented 8 years ago

@AlexanderShniperson That's great to hear, now the problem is solved :smile: maybe @SonarSystems it will be good to put this issue solved I don't know how this works. Sorry :disappointed:

SonarSystems commented 8 years ago

It has been merged and this issue has been closed thanks @AlexanderShniperson for reporting this and thanks @OscarLeif for fixing this issue.

Viva La Community