5

I use android.enableAapt2=false but, I have this problem.

The option 'android.enableAapt2' is deprecated and should not be used anymore. Use 'android.enableAapt2=true' to remove this warning. It will be removed at the end of 2018..

When I remove android.enableAapt2=false but, I have this problem.

AAPT2 error: check logs for details

All in my manifest page. Which I must edit part ?

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.nsc.apk.herb4health"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk
        android:minSdkVersion="19"
        android:targetSdkVersion="26" />

    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
    <uses-permission android:name="android.permission.READ_PHONE_STATE" />
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />

    <!-- Required by older versions of Google Play services to create GCM registration tokens -->
    <uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.WAKE_LOCK" />
    <uses-permission android:name="com.google.android.finsky.permission.BIND_GET_INSTALL_REFERRER_SERVICE" />

    <permission
        android:name="com.nsc.apk.herb4health.permission.C2D_MESSAGE"
        android:protectionLevel="signature" />

    <uses-permission android:name="com.nsc.apk.herb4health.permission.C2D_MESSAGE" />

    <application
        android:name="android.support.multidex.MultiDexApplication"
        android:allowBackup="true"
        android:debuggable="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:supportsRtl="true"
        android:theme="@style/AppTheme.NoActionBar" >
        <activity android:name="com.nsc.apk.herb4health.WelcomeActivity" >
            <action
                android:name="android.intent.action.MAIN"
                android:label="@string/app_name"
                android:theme="@style/AppTheme.NoActionBar" />

            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity android:name="com.nsc.apk.herb4health.MainActivity" />
        <!--
 ATTENTION: This was auto-generated to add Google Play services to your project for
     App Indexing.  See https://g.co/AppIndexing/AndroidStudio for more information.
        -->
        <meta-data
            android:name="com.google.android.gms.version"
            android:value="@integer/google_play_services_version" />

        <activity android:name="com.nsc.apk.herb4health.bodyhumenActivity" />
        <activity
            android:name="com.nsc.apk.herb4health.highest_score"
            android:label="@string/title_activity_highest_score"
            android:theme="@style/AppTheme.NoActionBar" />
        <activity android:name="com.nsc.apk.herb4health.quiz" />
        <activity android:name="com.nsc.apk.herb4health.Newlist" />
        <activity android:name="com.nsc.apk.herb4health.ShowDetail" />
        <activity android:name="com.nsc.apk.herb4health.ShowlistFirebase" />
        <activity android:name="com.nsc.apk.herb4health.FetchImageFirebase" />
        <activity android:name="com.nsc.apk.herb4health.FireApp" />
        <activity android:name="com.nsc.apk.herb4health.Cardview_main" />
        <activity android:name="com.nsc.apk.herb4health.CoverFlowMain" />
        <activity android:name="com.nsc.apk.herb4health.FoodDetail" />
        <activity android:name="com.nsc.apk.herb4health.ViewerActivity" />
        <activity android:name="com.nsc.apk.herb4health.act.ActivitySample" />
        <activity android:name="com.nsc.apk.herb4health.act.FragmentActivitySample" />
        <activity android:name="com.nsc.apk.herb4health.CardSwipeWithFragment" />
        <activity android:name="com.nsc.apk.herb4health.CardSwipeActivity" />
        <activity android:name="com.nsc.apk.herb4health.PuzzleActivity" />
        <activity android:name="com.nsc.apk.herb4health.DetailBody1" />
        <activity android:name="com.nsc.apk.herb4health.DetailBody2" />
        <activity android:name="com.nsc.apk.herb4health.quiz2" />
        <activity android:name="com.nsc.apk.herb4health.highest_score2" />
        <activity android:name="com.nsc.apk.herb4health.startScreen" />
        <activity android:name="com.nsc.apk.herb4health.Main_Connected_Game" />
        <activity android:name="com.nsc.apk.herb4health.detail_body3" />
        <activity android:name="com.nsc.apk.herb4health.Detail_body4" />
        <activity android:name="com.nsc.apk.herb4health.Detail_Body5" />
        <activity android:name="com.nsc.apk.herb4health.Detail_body6" />
        <activity android:name="com.nsc.apk.herb4health.Detail_body7" />
        <activity android:name="com.nsc.apk.herb4health.Body_Detail8" />
        <activity android:name="com.nsc.apk.herb4health.Detail_body9" />
        <activity android:name="com.nsc.apk.herb4health.Detai_body10" />
        <activity android:name="com.nsc.apk.herb4health.Detail_Body11" />
        <activity android:name="com.nsc.apk.herb4health.Detail_Body12" />
        <activity android:name="com.nsc.apk.herb4health.Detail_body13" />
        <activity android:name="com.nsc.apk.herb4health.Detail_body14" />
        <activity android:name="com.nsc.apk.herb4health.Detail_body15" />
        <activity android:name="com.nsc.apk.herb4health.Detail_body16" />
        <activity android:name="com.nsc.apk.herb4health.Detail_body17" />
        <activity android:name="com.nsc.apk.herb4health.Detail_body18" />
        <activity
            android:name="com.karumi.dexter.DexterActivity"
            android:launchMode="singleTask"
            android:theme="@style/Theme.Transparent" />

        <meta-data
            android:name="android.support.VERSION"
            android:value="26.1.0" />
        <!--
             FirebaseMessagingService performs security checks at runtime,
             no need for explicit permissions despite exported="true"
        -->
        <service
            android:name="com.google.firebase.messaging.FirebaseMessagingService"
            android:exported="true" >
            <intent-filter android:priority="-500" >
                <action android:name="com.google.firebase.MESSAGING_EVENT" />
            </intent-filter>
        </service>

        <activity
            android:name="com.google.firebase.auth.internal.FederatedSignInActivity"
            android:excludeFromRecents="true"
            android:exported="true"
            android:launchMode="singleInstance"
            android:permission="com.google.firebase.auth.api.gms.permission.LAUNCH_FEDERATED_SIGN_IN"
            android:theme="@android:style/Theme.Translucent.NoTitleBar" />

        <receiver
            android:name="com.google.android.gms.measurement.AppMeasurementReceiver"
            android:enabled="true"
            android:exported="false" >
        </receiver>
        <receiver
            android:name="com.google.android.gms.measurement.AppMeasurementInstallReferrerReceiver"
            android:enabled="true"
            android:exported="true"
            android:permission="android.permission.INSTALL_PACKAGES" >
            <intent-filter>
                <action android:name="com.android.vending.INSTALL_REFERRER" />
            </intent-filter>
        </receiver>

        <service
            android:name="com.google.android.gms.measurement.AppMeasurementService"
            android:enabled="true"
            android:exported="false" />
        <service
            android:name="com.google.android.gms.measurement.AppMeasurementJobService"
            android:enabled="true"
            android:exported="false"
            android:permission="android.permission.BIND_JOB_SERVICE" />

        <receiver
            android:name="com.google.firebase.iid.FirebaseInstanceIdReceiver"
            android:exported="true"
            android:permission="com.google.android.c2dm.permission.SEND" >
            <intent-filter>
                <action android:name="com.google.android.c2dm.intent.RECEIVE" />

                <category android:name="com.nsc.apk.herb4health" />
            </intent-filter>
        </receiver>
        <!--
             FirebaseInstanceIdService performs security checks at runtime,
             no need for explicit permissions despite exported="true"
        -->
        <service
            android:name="com.google.firebase.iid.FirebaseInstanceIdService"
            android:exported="true" >
            <intent-filter android:priority="-500" >
                <action android:name="com.google.firebase.INSTANCE_ID_EVENT" />
            </intent-filter>
        </service>

        <provider
            android:name="com.google.firebase.provider.FirebaseInitProvider"
            android:authorities="com.nsc.apk.herb4health.firebaseinitprovider"
            android:exported="false"
            android:initOrder="100" />

        <activity
            android:name="com.google.android.gms.common.api.GoogleApiActivity"
            android:exported="false"
            android:theme="@android:style/Theme.Translucent.NoTitleBar" />
    </application>

</manifest>
Non Sensei
  • 67
  • 1
  • 6
  • You have issues in your manifest. AAPT2 is more strict about those than the previous version. You need to fix your manifest before it'll let you build successfully. – Mike M. Apr 20 '18 at 08:59
  • 2
    Please don't post code/error messages/manifests etc. as screen-shots: they're sometimes blocked, harder to read, can't be searched and can't be copied. Instead, paste the text formatted in a code-block. – TripeHound Apr 20 '18 at 09:28
  • Post the content of your AndroidManifest as well as the full build log when you use android.enableAapt2=true – Izabela Orlowska Apr 20 '18 at 14:30
  • This's first time for my post. Thank for recommend. @TripeHound – Non Sensei Apr 21 '18 at 06:53
  • error: unknown element found. Message{kind=ERROR, text=error: unknown element "found., sources=[F:\backup\Herb-master\Herb-master\app\build\intermediates\manifests\full\debug\AndroidManifest.xml:37], original message=, tool name=Optional.of(AAPT)} " @IzabelaOrlowska – Non Sensei Apr 21 '18 at 07:10
  • You have at least one `` element outside of an ``. The only places you should have `` elements is inside `` elements. I can't be very specific, but I can see the start of a misplaced `` tag in your screenshot, right below the opening `` tag for `WelcomeActivity`. – Mike M. Apr 21 '18 at 07:18
  • I edit my question ,You can read my code again. @MikeM. – Non Sensei Apr 21 '18 at 08:45
  • Remove the `` element I mentioned in my previous comment; the one right after the ``. – Mike M. Apr 21 '18 at 08:51
  • Now I do follow you, I can't build my Project. You can edit my code and, You send to my email. --> jareansong@gmail.com Thank you so mush @MikeM. – Non Sensei Apr 21 '18 at 09:23
  • I don't understand what you're saying. If you've removed the `` element I specified, but you're getting additional build errors, then you'll need to address them one by one. I have no idea what your issues are beyond the single error you posted in your comment above. – Mike M. Apr 21 '18 at 09:33
  • OK,I will try to solve it step by step. @MikeM. – Non Sensei Apr 21 '18 at 10:19
  • I successfully , thank you for answer @MikeM. – Non Sensei Apr 21 '18 at 12:36

0 Answers0