9

I am getting these errors:

Error:resource drawable/abc_ic_ab_back_mtrl_am_alpha (aka com.instacoin:drawable/abc_ic_ab_back_mtrl_am_alpha) not found.

Error:failed linking file resources.

Error:java.util.concurrent.ExecutionException: java.util.concurrent.ExecutionException: com.android.tools.aapt2.Aapt2Exception: AAPT2 error: check logs for details

Error:Execution failed for task ':app:processDebugResources'. Failed to execute aapt

This is my AndroidManifest:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.instacoin"
android:versionCode="11"
android:versionName="7.3" >

<uses-sdk
    android:minSdkVersion="15"
    android:targetSdkVersion="23" />

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.USE_CREDENTIALS" />
<uses-permission android:name="android.permission.GET_TASKS" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>

<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
<!-- Below is optional -->
<uses-permission android:name="com.android.launcher.permission.INSTALL_SHORTCUT" />

<permission
    android:name="com.instacoin.permission.C2D_MESSAGE"
    android:protectionLevel="signature" />

<application
    android:allowBackup="true"
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:largeHeap="true"
    android:theme="@style/AppTheme"
    android:name="com.instacoin.MyApplication"
    android:windowSoftInputMode="stateAlwaysHidden">
    <activity android:name="com.chartboost.sdk.CBImpressionActivity"
        android:excludeFromRecents="true"
        android:hardwareAccelerated="true"
        android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen"
        android:configChanges="keyboardHidden|orientation|screenSize" />

    <meta-data android:name="applovin.sdk.key"
        android:value="@string/applovin_sdk_key"  />
    <meta-data android:name="com.revmob.app.id" android:value="@string/revmob_media_id"/>

    <activity android:name="com.revmob.FullscreenActivity"
        android:theme="@android:style/Theme.Translucent"
        android:configChanges="keyboardHidden|orientation">
    </activity>
    <activity android:name="com.applovin.adview.AppLovinInterstitialActivity" />
    <activity android:name="com.applovin.adview.AppLovinConfirmationActivity" />
    <activity
        android:name="com.instacoin.ActivitySplashScreen"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
    <activity
        android:name="com.instacoin.ActivityLogin"
        android:label="@string/title_screen_sign_in"
        android:theme="@style/AppTheme"
        android:windowSoftInputMode="stateAlwaysHidden" >
    </activity>
    <activity
        android:name="com.instacoin.ActivityRegister"
        android:label="@string/title_screen_sign_up"
        android:screenOrientation="portrait"
        android:theme="@style/AppTheme"
        android:windowSoftInputMode="stateAlwaysHidden" >
    </activity>
    <activity
        android:name="com.instacoin.ActivityMainWallet"
        android:clearTaskOnLaunch="true"
        android:label="@string/app_name"
        android:launchMode="singleTask"
        android:screenOrientation="portrait"
        android:theme="@style/AppTheme"
        android:windowSoftInputMode="stateAlwaysHidden" >
    </activity>
   <!-- <activity
        android:name="com.facebook.LoginActivity"
        android:theme="@style/AppTheme"/>-->
    <activity android:name="com.facebook.FacebookActivity"
        android:theme="@android:style/Theme.Translucent.NoTitleBar"
        android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation"
        android:label="@string/app_name"
        tools:replace="android:theme" />

    <meta-data
        android:name="com.facebook.sdk.ApplicationId"
        android:value="@string/sdk_facebook_app_id" />

    <receiver
        android:name="com.google.android.gcm.GCMBroadcastReceiver"
        android:permission="com.google.android.c2dm.permission.SEND" >
        <intent-filter>
            <action android:name="com.google.android.c2dm.intent.RECEIVE" />
            <action android:name="com.google.android.c2dm.intent.REGISTRATION" />

            <category android:name="com.sensiblewallet" />
        </intent-filter>
    </receiver>
    <receiver android:name="com.instacoin.NotificationReciver" />

    <service android:name="com.instacoin.GCMIntentService" />

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

    <!-- appgrade -->
    <activity
        android:name="com.appgrade.sdk.view.InterstitialActivity"
        android:theme="@style/InterstitialDialogTheme"/>

    <!-- supersonicads -->
    <activity
        android:name="com.supersonicads.sdk.controller.ControllerActivity"
        android:configChanges="orientation|screenSize"
        android:hardwareAccelerated="true" />
    <activity
        android:name="com.supersonicads.sdk.controller.InterstitialActivity"
        android:configChanges="orientation|screenSize"
        android:hardwareAccelerated="true"
        android:theme="@android:style/Theme.Translucent" />
    <activity
        android:name="com.supersonicads.sdk.controller.OpenUrlActivity"
        android:configChanges="orientation|screenSize"
        android:hardwareAccelerated="true"
        android:theme="@android:style/Theme.Translucent" />

    <!-- TrialPay's activities -->
    <activity
        android:name="com.trialpay.android.views.webcontainer.WebContainerActivity"
        android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|uiMode|touchscreen|screenSize"
        android:hardwareAccelerated="true"
        android:theme="@android:style/Theme.NoTitleBar"
        android:windowSoftInputMode="adjustResize" >
    </activity>
    <activity
        android:name="com.trialpay.android.views.webcontainer.WebContainerPopupActivity"
        android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|uiMode|touchscreen|screenSize"
        android:hardwareAccelerated="true"
        android:theme="@android:style/Theme.Translucent.NoTitleBar" >
    </activity>
    <activity
        android:name="com.trialpay.android.views.videocontainer.VideoContainerActivity"
        android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|uiMode|touchscreen|screenSize"
        android:hardwareAccelerated="true"
        android:theme="@android:style/Theme.NoTitleBar.Fullscreen" >
    </activity>
    <!-- persona -->
    <activity android:name="ly.persona.sdk.OffersActivity" />
    <!-- Tapjoy -->
    <activity
        android:name="com.tapjoy.TJAdUnitActivity"
        android:configChanges="orientation|keyboardHidden|screenSize"
        android:hardwareAccelerated="true"
        android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen" />
    <activity
        android:name="com.tapjoy.mraid.view.ActionHandler"
        android:configChanges="orientation|keyboardHidden|screenSize" />
    <activity
        android:name="com.tapjoy.mraid.view.Browser"
        android:configChanges="orientation|keyboardHidden|screenSize" />
    <!-- nativex -->
    <activity
        android:name="com.nativex.monetization.activities.InterstitialActivity"
        android:configChanges="orientation|screenSize"
        android:hardwareAccelerated="true"
        android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen" />
    <activity
        android:name="com.nativex.videoplayer.VideoActivity"
        android:configChanges="orientation|screenSize" />

    <!-- required Activity to show Superrewards video ads -->
    <activity
        android:name="com.playerize.superrewards.activities.SRWebViewActivity"
        android:screenOrientation="portrait" />

    <!-- required Activity to show AdscendMedia video ads -->
    <activity
        android:name="com.adscendmedia.sdk.ui.OffersActivity"
        android:configChanges="orientation|screenSize" >
    </activity>

    <!-- required Activity to show Adcolony video ads -->
    <activity
        android:name="com.jirbo.adcolony.AdColonyOverlay"
        android:configChanges="keyboardHidden|orientation|screenSize"
        android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen" />
    <activity
        android:name="com.jirbo.adcolony.AdColonyFullscreen"
        android:configChanges="keyboardHidden|orientation|screenSize"
        android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen" />
    <activity
        android:name="com.jirbo.adcolony.AdColonyBrowser"
        android:configChanges="keyboardHidden|orientation|screenSize"
        android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen" />

    <!-- required Activity to show Vungle video ads -->
    <activity
        android:name="com.vungle.publisher.FullScreenAdActivity"
        android:configChanges="keyboardHidden|orientation|screenSize"
        android:theme="@android:style/Theme.NoTitleBar.Fullscreen" />


    <activity
        android:name="net.adxmi.android.AdBrowser"
        android:configChanges="keyboard|keyboardHidden|orientation|screenSize"
        android:theme="@android:style/Theme.Light.NoTitleBar" >
    </activity>
    <service
        android:name="net.adxmi.android.AdService"
        android:exported="false" >
    </service>

    <!-- Component that rewarded ADs needs -->
    <service
        android:name="net.adxmi.android.ExpService"
        android:exported="false" >
    </service>
    <!-- Optional Component -->
    <receiver
        android:name="net.adxmi.android.AdReceiver" >
        <intent-filter>
            <action android:name="android.intent.action.PACKAGE_ADDED" />
            <data android:scheme="package" />
        </intent-filter>
    </receiver>
    <activity android:name="com.heyzap.sdk.ads.HeyzapInterstitialActivity" android:configChanges="keyboardHidden|orientation|screenSize|smallestScreenSize" />
    <activity android:name="com.heyzap.sdk.ads.HeyzapVideoActivity" android:configChanges="keyboardHidden|orientation|screenSize|smallestScreenSize" />
    <activity android:name="com.heyzap.sdk.ads.HeyzapProxyActivity" />
    <activity android:name="com.heyzap.sdk.ads.VASTActivity" android:configChanges="keyboardHidden|orientation|screenSize|smallestScreenSize" />
    <activity android:name="com.heyzap.sdk.ads.MediationTestActivity" />
    <receiver android:name="com.heyzap.sdk.ads.PackageAddedReceiver">
        <intent-filter>
            <data android:scheme="package"/>
            <action android:name="android.intent.action.PACKAGE_ADDED"/>
        </intent-filter>
    </receiver>


</application>

Rob
  • 14,746
  • 28
  • 47
  • 65
Angel
  • 109
  • 1
  • 1
  • 2
  • in screen shot given the image name is exist or not in your drawable folder ? – Hemant Parmar Jan 23 '18 at 04:45
  • Check once : that you have no put the image in wrong version of drawable folder eg.drawable(v21) – Android Geek Jan 23 '18 at 05:21
  • Does this answer your question? [AAPT error: resource drawable/... not found](https://stackoverflow.com/questions/49965610/aapt-error-resource-drawable-not-found) – miken32 Dec 06 '19 at 23:22

7 Answers7

6

I just ran into this problem unable to find any solution whatsoever.

Finally I started checking all the layouts and drawables I had recently made and the error lied in one of them. I had written the import statement twice.

<layer-list xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:android="http://schemas.android.com/apk/res/android">
    <item>
        <!--drawable code here-->
    </item>
</layer-list>

Removing this solved it for me. The error displayed by Android Studio pointed nowhere near it.

Usama K. Zafar
  • 302
  • 3
  • 9
4

In my case, cause of the error was the missing closing tag in one of my vector drawable. Check whether your xml based drawables have valid format. Misleading is fact that compiler generates many errors pointing to valid drawables, whereas problem may be in only one drawable. Check this answer for more.

rojarand
  • 445
  • 6
  • 18
  • In my case I somehow removed the opening tag of a vector XML without noticing. Thanks for your hint. – Ben Jan 01 '20 at 18:41
4

In my case the problem caused by two problems, I scared about destroying all my project but it was two simple things, the first which I didn't take care of was naming a drawable something which Android Studio itself may use somewhere which in my case was border.xml, when I created this drawable and then I write some other codes and then I tried to run my project but it couldn't read any of my drawables, so I scared about my project, but then I remembered that this word (border) is something special Android Studio itself may use it in some locations, So I just changed the name to simple_border.xml and then the second problem was just putting two xml defining lines in a single xml file like:-

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

So don't scare about this problem, just do some cleaning staff, and remember what did you do in the last coding while, and also don't forget about the naming problem, don't use something special that you think Android Studio itself may use, and also check the last edited xml files for this problem which is duplicating the xml defining line, Hope it helps.

Azhy
  • 704
  • 3
  • 16
3

Looks like the file res/layout/earn_credits_list_item.xml is trying to reference a drawable that is not present. This resource used to exist in support library < 23.2.0 (and briefly in 23.2.1), but was renamed to abc_ic_ab_back_material in 23.2.0 and in 24.0.0 onward.
If you're using support library > 24.0.0 (which you probably are) rename abc_ic_ab_back_mtrl_am_alpha to abc_ic_ab_back_material.

Izabela Orlowska
  • 7,431
  • 2
  • 20
  • 33
2

i was searching for exactly this error in a few threads and would like anyone who experiences a situation like this to do these steps:

situation:

android studio is throwing errors like @drawable/... not found even renaming files does not solve the problem

solution steps

  1. double check the file ( is it present? is the filename valid?)
  2. if you can examine an error fix it and run an clean / rebuild of the project
  3. if this didnt help take the time and use Android Lint its found at Analyse -> inspect code ... it takes some time but its worth it and now ...
  4. fix every error shown, this isnt a joke those errors could prevent you from building the target. do a clean / rebuild
  5. now if this still does not work here are the stranges things ive seen:

    • in the filename is an invalid char which doesnt show up in the list or at renaming
    • the file is converted but its empty
    • an file is reverted by git but was deleted in future commits
    • after an code cleanup an xml tag is missing its counterpart

where does these errors come from and why they dont show up in the log

android studio is doing an incremental build , so files are proccessed and used again if they weren't changed. this leads to the following behaviour:

running an build -> collecting files -> proccessing files -> an error occured

all other files in the queue arent found as the couldn't get proccessed by build step the following error is shown as the last error occured aka @drawable not found

Basur
  • 339
  • 1
  • 14
0

That didn't fix it, the only way I got it to work was by Uninstalling Android Studio 3.0 and installs 2.3 now it works fine!

Angel
  • 109
  • 1
  • 1
  • 2
0

Keep "drawable" file in "res" folder Just cut drawable folder and paste it into res folderenter image description here

sam.stack
  • 731
  • 5
  • 2