execution failed for task 'transformclasseswithdexfordebug'

2
  

Error 1   : This happens to me when I execute my project.

    Error:Execution failed for task ':app:processDebugManifest'.
> com.android.manifmerger.ManifestMerger2$MergeFailureException: org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 2; El marcador en el documento que precede al elemento raíz debe tener el formato correcto.

  

Error 2 will not let me create activitys

  

Manifest

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="desarrolladoresalpha.hassmovil">

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.READ_LOGS" />

<application
    android:name=".Variables_HassMovil"
    android:allowBackup="true"
    android:icon="@mipmap/logotipo"
    android:label="@string/app_name"
    android:supportsRtl="true"
    android:theme="@style/AppTheme">
    <activity
        android:name=".Precarga_HassMovil"
        android:theme="@style/Theme.AppCompat.DayNight.NoActionBar">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>

    <activity
        android:name=".Inicio_HassMovil"
        android:label="@string/title_activity_inicio__hass_movil"
        android:theme="@style/AppTheme.NoActionBar"/>

    <activity
        android:name=".Calibracion_HassMovil"
        android:label="Calcular Precio"
        android:parentActivityName=".Cortes_Registro">
        <meta-data
            android:name="android.support.PARENT_ACTIVITY"
            android:value="desarrolladoresalpha.hassmovil.Cortes_Registro" />
    </activity>
    <activity
        android:name=".Cortes_Registro"
        android:label="Registrar Corte"
        android:parentActivityName=".Inicio_HassMovil">
        <meta-data
            android:name="android.support.PARENT_ACTIVITY"
            android:value="desarrolladoresalpha.hassmovil.Inicio_HassMovil" />
    </activity>
    <activity
        android:name=".Cortes_Seleccion"
        android:parentActivityName=".Inicio_HassMovil">
        <meta-data
            android:name="android.support.PARENT_ACTIVITY"
            android:value="desarrolladoresalpha.hassmovil.Inicio_HassMovil" />
    </activity>
    <activity
        android:name=".Cortes_Confirmar"
        android:label="Confirmar Corte"
        android:parentActivityName=".Cortes_Seleccion">
        <meta-data
            android:name="android.support.PARENT_ACTIVITY"
            android:value="desarrolladoresalpha.hassmovil.Cortes_Seleccion" />
    </activity>
    <activity
        android:name=".Cortes_Descripcion"
        android:label="Descripcion"
        android:parentActivityName=".Cortes_Registro">
        <meta-data
            android:name="android.support.PARENT_ACTIVITY"
            android:value="desarrolladoresalpha.hassmovil.Cortes_Registro" />
    </activity>
    <activity
        android:name=".Precios_Configurar"
        android:label="Precios Generales"
        android:parentActivityName=".Inicio_HassMovil">
        <meta-data
            android:name="android.support.PARENT_ACTIVITY"
            android:value="desarrolladoresalpha.hassmovil.Inicio_HassMovil" />
    </activity>
    <activity
        android:name=".Empaques_Registrar"
        android:label="Nuevo Empaque"
        android:parentActivityName=".Empaques_Listado">
        <meta-data
            android:name="android.support.PARENT_ACTIVITY"
            android:value="desarrolladoresalpha.hassmovil.Empaques_Listado" />
    </activity>
    <activity
        android:name=".Empaques_Listado"
        android:label="Empaques"
        android:parentActivityName=".Inicio_HassMovil">
        <meta-data
            android:name="android.support.PARENT_ACTIVITY"
            android:value="desarrolladoresalpha.hassmovil.Inicio_HassMovil" />
    </activity>
    <activity
        android:name=".Precios_Empaques"
        android:label="Precio por empaque"
        android:parentActivityName=".Inicio_HassMovil">
        <meta-data
            android:name="android.support.PARENT_ACTIVITY"
            android:value="desarrolladoresalpha.hassmovil.Inicio_HassMovil" />
    </activity>
    <!--
         The API key for Google Maps-based APIs is defined as a string resource.
         (See the file "res/values/google_maps_api.xml").
         Note that the API key is linked to the encryption key used to sign the APK.
         You need a different API key for each encryption key, including the release key that is used to
         sign the APK for publishing.
         You can define the keys for the debug and release targets in src/debug/ and src/release/. 
    -->
    <meta-data
        android:name="com.google.android.geo.API_KEY"
        android:value="@string/google_maps_key" />

    <activity
        android:name=".Dispositivos_Localizacion"
        android:label="Localización"
        android:parentActivityName=".Cortes_Seleccion">
        <meta-data
            android:name="android.support.PARENT_ACTIVITY"
            android:value="desarrolladoresalpha.hassmovil.Cortes_Seleccion" />
    </activity>
</application>

    
asked by DoubleM 13.03.2017 в 18:00
source

1 answer

1
  

The bookmark in the document that precedes the root element must have the   correct format.

You have a problem in the AndroidManifest.xml, reviewing the content you can not see at a glance a problem in the formation of the .xml, I suggest you review and ensure the first line of your file is:

<?xml version="1.0" encoding="utf-8"?> 

also the error indicates line 1, column 2, ensures that the line is justified to the left, in that space you could have a non-printable character.

since it is very common to have a space and cause problems to build the project.

If your AndroidManifest.xml is fixed you will surely need,

Build > Rebuild Project

with this it will work without problems.

    
answered by 13.03.2017 в 19:10