2013-01-12 13 views
0

我想開發一個應用程序使用谷歌地圖,但不知道爲什麼它仍然給我的錯誤,我重新檢查我的清單文件似乎都沒問題。這裏是清單:錯誤與<uses-library android:name =「com.google.android.maps」/>

<?xml version="1.0" encoding="utf-8"?> 
    <manifest xmlns:android="http://schemas.android.com/apk/res/android" 
    package="com.example.interstars" 
    android:versionCode="1" 
    android:versionName="1.0" > 
    <uses-sdk 
    android:minSdkVersion="8" 
    android:targetSdkVersion="16" /> 
    <uses-permission android:name="android.permission.INTERNET"/> 
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/> 
    <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="com.example.interstars.InterMainActivity" 
     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> 

錯誤

2 08:47:06 - com.android.ide.eclipse.adt.internal.project.AndroidManifestHelper] Parser exception for C:\Users\uchman\Documents\Work place\InterStars\AndroidManifest.xml: Attribute name "uses-library" associated with an element type "application" must be followed by the ' = ' character. 

我缺少什麼樣的事情?我仍然是Android編程的初學者。

+3

請參閱thi鏈接http://stackoverflow.com/questions/3541061/androidmanifest-xml-unable-to-include-external-library –

+0

試過了,但它didn不工作 – uchman21

+0

如果有任何像android-support-v4添加庫? –

回答

4

感謝您的幫助.. 在強調自己太多之後,我決定使用GoogleMaps API V2。感謝https://developers.google.com/maps/documentation/android/中的教程,我能夠將Google地圖修復到我的應用。 P.S GoogleMaps API V2對於用戶和程序員來說都容易得多並且不需要使用庫。所有需要的是谷歌播放庫..

4

嘗試把

<uses-library android:name="com.google.android.maps"/> 

該行的所有活動標籤後和應用標籤

+0

我實際上是按照你所說的去做,但仍然沒有變化..我注意到我的R.java丟失了 – uchman21

+0

在AndroidManifest.XMl中有錯誤,所以你將無法構建你的項目,以至於R.java丟失。 –

0

結束之前,我不知道,但我都面臨着同樣的錯誤。一旦我開始的MapView。 我得到了周圍的工作方式是如下:

,如果您有複製和粘貼下面行

<uses-library android:name=」com.google.android.maps」 />

那麼引號(「」)得到了變成了不同的ASCII值引號字符。

您應該重新輸入引號字符。

Similar question

+0

他試過了,它已經回答了[這裏](http:// stackoverflow。com/questions/3541061/androidmanifest-xml-unable-to-include-external-library) – RobinHood

+0

@ Bhavesh.shastrinagar。 –

0

請試試這個:

  • 右鍵點擊你的項目,然後點擊 「Android的工具」
  • 點擊 「添加支持庫」,並直接添加庫

之後運行這個。

+0

謝謝。幫助減少了一點錯誤...但仍然給用戶庫錯誤.. – uchman21

1

試試這個:

<uses-library android:required="true" android:name="com.google.android.maps"></uses-library> 
<application 
    android:allowBackup="true" 
    android:icon="@drawable/ic_launcher" 
    android:label="@string/app_name" 
    android:theme="@style/AppTheme" > 

代碼的目標必須在谷歌API來設置,而不是Android的API。 您的項目文件夾 - >屬性 - > android - >在項目構建目標中選擇適用於您的API級別的Google API。

+0

謝謝,但它沒有工作......我甚至注意到,即使當我完全刪除使用庫線,它給了我關於使用庫的同樣的錯誤..我很強調! – uchman21

+0

@ user1971741嘗試更新sdk和其他工具,它可能會幫助你。 – Peter

+0

謝謝你的幫助 – uchman21