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