[英]Android Google Maps ClassNotFoundException
I'm creating my first Google Maps app, but I've run into some trouble and I can't figure out why. 我正在创建我的第一个谷歌地图应用程序,但我遇到了一些麻烦,我无法弄清楚原因。 I'm getting a ClassNotFoundException.
我得到一个ClassNotFoundException。 I'm new to Android in general, but this error has me stumped.
我一般都是Android的新手,但这个错误令我难过。 Here's my manifest.
这是我的清单。
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="edu.purdue.cs.cs180.safewalk"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="17" />
<uses-permission android:name="android.permission.INTERNET" />
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<uses-library android:name="com.google.android.maps" />
<activity
android:name=".RequestActivity"
android:configChanges="orientation|keyboardHidden|screenSize"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
And here's how my layout uses the MapView. 这就是我的布局如何使用MapView。 I know that my API key is correct.
我知道我的API密钥是正确的。
<com.google.android.maps.MapView
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/mapview"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:clickable="true"
android:apiKey="@string/mapskey" />
Finally, here's the error from the logcat. 最后,这是logcat的错误。
12-03 13:11:25.861: E/AndroidRuntime(940): Caused by: java.lang.ClassNotFoundException: Didn't find class "edu.purdue.cs.cs180.safewalk.RequestActivity" on path: /system/framework/com.google.android.maps.jar:/data/app/edu.purdue.cs.cs180.safewalk-2.apk
Edit: Sorry, the manifest didn't copy over perfectly. 编辑:对不起,清单没有完美复制。 Yes, the package has been set.
是的,包装已经设定好了。 And my virtual device is set with Target: Google APIs (Google Inc.) - API Level 17.
我的虚拟设备设置为Target:Google API(Google Inc.) - API Level 17。
If you are trying to run it in the emulator, you need to define you AVD with Target set to Google APIs (Google Inc) - ...
and not Android nn - ...
. 如果您尝试在模拟器中运行它,则需要定义AVD,并将Target设置为
Google APIs (Google Inc) - ...
而不是Android nn - ...
Regards. 问候。
Only close the project and reopen it. 只关闭项目并重新打开它。 Fix it.
修理它。
Orz ORZ
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.