如何/错误地宣布谷歌播放的,服务组件 [英] How to/Error in declaring google-play-services-component

查看:214
本文介绍了如何/错误地宣布谷歌播放的,服务组件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的Eclipse /在Java ADT包,我试图让谷歌地图API的工作。

I am using eclipse/the Java ADT bundle and I am trying to get google maps api working.

引用文档中获得谷歌地图运行起来是建立谷歌播放SDK>引用库项目为月食

Referenced in the documentation to get google maps up and running is "setting up Google Play SDK" > "Referencing a library project for eclipse"

http://developer.android.com/tools/projects/projects-eclipse.html#ReferencingLibraryProject

在该页面的最下方,设置了项目属性后,它说,我需要在manifest文件中声明库组件

At the very bottom of that page, after setting up the project properties, it says that I need to "declare library components in the manifest file"

例如:

<manifest>
  ...
  <application>
    ...
    <activity android:name="com.example.android.tictactoe.library.GameActivity" />
    ...
  </application>
</manifest>

所以在我的Andr​​oid清单,我想这其中包括:

so in my android manifest, I tried including this:

   <activity android:name="com.example.android.MainActivity.library.google-play-services_lib" />
   <activity android:name="com.example.android.MainActivity.library.google-play-services" />

不过,包括在谷歌播放服务库的.jar有破折号的名称,并在日食这些虚线显示为错误(我得到的红色squigglies)。

However, the google play services library .jar has dashes included in its name, and in eclipse these dashes show up as errors (I get the red squigglies).

另外,我想包括这谷歌地图与谷歌的发挥SDK下载来了(在临时演员)示例项目,所以我不是100%肯定,如果我要做到这一步。

Also, I'm trying to include this in the google maps sample project that came with the google play sdk download (under "extras"), so I'm not 100% sure if I have to do this step.

我该如何解决这个问题?

How can I fix this?

推荐答案

https://docs.google.com/document/pub?id=19nQzvKP-CVLd7_VrpwnHfl-AE9fjbJySowONZZtNHzw

下面的快速指南,谷歌地图API第2版。我用这个在我的项目办公室。

here's quick guide to google maps api v2. I used this in my project at the office.

<一个href="http://stackoverflow.com/questions/13719263/unable-instantiate-android-gms-maps-mapfragment">Unable实例android.gms.maps.MapFragment

如果您有问题的MapFragment或谷歌播放服务,图书馆利用这个计算器线程来解决问题。

If you having problems with the MapFragment or google play services library use this stackoverflow thread to troubleshoot.

如果您遇到问题,让你的SHA1指纹这里的步骤。

If you having trouble with getting your SHA1 fingerprint here's the steps.

  1. 如果您使用的是Linux打开DOS命令行或终端。

  1. Open your DOS command line or terminal if you are using linux.

cd(更改目录)到Java的目录\ jdk1.7.0 \你的JDK 7,在我的情况的垃圾桶是C:\ Program Files文件\的Java \ jdk1.7.0 \ bin中。为了让人们更方便添加目录添加到系统路径。

cd (change directory) to the directory of Java\jdk1.7.0\bin of your JDK 7. In my case it is C:\Program Files\Java\jdk1.7.0\bin. To make it a lot easier add that directory to your system path.

执行你的java的密钥工具和使用您的调试密钥库或官方密钥库中。 (参考图像作为例子)。

Execute the keytool of your java and use your debugging keystore or official keystore. (refer to the image as example).

通常的语法,keytool.exe的-list -alias androiddebugkey -keystore[密钥库的目录]-storepass安卓-keypass机器人

Generally the syntax is, keytool.exe -list -alias androiddebugkey -keystore "[directory of your keystore]" -storepass android -keypass android

复制并粘贴SHA1指纹保持它,并用它来生成API控制台上的谷歌地图API密钥。它应该是API访问那么谷歌地图API V2。

copy and paste the SHA1 fingerprint keep it and use it to generate the google map api key on the api console. It should be on API access then Google Maps API V2.

在那里,你添加你的应用程序的软件包的名称与SHA1指纹。事情是这样的。

There you append the name of the package of your app in your SHA1 fingerprint. Something like this.

55:87:D6:B4:60:35:AD:CA:C8:86:84:7D:62:D2:5B:3D:18:34:EB:16;com.my.package

最后,你应该有你现在的precious地图API密钥,并按照快速和故障排除的链接,我贴。

Finally you should have now your precious map api key and follow the quick and troubleshooting links that I posted.

还有一件事JDK7默认情况下会产生SHA1,如果你将执行上面的命令。如果您使用的是JDK6它产生的MD5指纹。我认为你需要添加-v在命令的末尾,以便JDK6会给你SHA1。在我的情况在这里我有JDK7所以当我添加 - V它会告诉你不同的指纹

One more thing JDK7 by default produces SHA1 if you will execute the command above. If you are using JDK6 it produces MD5 fingerprint. I think you need to add -v at the end of the command so that JDK6 will give you SHA1. In my case here I have JDK7 so when I add - v it will show you different fingerprints.

玩得开心:D

这篇关于如何/错误地宣布谷歌播放的,服务组件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆