Google 地图未出现在我的 MapActivity 中
我使用 Eclipse IDE 创建了一个发布密钥库。我使用 keytool 对其进行签名并在 Google 地图上注册。我插入了钥匙,但我的地图没有显示。
Maps show up properly when I use the key associated with my debug keystore.
我该如何诊断这个问题?我按照与调试相同的步骤进行发布。
更新:
这是我的清单文件:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.android.cancertrials" android:versionCode="1"
android:versionName="1.0">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.CALL_PHONE"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<application android:icon="@drawable/icon" android:label="@string/app_name" android:debuggable="true">
<activity android:label="@string/app_name" android:name="splash">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".HomeActivity" android:label="@string/app_name" android:windowSoftInputMode="stateHidden">
</activity>
<activity android:name=".moreactivity" android:label="@string/app_name">
</activity>
<activity android:name=".aboutmedtrust" android:label="@string/app_name">
</activity>
<activity android:name=".aboutclinical" android:label="@string/app_name">
</activity>
<activity android:name=".aboutglaxosmith" android:label="@string/app_name">
</activity>
<activity android:name=".termsofuse" android:label="@string/app_name">
</activity>
<activity android:name=".privacy" android:label="@string/app_name">
</activity>
<activity android:name=".feedback" android:label="@string/app_name">
</activity>
<activity android:name=".informationcancer" android:label="@string/app_name">
</activity>
<activity android:name="AdvanceSearchActivity" android:label="@string/app_name">
</activity>
<activity android:name="SearchingActivity"></activity>
<activity android:name="AdvanceSearchTab1"></activity>
<activity android:name="AdvanceSearchTab2"></activity>
<activity android:name="DetailedActivity"></activity>
<activity android:name="summary"></activity>
<activity android:name="conditions"></activity>
<activity android:name="description"></activity>
<activity android:name="inclusion"></activity>
<activity android:name="exclusion"></activity>
<activity android:name="BookmarkActivity"></activity>
<activity android:name="RecentActivity"></activity>
<activity android:name="information"></activity>
<uses-library android:name="com.google.android.maps"></uses-library>
<activity android:name="Mapsactivity">
</activity>
<activity android:name="mapView"></activity>
</application>
<uses-sdk android:minSdkVersion="3" />
</manifest>
I have created a release keystore using the Eclipse IDE. I signed it using keytool and registered on Google Maps. I plugged in the key but my map doesn't show up.
Maps show up properly when I use the key associated with my debug keystore.
How can I diagnose this? I followed the same steps as i did with debug, for release.
UPDATE:
Here is my manifest file:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.android.cancertrials" android:versionCode="1"
android:versionName="1.0">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.CALL_PHONE"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<application android:icon="@drawable/icon" android:label="@string/app_name" android:debuggable="true">
<activity android:label="@string/app_name" android:name="splash">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".HomeActivity" android:label="@string/app_name" android:windowSoftInputMode="stateHidden">
</activity>
<activity android:name=".moreactivity" android:label="@string/app_name">
</activity>
<activity android:name=".aboutmedtrust" android:label="@string/app_name">
</activity>
<activity android:name=".aboutclinical" android:label="@string/app_name">
</activity>
<activity android:name=".aboutglaxosmith" android:label="@string/app_name">
</activity>
<activity android:name=".termsofuse" android:label="@string/app_name">
</activity>
<activity android:name=".privacy" android:label="@string/app_name">
</activity>
<activity android:name=".feedback" android:label="@string/app_name">
</activity>
<activity android:name=".informationcancer" android:label="@string/app_name">
</activity>
<activity android:name="AdvanceSearchActivity" android:label="@string/app_name">
</activity>
<activity android:name="SearchingActivity"></activity>
<activity android:name="AdvanceSearchTab1"></activity>
<activity android:name="AdvanceSearchTab2"></activity>
<activity android:name="DetailedActivity"></activity>
<activity android:name="summary"></activity>
<activity android:name="conditions"></activity>
<activity android:name="description"></activity>
<activity android:name="inclusion"></activity>
<activity android:name="exclusion"></activity>
<activity android:name="BookmarkActivity"></activity>
<activity android:name="RecentActivity"></activity>
<activity android:name="information"></activity>
<uses-library android:name="com.google.android.maps"></uses-library>
<activity android:name="Mapsactivity">
</activity>
<activity android:name="mapView"></activity>
</application>
<uses-sdk android:minSdkVersion="3" />
</manifest>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
你添加了互联网权限吗?这个问题几乎每天都会被问到。
Did you add the internet permission? This question is asked literally every day.
当您的指纹发生变化时,您必须在使用发布密钥存储进行签名时获取单独的 API 密钥。
确保还安装使用正确密钥签名的 .apk。
更新:我的意思是您确定使用正确的密钥签署 APK 吗?这意味着您确定在生成 APK 时使用发布密钥库对其进行签名吗?
当您导出它时,您实际上是否真的选择了用于签名的密钥库?
You have to obtain a separate API key when signing with the release key store as your fingerprint changes.
Make sure to also install the .apk signed with the right key.
Update: What I meant is are you sure you sign your APK with the right key? That means are you sure you sign it with the release keystore when generating the APK?
When you are exporting it, are you actually really selecting the keystore with which to sign it?
因此,我昨天自己遇到了这个问题,我通过手动签署 .apk 解决了这个问题。
我假设您正在使用您的私有密钥库,并且您已在地图视图(以及其他资源,根据需要)中输入了发布地图密钥。
为此,您从 Eclipse 的项目资源管理器中选择您的项目(右键单击)-> Android 工具 ->导出未签名的包。将其保存在您喜欢的地方。
打开你的终端(我在 Windows 7 机器上),cd 进入你的 jdk 文件夹(不是 jre),进一步 cd 进入 bin\ 。
使用以下命令:(请注意,如果您键入路径,则需要“)
要验证签名过程
(如果需要,您可以保留详细选项)。它会(希望)显示jar已验证(最终它会警告您关于没有经过验证的证书链的条目,这在我的情况下并不重要)
然后运行 zipalign:
请注意,它将创建一个新的 apk,该 apk 符合 google 标准,
安装该 apk 后您的地图应该可以正常显示
:
http://developer.android.com/tools/publishing/app-signing .html#ExportWizard
So I encountered this problem myself yesterday and I resolved by manually signing the .apk
I assume you are using your private keystore and you have entered the release map key in your mapview (and other resources, as needed).
In order to do, you choose your projekt from Eclipse's project explorer (right click) -> Android Tools -> Export unsigned package. Save it where ever you like.
Open your terminal (I'm on a Windows 7 machine), cd into your jdk folder (NOT jre), cd further into bin\ .
Use following command: (Note that the " are required if you type a path)
To verify the signing process do
(You can leave the verbose option out if you want). It will (hopefully) show jar verified (eventually it will warn you about entries without a validated certificate chain, that didnt matter in my case)
Then run zipalign:
Note that it will create a new apk, which is aligned to googles standards.
Install that apk and your maps should show up fine!
From:
http://developer.android.com/tools/publishing/app-signing.html#ExportWizard