使用 Google 地图
我正在尝试使用 Google 地图开发一个应用程序,但无法让该应用程序运行。我已经完成了“MapView”示例代码教程中描述的所有操作,包括获取与“debug.keystore”文件的 MD5 签名关联的映射密钥,但模拟器明确表示应用程序已意外停止。
当我尝试处理 setContentView
代码行时,会出现此错误消息。
我不确定必须做什么的唯一一点是关于我的应用程序的签名:据我了解应用程序的签名过程,在调试模式下,没有什么可做的。正确吗?
我使用 Netbeans IDE 使用 Java 进行开发。
感谢您花时间尝试帮助我。
I'm trying to develop an application using Google's maps and I can't get this application to work. I have done all what is described in the tutorial of the "MapView" sample code, including getting a map key associated to the MD5 signature of my "debug.keystore" file but the emulator definitively says that the application has stopped unexpectedly.
This error message appears when I try to process the setContentView
line of code.
The only point where I am not sure of doing what must be done is about the signature of my application : as far as I have understood the signing process of an application, in debug mode, there is nothing to do. Is it correct?
I develop in Java using the Netbeans IDE.
Thanks for the time you will spend trying to help me.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
首先,我强烈建议您切换到 Eclipse,其中提供了官方 Android 插件,它实际上会为您提供 LogCat(即手机端控制台),并且当出现问题时您将始终知道出了什么问题。我不太确定 NetBeans 插件是否同样有效。
其次,关于你的崩溃,它与 API 密钥无关(如果密钥错误,你会看到一个空地图)。我想到的有两件事:
“Google API”,而不是普通的“Android”,
因此请确保您的项目使用的库是“Google API”(所需版本,我会坚持使用 2.1 或 2.2)并且清单文件中有这一行
除此之外,如果能看到一些 100% 确定的堆栈跟踪,那就太棒了。
First off, I'd recommend you very much to switch to Eclipse where the official Android plugin is available which will actually give you the LogCat (that's phone-side console) and you will always know what's wrong when something doesn't work. I'm not so sure that the plugin for NetBeans works equally well.
Secondly, regarding your crash, it has nothing to do with the API Key (if the key was wrong, you would see an empty map). Two things here from the top of my mind:
"Google APIs", not vanilla "Android"
So make sure that the library used with your project is "Google APIs" (of desired version, I'd stick with 2.1 or 2.2) and that there's this line in the Manifest file
Other than that, would be awesome to see some stack trace to be 100% sure.