Ho un problema quando sto cercando di utilizzare Google Play Services nella mia app. Ho seguito questo tutorial https://developers.google.com/maps/documentation/android/start ma ho un errore dopo che ho messo questa linea nella mia AndroidManifest.xml:Android: elemento di livello superiore non completato in AndroidManifest.xml
<meta-data
android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version" />
su Android: linea di nome, l'errore è: "elemento di livello superiore non è completato, valido documento XML deve avere un tag radice ". Ma il mio file XML è valido senza la linea dei meta-dati.
mio AndroidManifest.xml comincia così:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.objectifmultimedia.chasseursbn">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<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" >
<meta-data
android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version" />
<activity
android:name=".MainActivity"
android:label="@string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".TutorielActivity"
android:label="@string/title_activity_tutoriel" >
</activity>
<activity
android:name=".Departements.DepartementActivity"
android:label="@string/title_activity_departement" >
</activity>
<activity
android:name=".Departements.DepartementActualitesActivity"
android:label="@string/title_activity_departement_actualites" >
</activity>
<activity
android:name=".Departements.DepartementPermisDeChasserActivity"
android:label="@string/title_activity_departement_permis_de_chasser" >
</activity>
<activity
android:name=".Departements.DepartementDatesOuverturesActivity"
android:label="@string/title_activity_departement_dates_ouvertures" >
</activity>
<activity
android:name=".Departements.DepartementEspacePersonnelActivity"
android:label="@string/title_activity_departement_espace_personnel" >
</activity>
<activity
android:name=".Departements.DepartementAnnuairesActivity"
android:label="@string/title_activity_departement_annuaires" >
</activity>
<activity
android:name=".Departements.DepartementMeteoEphemerideActivity"
android:label="@string/title_activity_departement_meteo_ephemeride" >
</activity>
<activity
android:name=".Departements.DepartementCommunesLimitrophesActivity"
android:label="@string/title_activity_departement_communes_limitrophes" >
</activity>
<activity
android:name=".Aide.AideActivity"
android:label="@string/title_activity_aide" >
</activity>
<activity
android:name=".PendantMaChasse.PendantMaChasseActivity"
android:label="@string/title_activity_pendant_ma_chasse" >
</activity>
<activity
android:name=".Departements.DepartementActualitesDetailActivity"
android:label="@string/title_activity_departement_actualites_detail" >
</activity>
<activity
android:name=".Departements.DepartementDatesOuverturesDetailActivity"
android:label="@string/title_activity_departement_dates_ouvertures_detail" >
</activity>
<activity
android:name=".PendantMaChasse.PendantMaChasseMapActivity"
android:label="@string/title_activity_pendant_ma_chasse_map"
android:theme="@android:style/Theme.NoTitleBar">
</activity>
<activity
android:name=".PendantMaChasse.PendantMaChasseDatesActivity"
android:label="@string/title_activity_pendant_ma_chasse_dates" >
</activity>
</application>
</manifest>
Grazie. Yann
dove esattamente si fa ad aggiungere in palese? –
L'errore indica che il tuo 'meta-tag' manca il tag principale che lo racchiude. Forse hai dimenticato di definire il tag principale? – ChuongPham
Ho appena aggiunto il mio file nel mio post. ;) –