问题描述
我正在Eclipse中设置项目,以实现新的 Android Play Services
。您可以在下面的3个截图中看到, BibleTriviaLite
是我的项目,然后是$ code BaseGameUtils 和 google -play-services_lib
是我导入的两个项目,制作图书馆,然后制作 BibleTriviaLite
引用它们。
现在我在每个项目都有错误。基本上每一个导入和内置的类(TextView,Button,Bundle,Context等)都不能解析为一个类型。我猜我有一些罐子搞乱了。我完全不了解他们,所以我很难把所有的罐子放在正确的位置,让我的项目工作。
在导入2个Android库之前我们的问题是如何成功地将这2个Android库成功地整合到我的主目录中项目,所以我可以整合排行榜。如果需要任何特定代码进行故障排除,请告诉我,我可以提供。我已经提供了3个截图,以显示我所有的罐子在3个项目中的每一个。
我遇到类似的问题, ,我发现它是相当准确的。
在将BaseGameUtils或Google Play Services Lib添加到项目之前,我建议您首先解决其中的错误。这是我做的:
1)我将Google Play服务库定义为图书馆项目(属性... Android ...检查是库)
2)我将Google Play Services Lib作为参考项目添加到BaseGameUtils
3)我还添加了ActionBarSherlock版本的支持库到BaseGameUtils的Build Path的库部分(如果你不使用ABS,那么你不需要这样做)
4)我清除BaseGameUtils,然后从BaseGameUtils中删除错误。
5)我将BaseGameUtils定义为库项目(属性... Android ...检查是库) 6)我然后将BaseGameUtils和Google Play Services Lib作为参考项目添加到我的项目中
为了我。根据具体情况,您现在可能会发现,您还有其他一些问题(例如项目中的不同版本的支持库),这些解决方案在SO中有详细记录。
$ b $祝你好运!
I am trying to set up my project in Eclipse to implement the new Android Play Services
. You can see in my below 3 screenshots that BibleTriviaLite
is my project and then BaseGameUtils
and google-play-services_lib
are the two projects that I imported in, made libraries and then made BibleTriviaLite
reference them.
Right now I have errors in every project. Basically every single import and built in class (TextView, Button, Bundle, Context, etc) all cannot be resolved to a type. I am guessing that I have my jars messed up somewhere. I never understood them fully so I am having a hard time trying to put all the jars in the correct spot and get my project working.
Before importing the 2 Android libraries (BaseGameUtils and google-play-services_lib), BibleTriviaLite was fully functional so I know the code works.
My question is how to successfully integrate these 2 Android libraries successfully into my main project so I can get on with integrating the leaderboards. If any specific code is needed in order to troubleshoot, let me know and I can provide. I have provided 3 screenshots below to show where all my jars are in each of the 3 projects.
I encountered similar problems and I followed the guide at https://github.com/playgameservices/android-samples/blob/master/README.md which I found to be reasonably accurate.
Before adding either BaseGameUtils or the Google Play Services Lib to your project, I suggest that you should first resolve the errors in them. This is what I did:
1) I defined the Google Play Services Lib as a library project (Properties ... Android ... check "Is Library")
2) I added the Google Play Services Lib as a reference project to BaseGameUtils
3) I also added the ActionBarSherlock version of the support library to the libraries section of the Build Path of BaseGameUtils (if you do not use ABS then you will not need to do this)
4) I cleaned BaseGameUtils and this then removed the errors from BaseGameUtils.
5) I defined BaseGameUtils as a library project (Properties ... Android ... check "Is Library")
6) I then added BaseGameUtils and the Google Play Services Lib as reference projects to my project
This worked for me. Depending on circumstances, You may find now find that you have some additional issues (e.g. different versions of the support lib in your project. The solutions to this are well-documented on SO).
Good Luck !
这篇关于Google Play Game Services排行榜 - 无法在Eclipse中正确设置jar的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!