繁体   English   中英

Android Google Maps ClassNotFoundException

[英]Android Google Maps ClassNotFoundException

我正在创建我的第一个谷歌地图应用程序,但我遇到了一些麻烦,我无法弄清楚原因。 我得到一个ClassNotFoundException。 我一般都是Android的新手,但这个错误令我难过。 这是我的清单。

<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>

这就是我的布局如何使用MapView。 我知道我的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" />

最后,这是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

编辑:对不起,清单没有完美复制。 是的,包装已经设定好了。 我的虚拟设备设置为Target:Google API(Google Inc.) - API Level 17。

如果您尝试在模拟器中运行它,则需要定义AVD,并将Target设置为Google APIs (Google Inc) - ...而不是Android nn - ...

问候。

只关闭项目并重新打开它。 修理它。

ORZ

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM