Error while trying to generate a signed APK

Asked

Viewed 1,381 times

1

Error while trying to generate a signed APK. I have already managed the Keystore, passwords, alias, etc.

Error:(32) Error: The element must be a direct Child of the root element [Wrongmanifestparent] element should be defined as a direct Child of the tag, not the tag or an tag. Similarly, a tag must be declared at the root level, and so on. This check looks for incorrect declaration Locations in the manifest, and complains if an element is found in the Wrong place. http://developer.android.com/guide/topics/manifest/manifest-intro.html 1 errors, 0 warnings Error:Execution failed for task ':app:lintVitalRelease'.

Lint found fatal errors while assembling a release target. To proceed, either fix the issues identified by lint, or Modify your build script as Follows: ... android { lintOptions { checkReleaseBuilds // Or, if you prefer, you can continue to check for errors in release builds, // but continue the build Even when errors are found: abortOnError false } } ...

Manifest:

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

    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.SEND_SMS" />
    <uses-permission android:name="android.permission.RECEIVE_SMS" />
    <uses-permission android:name="android.permission.READ_CONTACTS" />
    <uses-permission android:name="android.permission.READ_PROFILE" />
    <!-- Allows the API to use the Global Positioning System (GPS) to determine the device's location to within a very small area. -->
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
    <!-- Allows the API to use WiFi or mobile cell data (or both) to determine the device's location. -->
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />

    <application
        android:name=".util.ApplicationUtils"
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:supportsRtl="true"
        android:theme="@style/AppTheme.NoActionBar">

        <!-- Google Play Services -->
        <meta-data
            android:name="com.google.android.gms.version"
            android:value="@integer/google_play_services_version" />

        <!-- Maps V2 -->
        <uses-feature
            android:glEsVersion="0x00020000"
            android:required="true" />

        <!--
         API Key (Coloque a sua aqui)
         https://console.developers.google.com
        -->
        <!--
             <meta-data
            android:name="com.google.android.maps.v2.API_KEY"
            android:value="AIzaSyC2TrJso03M7qRrBm7GnWvq_Y_0jaL5N40" />
        -->

        <meta-data
            android:name="com.google.android.geo.API_KEY"
            android:value="AIzaSyCwtsvnPsAmjnjGh9qejAgzaU4R6_uvoX8"/>

        <!-- botão de login facebook -->
        <meta-data
            android:name="com.facebook.sdk.ApplicationId"
            android:value="@string/facebook_app_id" />
        <!-- Main activity -->
        <activity
            android:name=".activity.MainActivity"
            android:screenOrientation="portrait" />

        <activity
            android:name=".activity.LoginActivity"
            android:label="@string/app_name"
            android:screenOrientation="portrait"
            android:configChanges="keyboardHidden|orientation|screenSize"
            android:windowSoftInputMode="stateHidden">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

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

        <!-- Facebook activity -->
        <activity
            android:name="com.facebook.FacebookActivity"
            android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation"
            android:label="@string/app_name"
            android:screenOrientation="portrait"
            android:theme="@android:style/Theme.Translucent.NoTitleBar" />

        <activity
            android:name=".activity.BaseActivity"
            android:screenOrientation="portrait" />

        <!-- Keeper activity -->
        <activity
            android:name=".activity.ContatoActivity"
            android:screenOrientation="portrait" />

        <!-- Registrar activity -->
        <activity
            android:name=".activity.RegistrarActivity"
            android:screenOrientation="portrait"
            android:theme="@style/AppTheme.NoActionBar">
        </activity>

        <!-- Rota activity -->
        <activity
            android:name=".activity.AcomActivity"
            android:parentActivityName=".activity.MainActivity"
            android:screenOrientation="portrait"
            android:theme="@style/AppTheme.NoActionBar">
            <meta-data
                android:name="android.support.PARENT_ACTIVITY"
                android:value=".activity.MainActivity" />
        </activity>

        <!-- Map activity -->
        <activity
            android:name=".activity.MaActivity"
            android:screenOrientation="portrait"
            android:theme="@style/AppTheme.NoActionBar">
        </activity>

        <!-- Prevenção activity -->
        <activity
            android:name=".activity.PrevActivity"
            android:screenOrientation="portrait"
            android:theme="@style/AppTheme.NoActionBar" >
        </activity>
    </application>

</manifest>
  • Henry, I believe the problem may be the tag <uses-feature> be inside <application> instead of being the direct daughter of <manifest>, but I’m not sure...

  • @Wakim I solved this way by removing her from the application. I did not have time to post. If you want to put as a response, I mark.

1 answer

3


In this case, the correct one would be to remove the tag <uses-feature> from within <application> and put as child straight from the tag <manifest>.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.