0
votes

I had Started building an app in android studio 4.0 on windows 7 64 bit .In that it doesn't show any error while writing code but when i start debugging the app in my real device it shows error that Aapt2.exe stopped working.can anyone guide to solve this problem?

Errors

Execution failed for task ':app:processDebugResources'.

Could not resolve all files for configuration ':app:debugRuntimeClasspath'. Failed to transform play-services-base-17.1.0.aar (com.google.android.gms:play-services-base:17.1.0) to match attributes {artifactType=android-compiled-dependencies-resources, org.gradle.status=release}. > Execution failed for AarResourcesCompilerTransform: C:\Users\Admin.gradle\caches\transforms-2\files-2.1\d92a27efcac738b4f280b9ad0c07bda7\jetified-play-services-base-17.1.0. > AAPT2 aapt2-4.1.1-6503028-windows Daemon #0: Unexpected error during compile 'C:\Users\Admin.gradle\caches\transforms-2\files-2.1\d92a27efcac738b4f280b9ad0c07bda7\jetified-play-services-base-17.1.0\res\drawable-xhdpi-v4\common_google_signin_btn_text_dark_normal_background.9.png', attempting to stop daemon. This should not happen under normal circumstances, please file an issue if it does. Failed to transform play-services-base-17.1.0.aar (com.google.android.gms:play-services-base:17.1.0) to match attributes {artifactType=android-compiled-dependencies-resources, org.gradle.status=release}. > Execution failed for AarResourcesCompilerTransform: C:\Users\Admin.gradle\caches\transforms-2\files-2.1\d92a27efcac738b4f280b9ad0c07bda7\jetified-play-services-base-17.1.0. > AAPT2 aapt2-4.1.1-6503028-windows Daemon #0: Unexpected error during compile 'C:\Users\Admin.gradle\caches\transforms-2\files-2.1\d92a27efcac738b4f280b9ad0c07bda7\jetified-play-services-base-17.1.0\res\drawable-xhdpi-v4\common_google_signin_btn_text_dark_normal_background.9.png', attempting to stop daemon. This should not happen under normal circumstances, please file an issue if it does. Failed to transform play-services-base-17.1.0.aar (com.google.android.gms:play-services-base:17.1.0) to match attributes {artifactType=android-compiled-dependencies-resources, org.gradle.status=release}. > Execution failed for AarResourcesCompilerTransform: C:\Users\Admin.gradle\caches\transforms-2\files-2.1\d92a27efcac738b4f280b9ad0c07bda7\jetified-play-services-base-17.1.0. > AAPT2 aapt2-4.1.1-6503028-windows Daemon #0: Unexpected error during compile 'C:\Users\Admin.gradle\caches\transforms-2\files-2.1\d92a27efcac738b4f280b9ad0c07bda7\jetified-play-services-base-17.1.0\res\drawable-xhdpi-v4\common_google_signin_btn_text_dark_normal_background.9.png', attempting to stop daemon. This should not happen under normal circumstances, please file an issue if it does. Failed to transform play-services-base-17.1.0.aar (com.google.android.gms:play-services-base:17.1.0) to match attributes {artifactType=android-compiled-dependencies-resources, org.gradle.status=release}. > Execution failed for AarResourcesCompilerTransform: C:\Users\Admin.gradle\caches\transforms-2\files-2.1\d92a27efcac738b4f280b9ad0c07bda7\jetified-play-services-base-17.1.0. > AAPT2 aapt2-4.1.1-6503028-windows Daemon #0: Unexpected error during compile 'C:\Users\Admin.gradle\caches\transforms-2\files-2.1\d92a27efcac738b4f280b9ad0c07bda7\jetified-play-services-base-17.1.0\res\drawable-xhdpi-v4\common_google_signin_btn_text_dark_normal_background.9.png', attempting to stop daemon. This should not happen under normal circumstances, please file an issue if it does.

And second error

AAPT2 process unexpectedly exit. Error output:

image of Aapt2 window

can anyone help?

2
common_google_signin_btn_text_dark_normal_background.9.png what is this error coming from here - Usama Altaf
i m beginner so i don't have knowledge about it but the error while showed by android studio i copy pasted it so above is what android studio showed me - AbhySalian
Check your drawable folder and for this or paste a github link or drive link where we can see your code and try to resolve - Usama Altaf
just create a authentication page - AbhySalian

2 Answers

0
votes

Okay paste this in your manifest file and check you call the theme out of Application

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

    <application
        android:allowBackup="true"
        android:icon="@mipmap/ic_launcher"
        android:label="@string/app_name"
        android:roundIcon="@mipmap/ic_launcher_round"
        android:supportsRtl="true"
        android:usesCleartextTraffic="true"
        tools:ignore="ExtraText"
        android:theme="@style/Theme.HowsApp">
        <activity android:name=".OTPActivity"></activity>
        <activity android:name=".PhoneNumberActivity">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

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

</manifest>
0
votes

This is due to the newer AAPT2 version (which comes with newer AGP) having a dependency on up-to-date Windows universal C runtime libraries. If you don't have them yet, download from Microsoft's website, if you already do - see if there's an update available (even if you have to do it manually). Microsoft is doing a gradual roll-out of the updates, but sometimes they take longer for certain systems/architectures.