[英]AndEngine with Google Play game services
我使用AndEngine-GLES2-AnchorCenter,我希望实现Google Play游戏服务。
我复制BaseGameActivity
和GameHelper
从类BaseGameUtils
(谷歌的Play游戏服务的一部分- Android电子样本)我在同一个项目中util
包。
因为AndEngine已经使用了BaseGameActivity
,我将它重命名为GBaseGameActivity
并将扩展类更改为BaseGameActivity(AndEngine类),所以从这里:
public abstract class BaseGameActivity extends FragmentActivity
至:
public abstract class GBaseGameActivity extends BaseGameActivity
然后我在GBaseGameActivity
上扩展了我的类(当我扩展BaseGameActivity(AndEngine类)时,它的工作......但不是GBaseGameActivity(BaseGameUtils类))
public class BaseActivity extends GBaseGameActivity
我尝试编译我的项目,但我得到了:
...
Could not find class 'com.xxx.xxx.util.GameHelper', referenced from method com.xxx.xxx.util.GBaseGameActivity.<init>
Could not find class 'com.xxx.xxx.util.GameHelper', referenced from method com.xxx.xxx.util.GBaseGameActivity.onCreate
FATAL EXCEPTION: main
java.lang.NoClassDefFoundError: com.xxx.xxx.util.GameHelper
at com.xxx.xxx.util.GBaseGameActivity.<init>(GBaseGameActivity.java:63)
at com.xxx.xxx.BaseActivity.<init>(BaseActivity.java:35)
...
GBaseGameActivity.java:63:
63| mHelper = new GameHelper(this);
BaseActivity.java:35:
35| public class BaseActivity extends GBaseGameActivity
哪里有问题?
问题是google-play-services
模块范围设置为Provided
而不是Compile
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.